Hello Mat

 找回密码
 立即注册
查看: 6421|回复: 0

Halcon驱动2个相机

[复制链接]

1323

主题

1551

帖子

0

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22647
发表于 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
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

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

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-11-23 00:19 , Processed in 0.225201 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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