Skip to content

inspect_shape_modelInspectShapeModelInspectShapeModelinspect_shape_modelinspect_shape_model🔗

Short description🔗

inspect_shape_modelInspectShapeModelInspectShapeModelinspect_shape_modelinspect_shape_model — Create the representation of a shape model.

Signature🔗

inspect_shape_model( image Image, out image ModelImages, out region ModelRegions, integer NumLevels, number Contrast )void InspectShapeModel( const HObject& Image, HObject* ModelImages, HObject* ModelRegions, const HTuple& NumLevels, const HTuple& Contrast )static void HOperatorSet.InspectShapeModel( HObject image, out HObject modelImages, out HObject modelRegions, HTuple numLevels, HTuple contrast )def inspect_shape_model( image: HObject, num_levels: int, contrast: MaybeSequence[int] ) -> Tuple[HObject, HObject]

Herror inspect_shape_model( const Hobject Image, Hobject* ModelImages, Hobject* ModelRegions, const Hlong NumLevels, const Hlong Contrast )

Herror T_inspect_shape_model( const Hobject Image, Hobject* ModelImages, Hobject* ModelRegions, const Htuple NumLevels, const Htuple Contrast )

HImage HImage::InspectShapeModel( HRegion* ModelRegions, Hlong NumLevels, const HTuple& Contrast ) const

HImage HImage::InspectShapeModel( HRegion* ModelRegions, Hlong NumLevels, Hlong Contrast ) const

HImage HImage.InspectShapeModel( out HRegion modelRegions, int numLevels, HTuple contrast )

HImage HImage.InspectShapeModel( out HRegion modelRegions, int numLevels, int contrast )

Description🔗

inspect_shape_modelInspectShapeModel creates a representation of a shape model. The operator is particularly useful in order to determine the parameters NumLevelsnumLevelsnum_levels and Contrastcontrastcontrast, which are used in create_shape_modelCreateShapeModel, create_scaled_shape_modelCreateScaledShapeModel, or create_aniso_shape_modelCreateAnisoShapeModel, quickly and conveniently. The representation of the model is created on multiple image pyramid levels, where the number of levels is determined by NumLevelsnumLevelsnum_levels. In contrast to create_shape_modelCreateShapeModel, create_scaled_shape_modelCreateScaledShapeModel, and create_aniso_shape_modelCreateAnisoShapeModel, the model is only created for the rotation and scale of the object in the input image, i.e., 0° and 1. As output, inspect_shape_modelInspectShapeModel creates an image object ModelImagesmodelImagesmodel_images containing the images of the individual levels of the image pyramid as well as a region in ModelRegionsmodelRegionsmodel_regions for each pyramid level that represents the model at the respective pyramid level. The individual objects can be accessed with select_objSelectObj. If the input image Imageimageimage has one channel the representation of the model is created with the method that is used in create_shape_modelCreateShapeModel, create_scaled_shape_modelCreateScaledShapeModel or create_aniso_shape_modelCreateAnisoShapeModel for the metrics 'use_polarity'"use_polarity", 'ignore_global_polarity'"ignore_global_polarity", and 'ignore_local_polarity'"ignore_local_polarity". If the input image has more than one channel the representation is created with the method that is used for the metric 'ignore_color_polarity'"ignore_color_polarity". As described for create_shape_modelCreateShapeModel, create_scaled_shape_modelCreateScaledShapeModel, and create_aniso_shape_modelCreateAnisoShapeModel, 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 Contrastcontrastcontrast should be chosen such that only the significant features of the template object are used for the model. Contrastcontrastcontrast 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_imageEdgesImage. 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_thresholdHysteresisThreshold. Optionally, Contrastcontrastcontrast 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. As the minimum size is applied on the extent of the components, the derived model contours can still be smaller than the specified minimum size. 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 Contrastcontrastcontrast. In this case, the first two values can simply be set to identical values. In its typical use, inspect_shape_modelInspectShapeModel is called interactively multiple times with different parameters for NumLevelsnumLevelsnum_levels and Contrastcontrastcontrast, until a satisfactory model is obtained. After this, create_shape_modelCreateShapeModel, create_scaled_shape_modelCreateScaledShapeModel, or create_aniso_shape_modelCreateAnisoShapeModel are called with the parameters thus obtained.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)

Input image.

ModelImagesmodelImagesmodel_images (output_object) (multichannel-)image-array → object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject * (byte / uint2)

Image pyramid of the input image

ModelRegionsmodelRegionsmodel_regions (output_object) region-array → objectHObjectHRegionHObjectHobject *

Model region pyramid

NumLevelsnumLevelsnum_levels (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of pyramid levels.

Default: 44
List of values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 101, 2, 3, 4, 5, 6, 7, 8, 9, 10

Contrastcontrastcontrast (input_control) number(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Threshold or hysteresis thresholds for the contrast of the object in the image and optionally minimum size of the object parts.

Default: 3030
Suggested values: 10, 20, 30, 40, 60, 80, 100, 120, 140, 16010, 20, 30, 40, 60, 80, 100, 120, 140, 160

Result🔗

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

Combinations with other operators🔗

Combinations

Possible predecessors

reduce_domainReduceDomain

Possible successors

select_objSelectObj

See also

set_generic_shape_model_paramSetGenericShapeModelParam

Module🔗

Foundation