Chapter 5
Performing Machine Vision Tasks
IMAQ Vision for Visual Basic User Manual
5-16
ni.com
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 the 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
incorrect results. To avoid this, reduce the search area so that only the
appropriate pattern lies within the search area.
The time required to locate a pattern in an image depends on both the
template size and the search area. By reducing the search area or increasing
the template size, you can reduce the required search time.
In many inspection applications, you have general information about the
location of the fiducial. Use this information to define a search area. For
example, in a typical component placement application, each printed
circuit board (PCB) being tested may not be placed in the same location
with the same orientation. The location of the PCB in various images can
move and rotate within a known range of values, as illustrated in
Figure 5-11. Figure 5-11a shows the template used to locate the PCB in the
image. Figure 5-11b shows an image containing a PCB with a fiducial you
want to locate. Notice the search area around the fiducial. If you know,
before the matching process begins, that the PCB can shift or rotate in the
image within a fixed range, as shown in Figure 5-11c and Figure 5-11d,
respectively, you can limit the search for the fiducial to a small region of
the image.