少有人走的路

勇哥的工业自动化技术网站

算子OpenFramegrabbe获取halcon的相机设备连接字符串


以前在使用算子OpenFramegrabbe连接相机时,一般是这样的:

open_framegrabber ('DirectShow', 1, 1, 0, 0, 0, 0, 'default', 8, 'rgb', -1, 'false', 'default', 'default', 0, -1, AcqHandle)
grab_image_start (AcqHandle, -1)

    grab_image_async (Image, AcqHandle, -1)
    * Do something

close_framegrabber (AcqHandle)

但是其实第4个参数,可以传出相机连接字符串,并不一定总是设置为'default',如下代码所示:

HOperatorSet.OpenFramegrabber(new HTuple("DirectShow"),
      new HTuple(0),
      new HTuple(0),
      new HTuple(0),
      new HTuple(0),
      new HTuple(0),
      new HTuple(0),
      new HTuple("progressive"),
      new HTuple(-1),
      new HTuple("default"),
      new HTuple(-1),
      new HTuple("false"),
      new HTuple("default"),
      Work.Instance.cameraStr,
      new HTuple(0),
      new HTuple(-1),
 out handle);


这一点被勇哥乎略了。有了这个可以在程序中自动读出设备的连接串,然后进行选择,在多相机的时候比较方便。


  • 评论列表

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

«    2025年12月    »
1234567
891011121314
15161718192021
22232425262728
293031
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接

Powered By Z-BlogPHP 1.7.3

Copyright www.skcircle.com Rights Reserved.

鄂ICP备18008319号


站长QQ:496103864 微信:abc496103864