|
Halcon驱动2个相机:
具体见例子:C:\Users\Public\Documents\MVTec\HALCON-12.0\examples\hdevelop\Image\Acquisition
PS:出现连接不上的情况,多try几次。- * Image Acquisition 01: Code generated by Image Acquisition 01
- open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', '[0] HP TrueVision HD', 0, -1, AcqHandle1)
- open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', '[1] HD 720P Webcam', 0, -1, AcqHandle2)
- *
- dev_update_window ('off')
- dev_close_window ()
- dev_close_window ()
- get_framegrabber_param (AcqHandle1, ['image_width','image_height'], ImageSize1)
- dev_open_window (0, 0, ImageSize1[0] , ImageSize1[1] , 'black', WindowHandle1)
- dev_set_part (0, 0, ImageSize1[1] - 1, ImageSize1[0] - 1)
- get_framegrabber_param (AcqHandle2, ['image_width','image_height'], ImageSize2)
- dev_open_window (0, 0, ImageSize2[0], ImageSize2[1], 'black', WindowHandle2)
- dev_set_part (0, 0, ImageSize2[1] - 1, ImageSize2[0] - 1)
- grab_image_start (AcqHandle1, -1)
- grab_image_async (Image1, AcqHandle1, -1)
- *
- NumImages := 0
- count_seconds (SecondsBegin)
- while (1)
- grab_image_async (Image1, AcqHandle1, -1)
- dev_set_part (0, 0, ImageSize1[1] - 1, ImageSize1[0] - 1)
- dev_set_window (WindowHandle1)
- dev_display (Image1)
- *
- grab_image_async (Image2, AcqHandle2, -1)
- dev_set_part (0, 0, ImageSize2[1] - 1, ImageSize2[0] - 1)
- dev_set_window (WindowHandle2)
- dev_display (Image2)
- *
- NumImages := NumImages + 1
- count_seconds (SecondsCurrent)
- FrameRate := NumImages / (SecondsCurrent - SecondsBegin)
- endwhile
- *
- close_framegrabber (AcqHandle2)
- close_framegrabber (AcqHandle1)
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|