Chapter 5 Performing Machine Vision Tasks
© National Instruments Corporation 5-23 IMAQ Vision for LabWindows/CVI User Manual
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
template size can improve the 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. However, there may be applications in which the assumptions
used in the algorithm are not optimal. In such cases, you must modify the
color pattern matching parameters. Knowing your particular application
and the images you want to process is useful in selecting the pattern
matching parameters. Use the options parameter of
imaqMatchColorPattern() to set these elements.
The following are elements of the IMAQ Vision pattern matching
algorithm that influence color pattern matching: color sensitivity, search
strategy, color score weight, ignore background colors, minimum contrast,
and rotation angle ranges. These elements are discussed in the following
sections.

Color Sensitivity

Use the sensitivity element 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. Increase the color sensitivity settings as
the color differences decrease. Three color sensitivity settings are available
in IMAQ Vision: IMAQ_SENSITIVITY_LOW, IMAQ_SENSITIVITY_MED,
and IMAQ_SENSITIVITY_HIGH. Refer to Chapter 14, Color Inspection,
of the IMAQ Vision Concepts Manual for more information about color
sensitivity.

Search Strategy

Use the strategy element to optimize the speed of the color pattern
matching algorithm. The search strategy controls the step size,
sub-sampling factor, and percentage of color information used from
the template.