National Instruments IMAQTM Benutzerhandbuch

Seite von 121
Chapter 5
Performing Machine Vision Tasks
© National Instruments Corporation
5-23
The time required to locate a pattern in an image depends on both the 
template size and the search area. By reducing the search area or increasing 
the template size, you can reduce the required search time. Increasing the 
size of the template can improve search time, but doing so reduces match 
accuracy if the larger template includes an excess of background 
information.
Setting Matching Parameters and Tolerances
Every color pattern matching algorithm makes assumptions about the 
images and color pattern matching parameters used in machine vision 
applications. These assumptions work for a high percentage of the 
applications.
In some applications, the assumptions used in the algorithm are not 
optimal. In such cases, you must modify the color pattern matching 
parameters. To efficiently select the best pattern matching parameters for 
the application, you must have a clear understanding of the application and 
the images you want to process. 
The following sections discuss parameters of the IMAQ Vision color 
pattern matching algorithm, and how they influence the algorithm.
Color Sensitivity
Use the color sensitivity to control the granularity of the color information 
in the template image. If the background and objects in the image contain 
colors that are very close to colors in the template image, use a higher color 
sensitivity setting. A higher sensitivity setting distinguishes colors with 
very close hue values. Three color sensitivity settings are available in 
IMAQ Vision: low, medium, and high. Use the low setting, which is the 
default, if the colors in the template are very different from the colors in the 
background or other objects that you are not interested in. Increase the 
color sensitivity settings as the color differences decrease. Use 
CWIMAQMatchColorPatternOptions.ColorSensitivity
 to set the 
color sensitivity. For information about color sensitivity, refer to 
Chapter 14, Color Inspection, of the IMAQ Vision Concepts Manual.
Search Strategy
Use the search strategy to optimize the speed of the color pattern matching 
algorithm. The search strategy controls the step size, sub-sampling factor, 
and the percentage of color information used from the template.