请选择 进入手机版 | 继续访问电脑版

Hello Mat

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 590|回复: 0

Halcon驱动2个相机

[复制链接]

662

主题

781

帖子

4245

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4245
发表于 2019-1-15 22:54:34 | 显示全部楼层 |阅读模式
Halcon驱动2个相机:
具体见例子:C:\Users\Public\Documents\MVTec\HALCON-12.0\examples\hdevelop\Image\Acquisition
PS:出现连接不上的情况,多try几次。
  1. * Image Acquisition 01: Code generated by Image Acquisition 01
  2. open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', '[0] HP TrueVision HD', 0, -1, AcqHandle1)
  3. open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', '[1] HD 720P Webcam', 0, -1, AcqHandle2)
  4. *
  5. dev_update_window ('off')
  6. dev_close_window ()
  7. dev_close_window ()
  8. get_framegrabber_param (AcqHandle1, ['image_width','image_height'], ImageSize1)
  9. dev_open_window (0, 0, ImageSize1[0] , ImageSize1[1] , 'black', WindowHandle1)
  10. dev_set_part (0, 0, ImageSize1[1] - 1, ImageSize1[0] - 1)
  11. get_framegrabber_param (AcqHandle2, ['image_width','image_height'], ImageSize2)
  12. dev_open_window (0, 0, ImageSize2[0], ImageSize2[1], 'black', WindowHandle2)
  13. dev_set_part (0, 0, ImageSize2[1] - 1, ImageSize2[0] - 1)
  14. grab_image_start (AcqHandle1, -1)
  15. grab_image_async (Image1, AcqHandle1, -1)
  16. *
  17. NumImages := 0
  18. count_seconds (SecondsBegin)
  19. while (1)
  20.     grab_image_async (Image1, AcqHandle1, -1)
  21.     dev_set_part (0, 0, ImageSize1[1] - 1, ImageSize1[0] - 1)
  22.     dev_set_window (WindowHandle1)
  23.     dev_display (Image1)
  24.     *
  25.     grab_image_async (Image2, AcqHandle2, -1)
  26.     dev_set_part (0, 0, ImageSize2[1] - 1, ImageSize2[0] - 1)
  27.     dev_set_window (WindowHandle2)
  28.     dev_display (Image2)
  29.     *
  30.     NumImages := NumImages + 1
  31.     count_seconds (SecondsCurrent)
  32.     FrameRate := NumImages / (SecondsCurrent - SecondsBegin)
  33. endwhile
  34. *
  35. close_framegrabber (AcqHandle2)
  36. close_framegrabber (AcqHandle1)
复制代码


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
程序:算法QQ  3283892722
群智能算法视频售价:38元,链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


Python|Opencv|MATLAB|Halcom.cn  

GMT+8, 2019-2-22 09:45 , Processed in 0.118014 second(s), 29 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表