Chapter 5
Performing Machine Vision Tasks
©
National Instruments Corporation
5-13
IMAQ Vision for LabWindows/CVI User Manual
Finding Points Using Pattern Matching
The pattern matching algorithms in IMAQ Vision measure the similarity
between an idealized representation of a feature, called a template, and the
feature that may be present in an image. A feature is defined as a specific
pattern of pixels in an image. Pattern matching returns the location of the
center of the template and the template orientation. Complete the following
generalized steps to find features in an image using pattern matching.
1.
Define a template image in the form of a reference or fiducial pattern.
2.
Use the reference pattern to train the pattern matching algorithm with
imaqLearnPattern2()
.
3.
Define an image or an area of an image as the search area. A small
search area reduces the time to find the features.
4.
Set the tolerances and parameters to specify how the algorithm
operates at run time using the
options
parameter of
imaqMatchPattern2()
.
5.
Test the search algorithm on test images using
imaqMatchPattern2()
.
6.
Verify the results using a ranking method.
Defining and Creating Good Template Images
The selection of a good template image plays a critical part in obtaining
good results. Because the template image represents the pattern that you
want to find, make sure that all the important and unique characteristics of
the pattern are well defined in the image.
These factors are critical in creating a template image: symmetry, feature
detail, positional information, and background information.