Chapter3 Grayscaleand Color Measurements
©NationalInstruments Corporation 3-11 IMAQVision for LabWindows/CVI User Manual
Figure3-7. Usinga Single Region to Learn Color Distribution
Using Multiple Regions in the Image
The interactionof light with an objects surface creates the observed
color of that object. The color of a surface depends on the directions of
illumination and the direction from which the surface is observed. Two
identicalobjects may have different appearances because of a difference in
positioning or a change in the lighting conditions. Figure 3-8 shows how
light reflects differently off of the 3D surfaces of the fuses, resulting in
slightlydifferent colors for identical fuses. (Compare th e 3 amp fuse in the
upper row with the 3 amp fuse in the lower row.) This results in different
colorspectra for identical fuses.
Ifyou learn the color spectrum by drawing a region of interest around the
3 amp fusein the upper row, and then do a color matching for the 3 amp
fusein the upper row, you get a very high match score for it (close to 1000).
Butthe match score for the 3 amp fuse in the lower row is quite low (around
500).This problem could cause a mismatch for the color matching in a fuse
box inspection process.
IMAQVisions color learning software uses a clustering process to find
the representativecolors from the color information specified by one or
multipleregions in the image. To create a representative color spectrum for
all3 amp fuses in the learning phase, draw an ROI around the 3 amp fuse
in the upper row,hold down <Shift>, and draw another ROI around the 3
ampfuse in the lower row. The new color spectrum results in similar, high
match scores(around 800) for both 3 amp fuses. Use as many samples as
you wantin an image to learn the representative color spectrum for a
specifiedtemplate.