The Matching Assistant of HDevelop is a front-end to HALCON's powerful
matching methods:
- shape-based matching,
- correlation-based matching,
- descriptor-based matching, and
- deformable matching.
For basic information on these matching methods and how to
choose a suitable method for your application, please refer to
the section Select a Matching Method or
for more detailed information refer to the Solution Guide on Matching.
These matching methods that are available within the Matching Assistant
let you locate objects with subpixel accuracy at a high speed,
even when they appear rotated, partly occluded,
or under changing illumination. Using the Matching Assistant you can
All you need is a single model image and a set of test images. The Matching Assistant
further assists you by automatically calculating suitable parameter values
based on your selections.
How to use the Matching Assistant is described here.
A reference to the elements of the Matching Assistant can be found here.
In this online help, the following special terms are used:
- Matching
- Matching is the process of locating an object described by
a model in an image. The results of the matching
process are the position and orientation of the object and the
matching score.
- Shape-Based Matching
The shape-based matching describes the model by the
shapes of contours instead of using the gray values of pixels and
their neighborhood as template. In particular, shape-based matching should be chosen
if occlusions or clutter can not be avoided or if a matching of
objects with changing color is applied.
- Deformable Matching
Like shape-based matching, the local deformable matching extracts contours
and matches their shapes against the shapes of previously created models.
But in contrast to shape-based matching, even slightly deformed objects are
found and the deformations are returned as an additional result. This matching
approach also allows you to rectify the image part containing the deformed object.
Therefore, only the objects position is determined, whereas
the orientation and scale are interpreted as part of the deformation.
- Correlation-Based Matching
The correlation-based matching approach is based on gray values.
It uses a normalized cross correlation to evaluate the correspondence
between a model and a test image. It can compensate both additive as
well as multiplicative variations in illumination. In contrast to the
shape-based matching, also objects with slightly changing shapes,
lots of texture, or objects in blurred images (contours vanish in blurred
images, e.g., because of defocus) can be found.
- Descriptor-Based Matching
In contrast to the perspective deformable matching,
the template is not built by the shapes of contours
but by a set of so-called interest points. These points are first
extracted and then classified according to their location and their local
gray-value neighborhood.
Similar to the perspective deformable matching, the descriptor-based matching
is able to find objects even if they are perspectively deformed.
Descriptor-based matching can be applied for images from a calibrated camera as well
as from an uncalibrated camera. This matching method provides a
calibrated version with which also a 3D pose instead of 2D transformation
parameters can be derived.
- Alignment
- This method can be applied to
transform the position of the matched object corresponding to the reference image.
Alignment is useful if the following image processing
step is not invariant against rotation or translation, like OCR or the variation model.
Note that by alignment the matched object is only rotated and translated. To remove perspective or lens distortions,
e.g., if the camera observes the scene under an inclined angle, you must rectify
the image first. The matching assistant allows you to generate code for an affine transformation
which can subsequently be used for alignment with the Measure Assistant.
Alignment is useful for all further processes that rely on fixed ROIs,
like measuring and OCR.
- Model
- In order to locate an object, you must provide the Matching Assistant with an
example image of the object.
From this, the Matching Assistant then creates the so-called
model, an internal representation of the object containing only the
information characterizing the object. This representation is then used when
searching for the object in the test images. You can also provide the Matching Assistant with a
model in DXF format (or in the HALCON formats SHM, NCM, DSM or DFM).
- Model Image
- This is the image containing your example of the object to be searched
for. This image should be a characteristic image of the object, i.e.,
the object should appear in its default position and orientation and not be
occluded; furthermore, the image should not contain clutter. You can load
this image via the menu item File ▹
Load Model Image.
- Reference Image
- If a reference image is selected, the position of the match in this image
is used as reference. This is necessary to perform alignment.
If no reference image is chosen, the model image will be
used as basis for alignment.
- Model Region of Interest (ROI)
- This is the region in the model image which contains the object to
be trained. You can select this region via the menu item
ROI.
- Rectification
- This method can be applied to the search image to transform it such that
the found model and the model in the reference image appear as similar as possible.
Rectfying an image is useful for all further processes that rely on fixed ROIs,
like measuring and OCR.
- Test Image
- You can test the performance of the matching process by providing test images
via the menu item Usage ▹
Test Images ▹
Load Test Images.
These images should be representative images from your matching
application, i.e., the object should appear in all allowed variations
of its position, orientation, occlusion, and illumination.
- Score
- When comparing a detected match in a test image with the model, the Matching Assistant
calculates a measure of similarity, the so-called score, which ranges
between 0 (no similarity) and 1 (perfect similarity).