set_generic_shape_model_paramT_set_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param (Operator)

Name

set_generic_shape_model_paramT_set_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param — Set selected parameters of the shape model.

Signature

set_generic_shape_model_param( : : ModelID, GenParamName, GenParamValue : )

Herror T_set_generic_shape_model_param(const Htuple ModelID, const Htuple GenParamName, const Htuple GenParamValue)

void SetGenericShapeModelParam(const HTuple& ModelID, const HTuple& GenParamName, const HTuple& GenParamValue)

void HShapeModel::SetGenericShapeModelParam(const HTuple& GenParamName, const HTuple& GenParamValue) const

static void HOperatorSet.SetGenericShapeModelParam(HTuple modelID, HTuple genParamName, HTuple genParamValue)

void HShapeModel.SetGenericShapeModelParam(HTuple genParamName, HTuple genParamValue)

def set_generic_shape_model_param(model_id: HHandle, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]]) -> None

Description

The operator set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param sets the parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name of the shape model ModelIDModelIDModelIDModelIDmodelIDmodel_id to the values given in GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.

Various aspects of the matching process can be controlled by the parameters that can be selected by GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name. In the descriptions below they are grouped into the following categories (where the category represents the main purpose but not necessarily the only purpose of the parameter listed within):

Modifying the Model
Finding Model Instances

  1. Modify the Instance

  2. Sort out Found Matches

  3. Gray Value Treatment

  4. Refinement

  5. Image Pyramid

  6. Clutter

  7. Regarding the Output

Computational Resources during a Search

In the following we list the settable parameters for the different categories and specify cases in which parameter values are modified automatically.

Modifying the Model

In this paragraph we list and explain parameters modifying the model ModelIDModelIDModelIDModelIDmodelIDmodel_id itself. Changing a corresponding value makes it necessary to train the adjusted model before the matching (see train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model). The supported parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name are:

Contrast

The contrast is a measure for local gray value differences that are used to distinguish the object from the background or different parts of the object from each other. For the model only those pixels are selected which show the asked contrast, i.e., gray value difference to neighboring pixels. This asked contrast can be a simple threshold or a hysteresis threshold, depending on the values set for 'contrast_low'"contrast_low""contrast_low""contrast_low""contrast_low""contrast_low" and 'contrast_high'"contrast_high""contrast_high""contrast_high""contrast_high""contrast_high":

Note, such a contrast is not used in case of training with XLD. For more information about contrast and its impact on shape model matching, we refer to the “Solution Guide II-B - Matching”.

In certain cases, it might happen that the automatic determination of the contrast thresholds is not sufficient. For example, a manual setting of these parameters should be preferred if certain model components should be included or suppressed due to application-specific reasons or if the object features several different contrasts. The contrast thresholds should be verified using inspect_shape_modelinspect_shape_modelInspectShapeModelInspectShapeModelInspectShapeModelinspect_shape_model before calling train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model.

Rotation

Shape models are created with a rotation range starting at 0 and ending at 6.28 (= ), which can be restricted during the search. The search space, thus discretization steps for the angles can be modified using:

Scaling

The search space, thus discretization steps for the scaling can be modified using scaling parameters. Which ones can be set depends on the type of scaling, see the overview in the following table. A scaling value of 1.0 corresponds to the original size of the model in the according direction.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name isotropic scaling anisotropic scaling
'iso_scale_max'"iso_scale_max""iso_scale_max""iso_scale_max""iso_scale_max""iso_scale_max" x
'iso_scale_min'"iso_scale_min""iso_scale_min""iso_scale_min""iso_scale_min""iso_scale_min" x
'iso_scale_step'"iso_scale_step""iso_scale_step""iso_scale_step""iso_scale_step""iso_scale_step" x
'scale_row_max'"scale_row_max""scale_row_max""scale_row_max""scale_row_max""scale_row_max" x
'scale_row_min'"scale_row_min""scale_row_min""scale_row_min""scale_row_min""scale_row_min" x
'scale_row_step'"scale_row_step""scale_row_step""scale_row_step""scale_row_step""scale_row_step" x
'scale_column_max'"scale_column_max""scale_column_max""scale_column_max""scale_column_max""scale_column_max" x
'scale_column_min'"scale_column_min""scale_column_min""scale_column_min""scale_column_min""scale_column_min" x
'scale_column_step'"scale_column_step""scale_column_step""scale_column_step""scale_column_step""scale_column_step" x
Metric

