![background image](http://html1.mh-extra.com/html/national-instruments/imaq-vision-for-measurement-studio/imaq-vision-for-measurement-studio_user-manual_3449779061.webp)
Chapter 5
Machine Vision
©
National Instruments Corporation
5-15
IMAQ Vision for LabWindows/CVI User Manual
Background information
Unique background information in a template improves search
performance and accuracy.
Figure 5-10.
Background Information
Training the Pattern Matching Algorithm
After you create a good template image, the pattern matching
algorithm has to learn the important features of the template. Use
imaqLearnPattern()
to learn the template. The learning process
depends on the type of matching that you expect to perform. If you do not
expect the instance of the template in the image to rotate or change its size,
then the pattern matching algorithm has to learn only those features from
the template that are necessary for shift-invariant matching. However, if
you want to match the template at any orientation, use rotation-invariant
matching. Use the
learningMode
parameter of
imaqLearnPattern()
to
specify which type of learning mode to use.
The learning process is usually time intensive because the algorithm
attempts to find the optimum features of the template for the particular
matching process. The learning mode you choose also affects the speed of
the learning process. Learning the template for shift-invariant matching is
faster than learning for rotation-invariant matching. You can also save time
by training the pattern matching algorithm offline and then saving the
template image with
imaqWriteVisionFile()
.
Defining a Search Area
Two equally important factors define the success of a pattern matching
algorithm: accuracy and speed. You can define a search area to reduce
ambiguity in the search process. For example, if your image has multiple
instances of a pattern and only one of them is required for the inspection
task, the presence of additional instances of the pattern can produce
Pattern with Insufficient
Background Information
Pattern with Sufficient
Background Information