Chapter 3
Grayscale and Color Measurements
©
National Instruments Corporation
3-7
IMAQ Vision for LabWindows/CVI User Manual
When you need to make intensity measurements on particles in an image,
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
Chapter 4,
. You can input the binary image or a labeled
version of the binary image as a mask image to the intensity measurement
function. If you want to make color comparisons, convert the binary image
into an ROI descriptor using
imaqMaskToROI()
.
Measure Grayscale Statistics
You 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.
Use
imaqLightMeterPoint()
to measure the light intensity at a point in
the image. Use
imaqLightMeterLine()
to get pixel value statistics
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 region in an image.
Use
imaqQuantify()
to obtain the following statistics about the entire
image or individual regions in the image: mean intensity, standard
deviation, minimum intensity, maximum intensity, area, and the percentage
of the image that you analyzed. You can specify regions in the image with
a labeled image mask. A labeled image mask is a binary image that has
been processed so that each region in the image mask has a unique intensity
value. Use
imaqLabel()
to label your image mask.
Use
imaqCentroid()
to compute the energy center of the image, or of a
region within an image.
Measure Color Statistics
Most image processing and analysis functions apply to 8-bit images.
However, you can analyze and process individual components of a color
image.
Using
imaqExtractColorPlanes()
, you can break down a color image
into various sets of primary components, such as RGB (Red, Green, and
Blue), HSI (Hue, Saturation, and Intensity), HSL (Hue, Saturation, and
Luminance), or HSV (Hue, Saturation, and Value). Each component
becomes an 8-bit image that you can process like any other grayscale