
Chapter5 MachineVision
©NationalInstruments Corporation 5-15 IMAQVision for LabWindows/CVI User Manual
Background information
Unique background information ina templateimproves search
performanceand accuracy.
Figure5-10. Background Information
Trainingthe Pattern Matching AlgorithmAfteryou create a good template image, the pattern matching
algorithmh as to learn the important features of the template. Use
imaqLearnPattern()to learn the template. The learning process
dependson the ty peo fma tching that you expect to perform. If you do not
expectthe instance of the templat e in the image to rotate or change its size,
then the pattern matchingalgorithm has to learn only those featuresfrom
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 learningprocess is usually time intensive because the algorithm
attempts to findthe optimum featur esof the tem plate for the particular
matchingprocess. The learning mode you choose also affects the speed of
the learningprocess. Learning the template for shift-invariant matching is
fasterthan learning for rotation-invariant matching. Youcan also save time
bytraining the patter n matching algorithm offline and then savingthe
templateimage with imaqWriteVisionFile().
Defining a Search AreaTwo equally important factors define the success of a pattern matching
algorithm:accuracy and s peed.You can define a search area to reduce
ambiguity in the search process. For example, if your image has multiple
instancesof ap atternand onlyone ofthem isrequired forthe inspection
task, the presence of additional instances of the pattern can produce
Patternwith Insufficient
BackgroundInformation
Patternwith Sufficient
BackgroundInformation