inspect_shape_model ( Image : ModelImages, ModelRegions : NumLevels, Contrast : )

Create the representation of a shape model.

inspect_shape_model creates a representation of a shape model. The operator is particularly useful in order to determine the parameters NumLevels and Contrast, which are used in create_shape_model, quickly and conveniently. The representation of the model is created on multiple image pyramid levels, where the number of levels is determined by NumLevels. In contrast to create_shape_model, the model is only created for the rotation of the object in the input image, i.e., 0°. As output, inspect_shape_model creates an image object ModelImages containing the images of the individual levels of the image pyramid as well as a region in ModelRegions for each pyramid level that represents the model at the respective pyramid level. The individual objects can be accessed with select_obj. As described for create_shape_model, the number of pyramid levels should be chosen as large as possible, while taking into account that the model must be recognizable on the highest pyramid level and must have enough model points. The parameter Contrast should be chosen such that only the significant features of the template object are used for the model. Contrast can also contain a tuple with two values. In this case, the model is segmented using a method similar to the hysteresis threshold method used in edges_image. Here, the first element of the tuple determines the lower threshold, while the second element determines the upper threshold. For more information about the hysteresis threshold method, see hysteresis_threshold. Optionally, Contrast can contain a third value as the last element of the tuple. This value determines a threshold for the selection of significant model components based on the size of the components, i.e., components that have fewer points than the minimum size thus specified are suppressed. This threshold for the minimum size is divided by two for each successive pyramid level. If small model components should be suppressed, but hysteresis thresholding should not be performed, nevertheless three values must be specified in Contrast. In this case, the first two values can simply be set to identical values. In its typical use, inspect_shape_model is called interactively multiple times with different parameters for NumLevels and Contrast, until a satisfactory model is obtained. After this, create_shape_model is called with the parameters thus obtained.


Parameters

Image (input_object)
image -> object : byte
Input image.

ModelImages (output_object)
image-array -> object : byte
Image pyramid of the input image

ModelRegions (output_object)
region-array -> object
Model region pyramid

NumLevels (input_control)
integer -> integer
Number of pyramid levels.
Default value: 4
List of values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Contrast (input_control)
number(-array) -> integer
Threshold or hysteresis thresholds for the contrast of the object in the image and optionally minimum size of the object parts.
Default value: 30
Suggested values: 10, 20, 30, 40, 60, 80, 100, 120, 140, 160


Result

If the parameters are valid, the operator inspect_shape_model returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.


Parallelization Information

inspect_shape_model is reentrant and processed without parallelization.


Possible Predecessors

reduce_domain


Possible Successors

select_obj


See also

create_shape_model


Module

Foundation



Copyright © 1996-2008 MVTec Software GmbH