VI User Manual - 第252页
Tools library 7 - 90 Vision 2007 4.10 User Manual Re v 01 The Search tool also uses 3 accura cy levels: coarse, fine, very fine. 7.15.1.4 Algorithms and performance Choosing an a lgorithm an d an accuracy leve l can grea…

Tools library
Vision 2007 4.10 User Manual Rev 01 7 - 89
7.15 Search
7.15.1 Search tool definition
The Search tool detects and locates previously trained patterns in the image. It identifies
groups of pixels of the search area that are similar to the trained model, using normalized cor-
relation.
7.15.1.1 Applications
The Search tool is mainly used to find pin tips for backplane or connector inspection.
7.15.1.2 Results
It returns presence, X, Y and Theta position of the best matching shape.
7.15.1.3 Search tool features
The Search tool can use 4 distinct algorithms to find instances of the model.
CNL normalized
When you perform a search using CNL normalized linear mode, it returns the loca-
tion of the part of the search image with pixel values that are the most closely corre-
lated to the pixel values in the model image. This type of searching is called intensity
correlation searching because the degree of similarity between the search image
and the model image is determined by calculating the correlation coefficient be-
tween the patterns of gray-scale pixel values in the two images. The method used
to compute the correlation coefficient between the two images is not affected by lin-
ear changes in brightness between the images.
CNL non linear
When you perform a search using CNL Search in nonlinear mode, it returns the lo-
cation of the part of the search region with the pattern of edges that most closely re-
sembles the pattern of edges in the model image. Because CNLSearch’s nonlinear
mode searches for patterns of edges instead of patterns of pixel values, CNLSearch
is immune to both linear and nonlinear brightness changes between the model im-
age and the search image, as long as the brightnesschanges do not affect the pat-
tern of edges in the search image.
When using non linear detection, you can specify the parameters of the edge detec-
tion (upper and lower thresholds). The edge thresholds set the edge strength (the
difference in pixel values across the edge) that CNL non linear uses to identify an
edge. All edges with strengths above the high threshold are included in the edge
map that will be compared to the runtime image. All edges with strengths below the
low threshold are excluded from the edge map. Edges with strengths between the
thresholds are included in the edge map if they are connected to another edge from
the edge map, either directly or through other edges with strengths between the
thresholds.
Normalized search
This algorithm is similar to CNL normalized but uses a more aggressive approach to
locating likely matches. Because of this, it may tend to discard some unpromising
locations prematurely.
Absolute search
This algorithm is similar to Normalized search, but the scoring function is based on
the correlation coefficient. It ignores the gray levels, considers only absolute con-
trast, and so accepts perfect mismatches as well as perfect matches.

Tools library
7 - 90 Vision 2007 4.10 User Manual Rev 01
The Search tool also uses 3 accuracy levels: coarse, fine, very fine.
7.15.1.4 Algorithms and performance
Choosing an algorithm and an accuracy level can greatly affect the tool’s processing
time. The following tables indicate the relative speed difference for using the differ-
ent search methods.
Relative search times, score greater than confusion threshold
Relative search times, score less than confusion threshold
7.15.2 Using the Search tool
There are 2 steps to use the Search tool. First you need to train a model, then you can find
instances of that model.
Training the Search tool, you have to select the algorithm(s) and the accuracy level(s) that
you will be able to use at run time.
Running the tool you can choose one of the trained algorithms and select the accuracy level.
The decision parameters are the acceptable score, the confusion threshold, and the accept-
able contrast.
The Search tool uses the confusion threshold and score that you supply to ensure that the
correct instance of the model within the search image is located as quickly as possible. The
confusion threshold is the more important to obtaining good results.
The tool uses both the score and the confusion threshold when considering whether or not
a match represents a valid instance of the model. The confusion threshold is the score above
which any match is guaranteed to be an instance of the model; all matches with scores great-
er than or equal to the confusion threshold are considered to be valid. The acceptable score
is the lower score limit of all valid matches. But other matches, which might not be actual in-
stances of the model, can receive scores above this acceptable score.
The tool uses the confusion threshold to speed the search process. If you are searching for
a single instance of the model in an image, as soon as the Search tool finds an instance with
a score above the confusion threshold, it stops searching and returns the location of the
match. If Search does not find a match with a score above the confusion threshold, it locates
all the matches with scores above the acceptable score and returns the location of the match
with the highest score.
Algorithm/Accuracy level
Coarse Fine Very fine
Cnl normalized
± 2 pixels ± 1 pixel ± 0.25 pixel
Cnl Nonlinear ± 2 pixels ± 1 pixel ± 0.5 pixel
Normalized Search ± 2 pixels ± 1 pixel ± 0.25 pixel
Absolute Search ± 2 pixels ± 1 pixel ± 0.25 pixel
Algorithm/Accuracy
Coarse Fine Very fine
Cnl normalized
100 % 110 % 120 %
Cnl Nonlinear 100 % 150 % 200 %
Normalized Search 100 % 110 % 120 %
Absolute Search 100 % 110 % 120 %
Algorithm/Accuracy
Coarse Fine Very fine
Cnl normalized
100 % 150 % 200 %
Cnl Nonlinear 100 % 200 % 300 %
Normalized Search 100 % 150 % 200 %
Absolute Search 100 % 150 % 200 %
Search

Tools library
Vision 2007 4.10 User Manual Rev 01 7 - 91
You should set the confusion threshold high enough to ensure that confusing features in a
search image do not receive scores above the acceptable score.
The contrast threshold is the ratio of the pixel values dispersion from the trained image to the
real image. It is relative to the trained image.
7.15.3 Model description tab
1. On the Model description tab, in the Edit a model window, choose the processing:
Search. A new tab appears (with the tool name) behind the Model description tab.
2. Click Auto area to place the model encompassing area exactly on the image.
7.15.4 Search tab
1.
Use
Realign this processing
(
A
) section if you want to realign
the position of the tool with another
one (not available for window 1).
2. In Position & Size search
window (mm)
(B) section, enter
the size and position of the
search window (zone in which
the feature will be searched for).
3. In Light level (C) section, se-
lect the light level you want to
use.
4. In Parameters (D) section, en-
ter the Search tool parameters
(see below
7.15.4.1 Search pa-
rameters
).
5. Click Test (E) button to test the
Search tool and display the re-
sults (see below
7.15.4.2 Search
test
).
7.15.4.1 Search parameters
Configuration tab
Click Configuration tab
to access the main run
time parameters.
1. In Fonctional param-
eters
section:
Select the
Algorithm
(A) that will be used,
among the trained algo-
rithms.
Select the
Accuracy (B)
level from the trained accuracy levels.
If you need a special
equation to realign, you
can do so using the
Equations button.
A
B
D
C
E
A
B
C
D
Search