
Chapter
5
Reference Manual
IVC-2D
214
©
SICK AG • Advanced Industrial Sensors • www.sick.com • All rights reserved
Interactive Setups
Locating Shapes (tips and tricks)
The purpose of the Shape Locator tool is to find the best possible match or matches of a
reference shape. This section holds important information on how to set up the tools, and
also some examples on how to use the combine the tools to achieve the best performan-
ce.
Basic description of the algorithm
The ‘Shape Locator’ tool identifies the major edges (contours) of any shape. These edges
are used to locate the position of the reference shape in a new image. The edge extraction
is based on local gray scale gradients and the tool is therefore relatively insensitive to
absolute gray scale level and shading effects.
The localization is performed in two steps
•
Coarse pose (position, rotation, and scale) of the shape is found. This search only
considers the major edges of the shape, drawn green in the reference image. This
puts a lower limit on the size of the reference shapes and the details that can be
detected. The algorithm cannot locate shapes that cover less than 2% of the im-
age area.
•
Fine tuning the coarse pose using the fine detail of the reference shape. So even
if the green major edges look somewhat rough, the fine-tuning will ensure sub-
pixel and sub-degree precision.
Different applications have different needs in trade-off between execution time on one
hand, and positioning robustness and accuracy on the other. The tool therefore has a
number of parameters to control this balance. The two most important settings are the
Robustness vs. Speed
and
Accuracy vs. Speed
parameters. The
Robustness
trade-off
controls the first step, the coarse localization. For a clean high contrast image with a large
reference shape, the robustness trade-off can be set to high-speed. For cluttered or low
contrast images with a small reference shape, the robustness trade-off should be towards
high robustness.
The
Accuracy
trade-off controls the fine-tuning of the second step in a similar manner. For
applications where the sub-pixel accuracy requirements are high, the trade-off should be
set to high accuracy. For high speed applications, however, where precise positioning is
not needed, it can be set to high speed.
The tool may be sensitive to shape variations compared to the reference shape. Typical
causes of shape variations can be object variations or occlusion caused by lighting related
effects and/or partly covered objects. Moderate variations are handled, but affect the
score. Major variations may cause the tool to fail locating the shape.
The ‘Shape Locator’ tool can find several instances of the reference shape in one image
depending on the setting of the parameter
Max number of shapes
. The tool identifies the
shapes with the highest score and presents them in the search result.
Teach tips
The selection of edges defining the reference shape is an important key to a fast and
robust location of shapes. The reference shape edges are controlled by a combination of
the Region Of Interest (ROI) selecting a part of the reference image and the
Edge strength
parameter setting the threshold for which gray scale gradients (i.e. variations in gray scale)
that should be regarded as an edge.
More edges will increase the execution time. Adjust the
Edge strength
parameter so that
the characteristic major edges of the shape are extracted but minor details are ignored.
Also select an
Edge strength
value where the extracted edges stay more or less constant
when the
Edge strength
value is varied around the selected value. This ensures that the
same edges will be extracted even if the illumination changes.