Chapter 3
Grayscale and Color Measurements
©
National Instruments Corporation
3-9
IMAQ Vision for LabWindows/CVI User Manual
2.
Use the entire image or regions in the image to learn the color
information using
imaqLearnColor()
, which outputs a color
spectrum that contains a compact description of the color information
that you learned. Use the color spectrum to represent the learned color
information for all subsequent matching operations. See Chapter 14,
Color Inspection
, of the
IMAQ Vision Concepts Manual
for more
information.
3.
Define an entire image, a region, or multiple regions in an image as the
inspection or comparison area.
4.
Use
imaqMatchColor()
to compare the learned color information to
the color information in the inspection regions. This function returns
an array of scores that indicates how close the matches are to the
learned color information.
5.
Use the color matching score as a measure of similarity between the
reference color information and the color information in the image
regions being compared.
Learning Color Information
When learning color information, you should choose the color information
carefully:
•
Specify an image or regions in an image that contain the color or color
set that you want to learn.
•
Select how detailed you want the color information to be learned.
•
Choose colors that you want to ignore during matching.
Choosing the Right Color Information
Because color matching only uses color information to measure similarity,
the image or regions in the image representing the object should contain
only the significant colors that represent the object, as shown in
Figure 3-5a. Figure 3-5b illustrates an unacceptable region containing
background colors.