Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

how to release acquire buffers for processing?

Hi - I am new to NI IMAQ and am probably asking a redundant question (sorry for that).  I have a working system that takes raw RGB in (from a camera board) and displays processed color images (Bayer demosaic etc. in a ring setup) at 30fps.   I would now like to add a layer to extract the color planes and to process regions of interest (MacBeth chart squares) to play with color balance etc..  It is OK if this processing reduces the frame rate a bit (30fps to 5 or 10 is OK) since I will turn it off when balanced.  But I want it to be done on the real time video stream from the sensor. 

However,  when I use the standard widgets for color plane extraction, per the help files, I keep running into error messages that tell me I am trying to work on a locked acquire buffer (from the ring) and I can not do that.  So how do I get around this or release buffers?  I tried copying buffers and the extract widgets, but these seem to have similar problems.  Of course the shipped demos work fine, but they read images from the disk and do not use a ring. I feel like I am missing something very fundemental here - any pointers?

Thanks
0 Kudos
Message 1 of 3
(3,232 Views)
Hi CC1_Forza,
You will need to use the IMAQ Create to create a buffer (seperate from the Ring buffer) for the image before you do any processing.  Then, you will use IMAQ Copy to copy the image from the Ring buffer to the new buffer you created.  After copying the image to the new buffer you will be able to do image processing.  If this does not work please attach a simplified sample of code and I will take a look at it.

Regards,
Brooks W.
National Instruments
0 Kudos
Message 2 of 3
(3,223 Views)
Thanks Brooks W.!

This worked well and directly solved the problem.  But even more, from reading the helps+example related to this group of vi's (IMAQ Create and Copy), I am starting to get a handle on the buffer allocation/use/release aspects of the IMAQ approach, which opens up the rest of the processing and analysis vi's - I am starting to get it now.  Thanks for the quick response and for pointing me in the right direction.

cheers,
Chris
0 Kudos
Message 3 of 3
(3,211 Views)