HALCON-实时读取摄像头图像

1.点击助手->打开新的Image Acquisition

2.在资源选项卡上,选择图像获取借口,点自动检测接口,选择工具栏里面的连续采集按钮

HALCON-实时读取摄像头图像_第1张图片

3.切换到代码生成选项卡,点击插入代码即可

HALCON-实时读取摄像头图像_第2张图片

代码如下:

* 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] Integrated Webcam', 0, -1, AcqHandle)
grab_image_start (AcqHandle, -1)
while (true)
    grab_image_async (Image, AcqHandle, -1)
    * Image Acquisition 01: Do something
   
endwhile
close_framegrabber (AcqHandle)

你可能感兴趣的:(HALCON)