10-07-2008 12:35 PM
I have an app written in VB6 where I have placed multiple ROIs on the image. I wish to measure the brightness in each ROI.
I know I can do this using a light meter in a loop. However, is there a way to measure all of the ROIs at one time?
Thanks!
10-07-2008 03:46 PM
Steverino -
If you look at the Machine Vision source code for LightMeterRectangle (found in <National Instruments>\Vision\Source\MSVB\MachineVision\) you can see that all it's doing is converting the rectangle to a mask and then calling CWIMAQVision.Histogram2. If you want to measure the total brightness over a whole ROI, you can do a similar thing - simply call RegionsToMask to get a mask image and then call CWIMAQVision.Histogram2 with that mask image.
Alternatively, you can look at CWIMAQVision.RegionsProfile - this returns a report for each contour in the region.
Hope this helps!
Greg Stoll
Vision R&D
National Instruments
10-07-2008 05:15 PM - edited 10-07-2008 05:19 PM
What if I had multiple regions in an image and wanted to do more than measure light intensity?
For example, suppose I wanted to perform autothresholding such as clustering. I would need to restrict processing to each region else the results might be incorrect if the region were significantly different from the image as a whole.
How do I step through each region, do the image processing, and extract measurements for each region? Do you have code or pseudo-code that does this?
Thanks!