Qt(C++)项目中使用 Basler 工业相机(图像获取策略)

xiaoxiao2021-02-28  83

Qt(C++)项目中使用 Basler 工业相机(图像获取策略)

Pylon 中的 CInstantCamera 类支持四种图像获取策略,分别称为:

One by One Grab StrategyLatest Image Only Grab StrategyLatest Images StrategyUpcoming Image Grab Strategy

下面就简单写写这几种策略的含义和区别。

One by One Grab Strategy

这种模式是最简单的,也是 CInstantCamera 默认的图像获取策略。获取到的图像放到一个FIFO 队列中。每次我们从队列中取的(RetrieveResult)都是最早放到队列中的图像。

Latest Image Only Grab Strategy

这个策略下只有最新到的图像保存在输出队列中。如果一份旧图像还没被读取新图像就又来了,那么旧图像就被舍弃。这样可以保证读取到图像永远都是读取时刻最新的。

Latest Images Strategy

这个模式下输出队列可以保存不止一张图像,具体最多能保存几张图象由 CInstantCamera::OutputQueueSize 来指定。当新的图像来了,而队列已满时,旧的图像被舍弃。 当 CInstantCamera::OutputQueueSize 为 1 时就是 Latest Image Only Grab Strategy。当CInstantCamera::OutputQueueSize = CInstantCamera::MaxNumBuffer,就和 One by One Grab Strategy 一样了。

Upcoming Image Grab Strategy

这个模式很特别,只有当 CInstantCamera::RetrieveResult() 被调用后才会采集图像。USB 相机不支持这种策略。

如何设置这些策略呢,非常的简单,只要用 StartGrabbing() 函数的第一个参数指定一下就可以了。

void Pylon::CInstantCamera::StartGrabbing ( EGrabStrategy strategy = GrabStrategy_OneByOne, EGrabLoop grabLoopType = GrabLoop_ProvidedByUser )
转载请注明原文地址: https://www.6miu.com/read-82253.html

最新回复(0)