Via the menu item Parameters ▹ Standard Model Parameters the tab Parameters is opened and you can specify basic parameters for the model, which describe the appearance of the object to recognize, e.g., the contrast of significant points or the allowed range of rotation.
By default, these parameters are set to values which work well for most tasks; by modifying them, you can optimize the model for your application and speed up the search process.
For shape-based matching the following parameters can be specified:
For correlation-based matching the following parameters can be specified:
For deformable matching the following parameters can be specified:
For descriptor-based matching the following parameters can be specified:
If you want to reset all of the model and search parameters, you can do this via the Reset Model button in the toolbar.
Note that - due to performance reasons - viewing the effect of your adaptions of the shape-based matching parameters Contrast (Low), Contrast (High) and Min. Component Size, will only immediately be possible if the model image is small and if it is not too noisy. The reason for this is that changes in those parameters lead to a new calculation of the model. For other images, the system will wait until the changes are loaded instead of blocking the graphical user interface. This enables you to finish your adaptions of the model parameters without having to wait.
In most applications, specifying the standard parameters will already suffice. Therefore, you can directly test the model now. Additionally, advanced model parameters can be specified via the menu item Parameters ▹ Advanced Model Parameters.
The two parameters Contrast (Low) and Contrast (High) for shape-based matching and Contrast for deformable matching determine which pixels in the selected ROI are included in the model; typically, the points corresponding to the contours of the object should be selected.
When you select a value, either by using the sliders or by entering a value in the text fields next to them, the included pixels are marked in the displayed image. In order to obtain a suitable model we recommend choosing the contrast in such a way that the significant pixels of the object are included, i.e., those pixels that characterize it and allow you to discriminate it clearly from other objects or from the background. Please assure that no clutter is included, i.e., pixels that do not belong to the object!
You can use the parameters Contrast (Low) and Contrast (High) in two ways:
Set both parameters to the same value. Then, all pixels with a contrast higher than this value are included in the model.
You can modify both parameters at the same time as follows: To increase the value, use the slider of Contrast (Low); then, the value Contrast (High) will follow automatically. Vice versa, to decrease the value use the slider of Contrast (High).
If there is no single contrast value that selects all significant object pixels without including clutter, try using different values for Contrast (Low) and Contrast (High). Then, pixels are selected in two steps: First pixels that have a contrast higher than Contrast (High) are selected; then, pixels that have a contrast higher than Contrast (Low) and that are connected to a high-contrast pixel, either directly or via another pixel with contrast above the lower threshold, are added.
We recommend that you proceed as follows: Increase both values (using the slider of Contrast (Low)), until no clutter pixels are selected anymore. Then, decrease Contrast (Low) to add more object pixels. If significant object parts remain unselected, decrease Contrast (High).
Note that these parameters are used only to select model points in the model image. In the test images, the object may have a lower contrast.
You can also let the Matching Assistant select suitable values automatically based on the model image.
An additional method for removing clutter for shape-based matching is to specify a minimum size for the model components. If you cannot find suitable parameter values that exclude the clutter, we recommend creating a new model ROI via the menu ROI.
When you click the button Auto Select that is placed right beside the sliders for the parameters Contrast (Low/High) and Contrast, the Matching Assistant selects suitable values for the contrast by trying to obtain many long and straight contour segments.
Note that you may need to set the value manually if certain model components should be included or suppressed because of application-specific reasons or if the object contains several different contrasts.
Via the combo box Model Type you can select two model types,
depending on the expectations concerning the deformation of the object.
The parameter Min. Component Size specifies the minimum size, i.e., number of pixels, which contour parts must have to be included in the model. This parameter is useful to exclude clutter.
You can also let the Matching Assistant select a suitable value automatically based on the model image.
Note that the selected value is divided by two for each successive pyramid level.
When you click the button Auto Select that is placed right beside the slider for the parameter Min. Component Size the Matching Assistant selects a suitable value for the minimum component size based on the model image.
To speed up the matching process, a so-called image pyramid is created, both for the model image and for the search images. The pyramid consists of the original, full-sized image and a set of downsampled images. For example, if the original image (first pyramid level) has the size 600x400, the second level image has the size 300x200, the third level 150x100, and so on. The object is then searched for first on the highest pyramid level, i.e., in the smallest image. The results of this fast search are then used to limit the search in the next pyramid image, whose results are used on the next lower level until the lowest level is reached. Using this iterative method the search is both fast and accurate.
You can inspect the model image pyramid together with the corresponding models via the menu item File ▹ Display Image Pyramid, which opens the corresponding dialog of the tab Creation. We recommend choosing the highest pyramid level at which the model contains at least ten pixels (and still resembles the original shape). You can enter the value directly in the text field or by using the slider next to it. Alternatively, you can let the Matching Assistant select a suitable value automatically.
Note that the Matching Assistant can check whether the model contains enough points on the selected number of pyramid levels only when actually creating the model. In case the model does not contain enough model points a corresponding error dialog appears.
When you click the button Auto Select that is placed right beside the slider for the parameter Pyramid Levels the Matching Assistant selects a suitable number of pyramid levels automatically, thus relieving you of the task of examining the model image pyramid.
Please note that in rare cases the automatic selection will yield a too low value and thereby slow down the search process, or a too high value, resulting in failures to recognize the object. In such a case we recommend that you inspect the model image pyramid and select a suitable value manually.
With the parameter Starting Angle you can specify the starting angle of the allowed range of rotation (unit:°). With another parameter you can specify the extent of the allowed range. Note that the range of rotation is defined relative to the model image, i.e., a starting angle of 0° corresponds to the orientation the object has in the model image. Therefore, to allow rotations up to +/-5°, e.g., you should set the starting angle to -5° and the angle extent to 10°.
With the parameter Angle Extent you can specify how much the object is allowed to rotate (unit:°). With another parameter you can specify the starting angle of this allowed range. Note that the range of rotation is defined relative to the model image, i.e., a starting angle of 0° corresponds to the orientation the object has in the model image. Therefore, to allow rotations up to +/-5°, e.g., you should set the starting angle to -5° and the angle extent to 10°.
We recommend limiting the allowed range of rotation as much as possible in order to speed up the search process and to minimize the required memory. If the loaded test images show the object in its extreme orientations, you can let the Matching Assistant determine the range of rotation, i.e., the Pose Bounds, by pressing the Run button of the tab Inspect and viewing the result in the Statistics output of the same tab.
Furthermore, you must limit the allowed range if the object is (almost) symmetrical. Otherwise the search process will find multiple, almost equally good matches on the same object at different angles; which match (at which angle) is returned as the best can therefore “jump” from image to image. The suitable range of rotation depends on the symmetry: For a cross-shaped or square object the allowed extent must be less than 90°, for a rectangular object less than 180°, and for a circular object 0°.
Note that if you use shape-based matching and have chosen a very large angle and scale range you may find it useful to switch off the complete pregeneration of the model if it has been switched on before (default = switched off).
The allowed range of scale is defined separately in row and column direction. Thus, it is described by the parameters:
In the model image, the scales all have the value 1.0.
Note that if you use shape-based matching and have chosen a very large angle extent and scale range you may find it useful to switch off the complete pregeneration of the model.
Depending on the specified parameters, the most efficient matching method is used. This method determines how the shape model is created in the generated code.
This method is used if all four scale factors are equal to 1.0.
This method is used if all four scale factors are equal (but not 1.0) or if the scale parameters are locked.
This method is used if none of the above applies.
The interest points that build the model are extracted from the image by the so-called detector. The type of detector is selected via the parameter Detector Type. Available types are:
lepetit can be used for a very fast extraction of significant points, but the obtained points are not as robust as those obtained with harris. Especially, if a template or search image is very dark or has got a low contrast, lepetit is not recommendend. harris_binomial is a good compromise between lepetit and harris, because it is faster than harris and more robust than lepetit.
Depending on the detector type that is chosen, different values can be specified.
For the Detector Type lepetit, the following value can be specified:
For the Detector Type harris, the following values can be specified:
For the Detector Type harris_binominal, the following values can be specified:
For more information and recommended values, please refer to the reference documentation of the operator create_uncalib_descriptor_model.
In most cases, Min. Score should be set to a value of at least 0.1. To speed up the search, it should be chosen as large as possible, but of course still as small as necessary for the success of the search, as, e.g., a value of 1.0 is rather unlikely to be reached by a matching. Thus, the number of points for further calculations is reduced, so that the speed of the matching can be enhanced. But note that this speed-up is obtained at the cost of a reduced robustness, especially if the number of extracted points is low.
Fern Depth specifies the depth of the classification fern. Interest points can be better discriminated when selecting a higher depth. On the other hand, a higher depth leads to an increasing runtime.
Fern Number specifies the number of used fern structures. Using many fern structures leads to a better robustness but also to an increasing runtime.
The selection of values for the depth and the number of ferns depends on your specific requirements. If a fast online matching is required, few ferns with a large depth are recommendend. Note that with these parameter settings more memory is required. If a very robust matching result is needed and neither memory consumption nor runtime are critical, many ferns and a large depth are recommended. Note that this might significantly increase the runtime of the matching. If the memory consumption is critical but runtime is not, many ferns with a small depth are recommended.
Min. Angle and Max. Angle define the range for the angle of rotation around the normal vector of the model. The restriction to small ranges for the angle can be used to speed up the training significantly. But note that during the later applied matching the model can be found only if its angle and scale is within the trained scope.
Min. Scale and Max. Scale define the scale range of the model. The restriction to small ranges for the scale can be used to speed up the training significantly. But note that during the later applied matching the model can be found only if its angle and scale is within the trained scope.