![](/images/backgrounds/145307/bg21.png)
Chapter3 Grayscaleand Color Measurements
©NationalInstruments Corporation 3-7 IMAQVision for LabWindows/CVI User Manual
When you needto make intensity measurements on particlesin an i mage,
you can use a mask to define the particles. First, threshold your image to
make a new binary image. For more information on binary images, see
Chapter4, Blob Analysis.You can inputthe binary imageor a labeled
versionof the binaryimag e as a mask image to the intensity measurement
function.If you want to make color comparisons, convert the binary image
intoan ROIdescriptor using imaqMaskToROI().
Measure Grayscale StatisticsYou can measure grayscale statistics in images using light meters or
quantitative analysis functions. You can obtain the center of energy for an
image with the centroid function.
UseimaqLightMeterPoint() to measure the light intensity at a point in
the image. Use imaqLightMeterLine() to get pixel valuestatistics
along a line in the image, such as mean intensity,standard deviation,
minimum intensity,and maximum intensity. Use
imaqLightMeterRect()to get the pixel value statistics within a
rectangular regioni nan i mage.
Use imaqQuantify()to obtain the following statistics about the entire
image or individualregions in the imag e:m ean intensity,standard
deviation,minimum intensity, maximum intensity,a rea, andt he percentage
ofthe imagethat you analy zed. Youcan specify regions in the image with
alabeled image mask.A labeled image mask is a binary image that has
beenprocessed so that each region in the image mask has a unique intensity
value. Use imaqLabel() to label your image mask.
UseimaqCentroid() to co mpute the energycenter of the i mage, or of a
regionw ithin an image.
Measure Color StatisticsMostimage processingand analysis functions apply to 8-bit images.
However, you can analyze and process individual components of a color
image.
UsingimaqExtractColorPlanes(), you can break down a color image
into varioussets of primary components, such as RGB (Red, Green, and
Blue),H SI (Hue, Saturation, and Intensity), HSL (Hue, Saturation, and
Luminance), orH SV (Hue, Saturation, and Value).Each component
becomesan 8 -bit imagethat you can process like any other grayscale