Acquisition-CreateAcqFifo

This sample demonstrates how to create a new ICogAcqFifo operator for a given video format. The CogAcqFifoTool does not acquire images by itself. Instead it uses the ICogAcqFifo to acquire images.
此示例演示如何为给定的视频格式创建新的 ICogAcqFifo operator。 CogAcqFifoTool 本身不获取图像。 相反,它使用 ICogAcqFifo 来获取图像。

When the user wants to change the video format, a new ICogAcqFifo must be created. The sample displays an error and exits if it cannot locate a frame grabber. This is because the frame grabber creates the ICogAcqFifo.
当用户想要改变视频格式时,必须创建一个新的 ICogAcqFifo。 如果无法找到图像采集卡,该示例会显示错误并退出。 这是因为图像采集卡创建了 ICogAcqFifo。

The sample will acquire an image when the Acquire button is pressed and display on the CogDisplay.
当按下获取按钮并显示在 CogDisplay 上时,示例将获取图像。

This program assumes that you have some knowledge of C# and VisionPro programming.
本程序假定您具有一些 C# 和 VisionPro 编程知识。

The following steps show how to create a new CogAcqFifo operator.
Step 1) Create the CogFrameGrabbers. Make sure there is at least one Cognex frame grabber on the system.
Step 2) Select the first frame grabber.
Step 3) Create an ICogAcqFifo operator with the selected video format.
Step 4) Acquire an image and display it when the Acquire button is pressed.
以下步骤展示了如何创建一个新的 CogAcqFifo 运算符。
步骤 1) 创建 CogFrameGrabbers。 确保系统上至少有一个 Cognex 图像采集卡。
步骤 2) 选择第一个图像采集卡。
步骤 3) 使用选定的视频格式创建一个 ICogAcqFifo 运算符。
步骤 4) 获取图像并在按下获取按钮时显示它。

Note that the .NET garbage collector is called every 5th image to free up images that are being held on the heap.
请注意,每 5 个图像调用 .NET 垃圾收集器以释放堆中保存的图像。

在 Form1.Designer.cs 中,添加 dispose的内容

using Cognex.VisionPro;

if (disposing)
   {
      CogFrameGrabbers frameGrabbers = new CogFrameGrabbers();
      foreach (ICogFrameGrabber fg in frameGrabbers)
      fg.Disconnect(false);
   }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值