Chapter3 Grayscaleand Color Measurements
©NationalInstruments Corporation 3-9 IMAQVision for LabWindows/CVI User Manual
2. Use the entire image or regionsin t he image to learn the color
information using imaqLearnColor(), which outputs a color
spectrumthat contains a compact description of the color information
thatyou learned. Use the color spectrum to represent the learned color
information for all subsequent matching operations. See Chapter 14,
ColorInspection,oftheIMAQ Vision Concepts Manual for more
information.
3. Definean entire image, a region, or multiple regions in an image as the
inspectionor comparison area.
4. UseimaqMatchColor() to compare the learned color information to
the color information in the inspection regions. This function returns
anarray of scores that indicates how close the matches are to the
learned color information.
5. Use thecolor matching score as a measure of similarity between the
reference color information and the color information in the image
regionsbeing compared.
Learning Color InformationWhenlearning color information, you should choose the color information
carefully:
•Specifyan image or regions in an image that contain the color or color
setthatyouwanttolearn.
•Selecthow detailed you want the color information to be learned.
•Choose colors that you want to ignore during matching.
Choosing the Right Color InformationBecausecolor 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
Figure3 -5a.Figure 3-5b i llustrates an unacceptable region containing
background colors.