Chapter 5 Performing Machine Vision Tasks
© National Instruments Corporation 5-25 IMAQ Vision for LabWindows/CVI User Manual
Rotation Angle Ranges
Refer to the Setting Matching Parameters and Tolerances section of this
chapter for information about rotation angle ranges.
Testing the Search Algorithm on Test ImagesTo determine if your selected template or reference pattern is appropriate
for your machine vision application, test the template on a few test images
by using imaqMatchColorPattern(). These test images reflect the
images generated by your machine vision application during true operating
conditions. If the pattern matching algorithm locates the reference pattern
in all cases, you have selected a good template. Otherwise, refine the
current template, or select a better template until both training and testing
are successful.
Finding Points Using Color LocationColor location algorithms provide a quick way to locate regions in an image
with specific colors. Use color location when your application has the
following characteristics:
• Requires the location and the number of regions in an image with their
specific color information
• Relies on the cumulative color information in the region, instead of the
color arrangement in the region
• Does not require the orientation of the region
• Does not always require the location with sub-pixel accuracy
• Does not require shape information for the region
Complete the following general steps to find features in an image using
color location.
1. Define a reference pattern in the form of a template image.
2. Use the reference pattern to train the color location algorithm with
imaqLearnColorPattern().
3. Define an image or an area of an image as the search area. A small
search area reduces the time to find the features.
4. Set the featureMode element of the imaqMatchColorPattern()
options parameter to IMAQ_COLOR_FEATURES.
5. Set the tolerances and parameters to specify how the algorithm
operates atr un time using the options parameter of
imaqMatchColorPattern().