Chapter5 MachineVision
©NationalInstruments Corporation 5-25 IMAQVision for LabWindows/CVI User Manual
reference pattern in allcases, you have selected a good template.
Otherwise,refine the current template, or select a better template until both
training and testingare successful.
Finding Points Using Color Location
Colorlocation algorithms provide a quick way to locate reg ions in an image
withspecific colors.
Use color location when your application:
Requiresthe location and the number of regionsin an image with their
specificcolor information
Relieson the cumulative color information in the region, instead of the
colorarrangement in the region
Does not require the orientation of the region
Does not alwaysrequire the location with sub-pixel accuracy
Does not require shape information for the region
Followthese general steps to find features in an image using color location:
1. Definea reference pattern in the form of a template image.
2. Use the reference pattern to train the color location algorithm with
imaqLearnColorPattern().
3. Definean image or an area of an image as the search area. A small
search area reducesthe timeto find the features.
4. Set the featureModeelement oft he imaqMatchColorPattern()
options parameter to IMAQ_COLOR_FEATURES.
5. Sett he tolerances and parametersto specify how the algorithm
operates atr un time using the options parameter of
imaqMatchColorPattern().
6. Testthe color location algorithm on test images using
imaqMatchColorPattern().
7. Verifythe results using a ranking method.
Youcan save the template image using imaqWriteVisionFile().