Size

Image Pyramid

Naming

Finding Model Instances

In this paragraph we list parameters modifying the search of a ModelIDModelIDModelIDModelIDmodelIDmodel_id. Modifying these parameters do not necessitate a model training, except they are set from a not-estimated value to a value leading to an automatic estimation during train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model. The descriptions of these parameters contain a corresponding note. The supported parameters GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name are:

  1. Modify the Instance

    Rotation

    • 'angle_start'"angle_start""angle_start""angle_start""angle_start""angle_start":

      Determines the start of the range of possible rotations for which the model is searched.

      Suggested values: 0.0, -3.14, 3.14.

      Default: 0.0.

    • 'angle_end'"angle_end""angle_end""angle_end""angle_end""angle_end" Determines the end of the range of possible rotations for which the model is searched.

      Suggested values: 0.0, 3.14, 6.28.

      Default: 6.28 (= ).

    Example: 'angle_start'"angle_start""angle_start""angle_start""angle_start""angle_start" = '-rad(10)'"-rad(10)""-rad(10)""-rad(10)""-rad(10)""-rad(10)", 'angle_end'"angle_end""angle_end""angle_end""angle_end""angle_end" = 'rad(10)'"rad(10)""rad(10)""rad(10)""rad(10)""rad(10)" searches for matches in the range from [rad(350), rad(360)] to [0, rad(10)].

    Scaling

    The scaling range specified for the model can be restricted further. For these parameters the value 'auto'"auto""auto""auto""auto""auto" means that they do not restrict the according range.

    GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name isotropic scaling anisotropic scaling
    'restrict_iso_scale_max'"restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max" x
    'restrict_iso_scale_min'"restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min" x
    'restrict_scale_row_max'"restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max" x
    'restrict_scale_row_min'"restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min" x
    'restrict_scale_column_max'"restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max" x
    'restrict_scale_column_min'"restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min" x
    • 'restrict_iso_scale_max'"restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max":

      Determines a possibly restricted maximum of the range of possible scaling for which the model is searched.

      Suggested values: 'auto'"auto""auto""auto""auto""auto", 1.1, 1.2.

      Default: 'auto'"auto""auto""auto""auto""auto".

    • 'restrict_iso_scale_min'"restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min":

      Determines a possibly restricted minimum of the range of possible scaling for which the model is searched.

      Suggested values: 'auto'"auto""auto""auto""auto""auto", 0.9, 0.8.

      Default: 'auto'"auto""auto""auto""auto""auto".

    • 'restrict_scale_row_max'"restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max":

      Determines a possibly restricted maximum of the range of possible scaling in row direction for which the model is searched.

      Suggested values: 'auto'"auto""auto""auto""auto""auto", 1.1, 1.2.

      Default: 'auto'"auto""auto""auto""auto""auto".

    • 'restrict_scale_row_min'"restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min":

      Determines a possibly restricted minimum of the range of possible scaling in row direction for which the model is searched.

      Suggested values: 'auto'"auto""auto""auto""auto""auto", 0.9, 0.8.

      Default: 'auto'"auto""auto""auto""auto""auto".

    • 'restrict_scale_column_max'"restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max":

      Determines a possibly restricted maximum of the range of possible scaling in column direction for which the model is searched.

      Suggested values: 'auto'"auto""auto""auto""auto""auto", 1.1, 1.2.

      Default: 'auto'"auto""auto""auto""auto""auto".

    • 'restrict_scale_column_min'"restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min":

      Determines a possibly restricted minimum of the range of possible scaling in column direction for which the model is searched.

      Suggested values: 'auto'"auto""auto""auto""auto""auto", 0.9, 0.8.

      Default: 'auto'"auto""auto""auto""auto""auto".

    Deformation

    • 'max_deformation'"max_deformation""max_deformation""max_deformation""max_deformation""max_deformation":

      Determines by how much an object is allowed to deviate from the model in order to be considered as a match. The maximal allowable object deformation is specified in pixels. A value of 0 means no deformation is allowed during the search.

      Example: An object with a shape deformed by up to 2 pixels with respect to the shape of the model can be found with 'max_deformation'"max_deformation""max_deformation""max_deformation""max_deformation""max_deformation" = 2.

      Increasing the value for 'max_deformation'"max_deformation""max_deformation""max_deformation""max_deformation""max_deformation" often results in an increased runtime.

      Furthermore, increasing the value for 'max_deformation'"max_deformation""max_deformation""max_deformation""max_deformation""max_deformation" increases the risk of obtaining unwanted matches. This is especially the case for small objects or objects with fine structures because they lose their characteristic shape, which is important for a robust search.

      Interplay with 'subpixel'"subpixel""subpixel""subpixel""subpixel""subpixel": When deformation is allowed (thus, a value larger 0 is set), the score computation depends on the possible subpixel refinement. In most cases the score changes if a least-squares adjustment is set. Using an adjustment the score might increase when increasing the maximum deformation because then for the model points more corresponding image points can be found.

      Default: 0.

  2. Sort out Found Matches

  3. Gray Value Treatment

  4. Refinement

  5. Image Pyramid

  6. Clutter

  7. Regarding the Output

