National Instruments IMAQTM 用户手册

下载
页码 121
Chapter 5
Performing Machine Vision Tasks
© National Instruments Corporation
5-25
Minimum Contrast
Use the minimum contrast to increase the speed of the color pattern 
matching algorithm. The color pattern matching algorithm ignores 
all image regions where grayscale contrast values fall 
beneath a set minimum contrast value. Use 
CWIMAQMatchColorPatternMatchingOptions.MinimumContrast
 
to set the minimum contrast. Refer to the 
 section of this chapter for more information about minimum 
contrast.
Rotation Angle Ranges
If you know that the pattern rotation is restricted to a certain range, provide 
this restriction information to the pattern matching algorithm by using 
the
CWIMAQMatchPatternOptions.RotationAngleRanges
 property. 
This information improves the search time because the color pattern 
matching algorithm looks for the pattern at fewer angles. Refer to 
Chapter 12, Pattern Matching, in the IMAQ Vision Concepts Manual 
for more information about pattern matching.
Testing the Search Algorithm on Test Images
To determine if the selected template or reference pattern is appropriate for 
the machine vision application, test the template on a few test images by 
using the 
CWIMAQVision.MatchColorPattern
 method. These test 
images should reflect the images generated by the machine vision 
application during true operating conditions. If the color 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 Location
Color location algorithms provide a quick way to locate regions in an image 
with specific colors. 
Use color location under the following circumstances:
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