LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

determine median value of a ROI in an image

Hi
I'm trying to determine the median value of a region of interest from an image that has an embedded bayer pattern.  The bayer pattern is RGGB.  Using IMAQ Extract, I extract out only the green change (for example) - which is every 2nd column and every 2nd row.  This works fine.   Next I convert the image to an array and use the optional rectangle input to select for my ROI.  This doesn't work.  It is selecting every 2nd row and every 2nd column to create my ROI.  Why?
Is there a better way to do this?

I'll attempt to attach my vi...

Thanks,
sau
0 Kudos
Message 1 of 4
(2,875 Views)
I think my original vi was too big.  The image is 2048 x 1536.  The ROI portion didn't work when the image was that big.  I'm sending a vi that uses a smaller 9x9 image instead and the ROI portion works here.  Any ideas why?  Is there a limit to the image size?

Vi in labview 7.1

Message Edited by sau on 03-02-2006 04:08 PM

0 Kudos
Message 2 of 4
(2,810 Views)
Hi sau -

Glancing at your VI, I noticed that you're performing multiple extractions and overwriting the same image buffer.  Remember that, unlike other LabVIEW data, the image datatype is a reference to a specific memory buffer.  If you don't provide a destination buffer for Vision functions, those functions will overwrite the original image.  When you perform three functions on the same buffer in parallel (i.e. IMAQ Extract), each function is working with the result of the one that executed before it (instead of working with the original image).  This could be causing a lot of your problems.
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 3 of 4
(2,797 Views)

Thanks David! 


That was my problem.  I have to remember the words "specific memory buffers" from now on.  Smiley Happy

0 Kudos
Message 4 of 4
(2,785 Views)