Computational Resources during a Search

In this paragraph we list parameters concerning technical influences when searching the model ModelIDModelIDModelIDModelIDmodelIDmodel_id. Supported GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name are:

Automatic modifications

The following parameters are subject to automatic modifications without further notice:

Note that the transformations are treated internally such that the scalings are applied first, followed by the rotation. Therefore, the model should usually be aligned such that it appears horizontally or vertically in the model image.

Execution Information

This operator modifies the state of the following input parameter:

During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.

Parameters

ModelIDModelIDModelIDModelIDmodelIDmodel_id (input_control, state is modified)  shape_model HShapeModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the shape model.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Parameter name.

Default value: 'min_score' "min_score" "min_score" "min_score" "min_score" "min_score"

List of values: 'angle_end'"angle_end""angle_end""angle_end""angle_end""angle_end", 'angle_start'"angle_start""angle_start""angle_start""angle_start""angle_start", 'angle_step'"angle_step""angle_step""angle_step""angle_step""angle_step", 'border_shape_models'"border_shape_models""border_shape_models""border_shape_models""border_shape_models""border_shape_models", 'clutter_border_mode'"clutter_border_mode""clutter_border_mode""clutter_border_mode""clutter_border_mode""clutter_border_mode", 'clutter_contrast'"clutter_contrast""clutter_contrast""clutter_contrast""clutter_contrast""clutter_contrast", 'clutter_hom_mat_2d'"clutter_hom_mat_2d""clutter_hom_mat_2d""clutter_hom_mat_2d""clutter_hom_mat_2d""clutter_hom_mat_2d", 'contrast_high'"contrast_high""contrast_high""contrast_high""contrast_high""contrast_high", 'contrast_low'"contrast_low""contrast_low""contrast_low""contrast_low""contrast_low", 'greediness'"greediness""greediness""greediness""greediness""greediness", 'iso_scale_max'"iso_scale_max""iso_scale_max""iso_scale_max""iso_scale_max""iso_scale_max", 'iso_scale_min'"iso_scale_min""iso_scale_min""iso_scale_min""iso_scale_min""iso_scale_min", 'iso_scale_step'"iso_scale_step""iso_scale_step""iso_scale_step""iso_scale_step""iso_scale_step", 'max_clutter'"max_clutter""max_clutter""max_clutter""max_clutter""max_clutter", 'max_deformation'"max_deformation""max_deformation""max_deformation""max_deformation""max_deformation", 'max_overlap'"max_overlap""max_overlap""max_overlap""max_overlap""max_overlap", 'metric'"metric""metric""metric""metric""metric", 'min_contrast'"min_contrast""min_contrast""min_contrast""min_contrast""min_contrast", 'min_score'"min_score""min_score""min_score""min_score""min_score", 'min_size'"min_size""min_size""min_size""min_size""min_size", 'model_cache'"model_cache""model_cache""model_cache""model_cache""model_cache", 'model_identifier'"model_identifier""model_identifier""model_identifier""model_identifier""model_identifier", 'num_levels'"num_levels""num_levels""num_levels""num_levels""num_levels", 'num_matches'"num_matches""num_matches""num_matches""num_matches""num_matches", 'optimization'"optimization""optimization""optimization""optimization""optimization", 'origin_column'"origin_column""origin_column""origin_column""origin_column""origin_column", 'origin_row'"origin_row""origin_row""origin_row""origin_row""origin_row", 'prepare_clutter_region_for_visualization'"prepare_clutter_region_for_visualization""prepare_clutter_region_for_visualization""prepare_clutter_region_for_visualization""prepare_clutter_region_for_visualization""prepare_clutter_region_for_visualization", 'prepare_contours_for_visualization'"prepare_contours_for_visualization""prepare_contours_for_visualization""prepare_contours_for_visualization""prepare_contours_for_visualization""prepare_contours_for_visualization", 'pyramid_level_highest'"pyramid_level_highest""pyramid_level_highest""pyramid_level_highest""pyramid_level_highest""pyramid_level_highest", 'pyramid_level_lowest'"pyramid_level_lowest""pyramid_level_lowest""pyramid_level_lowest""pyramid_level_lowest""pyramid_level_lowest", 'pyramid_level_robust_tracking'"pyramid_level_robust_tracking""pyramid_level_robust_tracking""pyramid_level_robust_tracking""pyramid_level_robust_tracking""pyramid_level_robust_tracking", 'restrict_iso_scale_max'"restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max""restrict_iso_scale_max", 'restrict_iso_scale_min'"restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min""restrict_iso_scale_min", 'restrict_scale_column_max'"restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max""restrict_scale_column_max", 'restrict_scale_column_min'"restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min""restrict_scale_column_min", 'restrict_scale_row_max'"restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max""restrict_scale_row_max", 'restrict_scale_row_min'"restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min""restrict_scale_row_min", 'scale_column_max'"scale_column_max""scale_column_max""scale_column_max""scale_column_max""scale_column_max", 'scale_column_min'"scale_column_min""scale_column_min""scale_column_min""scale_column_min""scale_column_min", 'scale_column_step'"scale_column_step""scale_column_step""scale_column_step""scale_column_step""scale_column_step", 'scale_row_max'"scale_row_max""scale_row_max""scale_row_max""scale_row_max""scale_row_max", 'scale_row_min'"scale_row_min""scale_row_min""scale_row_min""scale_row_min""scale_row_min", 'scale_row_step'"scale_row_step""scale_row_step""scale_row_step""scale_row_step""scale_row_step", 'strict_boundaries'"strict_boundaries""strict_boundaries""strict_boundaries""strict_boundaries""strict_boundaries", 'subpixel'"subpixel""subpixel""subpixel""subpixel""subpixel", 'timeout'"timeout""timeout""timeout""timeout""timeout", 'use_clutter'"use_clutter""use_clutter""use_clutter""use_clutter""use_clutter"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value-array HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)

Parameter value.

Default value: 0.5

Suggested values: -3.14, -1.57, -0.79, -0.39, 0.0, 0.39, 0.79, 1.57, 3.14

Result

If the parameters are valid, the operator set_generic_shape_model_paramset_generic_shape_model_paramSetGenericShapeModelParamSetGenericShapeModelParamSetGenericShapeModelParamset_generic_shape_model_param returns the value TRUE. If necessary an exception is raised.

Possible Predecessors

create_generic_shape_modelcreate_generic_shape_modelCreateGenericShapeModelCreateGenericShapeModelCreateGenericShapeModelcreate_generic_shape_model

Possible Successors

get_generic_shape_model_paramget_generic_shape_model_paramGetGenericShapeModelParamGetGenericShapeModelParamGetGenericShapeModelParamget_generic_shape_model_param, train_generic_shape_modeltrain_generic_shape_modelTrainGenericShapeModelTrainGenericShapeModelTrainGenericShapeModeltrain_generic_shape_model, find_generic_shape_modelfind_generic_shape_modelFindGenericShapeModelFindGenericShapeModelFindGenericShapeModelfind_generic_shape_model

Module

Matching