Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image Buffer in VBAI

Solved!
Go to solution

Hi,

I am working on a project with 3 cameras on a rotary table. 2 of them is at the same station and are triggered with one sensor. And the third one is at another station, triggered with the second sensor.

The problem is, we can not control the part flow into this table at a constant rate. This causes synchronization problems of acquiring images and knowing which image belongs to which product. In order to prevent that, we need a programming pattern which is able to store images, and after that process the images based on their frame number, so we can know images belong same product. Although I have not used buffering before, I think this design can be implemented with the aid of queues in Labview.

I could not find a way to do this in VBAI. I would like to get images from different cameras and then recall these images according to their frame numbers and process. Any suggestion would be appreciated.

0 Kudos
Message 1 of 8
(3,916 Views)
Use the "Every Image" acquisition mode. This will ensure no images are skipped and you always get the next unprocessed image even if the acquisition has acquired more images. You need to ensure the processing can keep up to avoid overflowing the acquisition buffer though.
Assuming no parts are acquired while the inspection is loading, the first time each step runs will correspond to the same part acquired by each camera.
Hope this helps
Brad
0 Kudos
Message 2 of 8
(3,888 Views)

Thank you for your response Brad. But I need someway to get images based on their frame numbers. In the scenario with every image, there is the possibility of missing an image from the second station while trying to get image from the first station because "every image" will always get the next image. We must store every image triggered whether or not the inspection is running and then get the oldest image acquired (not the next image) when we run acquire image step.

Is it possible to store images on camera itself, and get the very first image it has acquired when I run the Acquire Image step?

0 Kudos
Message 3 of 8
(3,877 Views)
Solution
Accepted by topic author sevincom

That is what Every Image is for. Once the inspection has loaded and you acquire and process the first image from camera A, when you get to the acquire step for camera B, even if camera B has returned 3 images, the step will return the first one. The other images are buffered by the driver and the second image is returned on the next call, even newer images have been acquired.

 

Check out this video that better explains how this mode works:

http://www.ni.com/webcast/2872/en/

(Slide 4-8)

 

Try it out and let me know if you have more questions.

Thanks,

Brad

Message 4 of 8
(3,870 Views)

When you have first suggested, I have checked it with 3 buffers and thought that it is not working as it should be. But after working a little bit, I figured out that it is getting the last image if the acquired images are more than the half of the buffer number. Now the problem is solved, thank you for your help.

0 Kudos
Message 5 of 8
(3,844 Views)

I believe the IMAQdx driver reserves half the buffers for internal buffering so users only have access to acquiring half of the allocated buffers. So if you allocate 10 buffers, and you fall behind by more than 5, you won't be able to get the older buffers you need to avoid missing images. Hopefully you won't need more than 5 buffers of older images since 10 is the default max number of buffers you can allocate. Let me know if this isn't enough for you.

Thanks,

Brad

0 Kudos
Message 6 of 8
(3,839 Views)

5 frames will be enough for my case. But for future reference, is there a way to increase that default max number or is it the absolute maximum?

0 Kudos
Message 7 of 8
(3,818 Views)

You can add the following INI token to the Vision Builder.ini

[Settings]

MaxIMAQdxBuffers = 20

Hope that helps,

Brad

Message 8 of 8
(3,812 Views)