Chapter5 MachineVision
©NationalInstruments Corporation 5-23 IMAQVision for LabWindows/CVI User Manual
The followingare some elements in the IM AQVision pattern matching
algorithm and howthey influence pattern matchin g:c olor sensitivity,
search strategy,color score weight, ignore background colors, minimum
contrast, and rotation angle ranges.
Color SensitivityUse the sensitivityelement to control the granularity of the color
information in the template image. If the background and objects in the
imagecontain colors that are very close to colors in the template image, use
ahigher color sensitivi ty setting. A higher sensitivity setting distinguishes
colors with very close hue values. Three color sensitivity settings are
available in IMAQ Vision: IMAQ_SENSITIVITY_LOW,
IMAQ_SENSITIVITY_MED,andIMAQ_SENSITIVITY_HIGH.Usethe
defaultLow setting if the colors in the template are very different from t he
colors in the background or other objects that you are not interested in.
Increasethe color sensitivity settings as the color differences decrease. For
moreinformation on color sensiti vity, see Chapter 14, Color Inspection,of
the IMAQ Vision Concepts Manual.
Search StrategyUse the strategyelement t o optimize the speed of the color pattern
matching algorithm. The search strategy controls the step size,
sub-sampling factor, percentage of color information used from the
template.
Choosefrom fourdifferent strategies:
•IMAQ_VERY_AGGRESSIVE—Usesthe largest step size, the most
sub-samplingand only the dominant colo r from the template to search
for the template. Use this strategywhen the colo r in the template is
almost uniform, the template is well contrasted from the background
andthere is a good amount of separation between different occurrences
of the template in the image. This strategy is the fastest way to find
templatesin an image.
•IMAQ_AGGRESSIVE—Usesa large step size, a lot of sub-sampling,
and little of the color information from the template.
•IMAQ_BALANCED—Usesvalues in between the IMAQ_AGGRESSIVE
and IMAQ_CONSERVATIVEstrategies.
•IMAQ_CONSERVATIVE—Usesa very small step size, a sub-sampling
factorof two, and all the color information present in the template.
Thisstrategy is the most reliable met hod to look for a template in any
image at potentially reducedspeed.