Operator Reference

create_local_deformable_model_xldT_create_local_deformable_model_xldCreateLocalDeformableModelXldCreateLocalDeformableModelXldcreate_local_deformable_model_xld (Operator)

create_local_deformable_model_xldT_create_local_deformable_model_xldCreateLocalDeformableModelXldCreateLocalDeformableModelXldcreate_local_deformable_model_xld — Prepare a deformable model for local deformable matching from XLD contours.

Signature

Herror T_create_local_deformable_model_xld(const Hobject Contours, const Htuple NumLevels, const Htuple AngleStart, const Htuple AngleExtent, const Htuple AngleStep, const Htuple ScaleRMin, const Htuple ScaleRMax, const Htuple ScaleRStep, const Htuple ScaleCMin, const Htuple ScaleCMax, const Htuple ScaleCStep, const Htuple Optimization, const Htuple Metric, const Htuple MinContrast, const Htuple GenParamName, const Htuple GenParamValue, Htuple* ModelID)

void CreateLocalDeformableModelXld(const HObject& Contours, const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, const HTuple& ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, const HTuple& ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HTuple& Metric, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ModelID)

void HDeformableModel::CreateLocalDeformableModelXld(const HXLDCont& Contours, const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, double ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDeformableModel::CreateLocalDeformableModelXld(const HXLDCont& Contours, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDeformableModel::CreateLocalDeformableModelXld(const HXLDCont& Contours, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)

void HDeformableModel::CreateLocalDeformableModelXld(const HXLDCont& Contours, Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)   ( Windows only)

HDeformableModel HXLDCont::CreateLocalDeformableModelXld(const HTuple& NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& AngleStep, double ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, const HTuple& ScaleCStep, const HTuple& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDeformableModel HXLDCont::CreateLocalDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const HString& Optimization, const HString& Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDeformableModel HXLDCont::CreateLocalDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const char* Optimization, const char* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const

HDeformableModel HXLDCont::CreateLocalDeformableModelXld(Hlong NumLevels, const HTuple& AngleStart, const HTuple& AngleExtent, double AngleStep, double ScaleRMin, const HTuple& ScaleRMax, double ScaleRStep, double ScaleCMin, const HTuple& ScaleCMax, double ScaleCStep, const wchar_t* Optimization, const wchar_t* Metric, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const   ( Windows only)

static void HOperatorSet.CreateLocalDeformableModelXld(HObject contours, HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, HTuple scaleRMin, HTuple scaleRMax, HTuple scaleRStep, HTuple scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, HTuple metric, HTuple minContrast, HTuple genParamName, HTuple genParamValue, out HTuple modelID)

void HDeformableModel.CreateLocalDeformableModelXld(HXLDCont contours, HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, double scaleRMin, HTuple scaleRMax, HTuple scaleRStep, double scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, int minContrast, HTuple genParamName, HTuple genParamValue)

void HDeformableModel.CreateLocalDeformableModelXld(HXLDCont contours, int numLevels, HTuple angleStart, HTuple angleExtent, double angleStep, double scaleRMin, HTuple scaleRMax, double scaleRStep, double scaleCMin, HTuple scaleCMax, double scaleCStep, string optimization, string metric, int minContrast, HTuple genParamName, HTuple genParamValue)

HDeformableModel HXLDCont.CreateLocalDeformableModelXld(HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, double scaleRMin, HTuple scaleRMax, HTuple scaleRStep, double scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, int minContrast, HTuple genParamName, HTuple genParamValue)

HDeformableModel HXLDCont.CreateLocalDeformableModelXld(int numLevels, HTuple angleStart, HTuple angleExtent, double angleStep, double scaleRMin, HTuple scaleRMax, double scaleRStep, double scaleCMin, HTuple scaleCMax, double scaleCStep, string optimization, string metric, int minContrast, HTuple genParamName, HTuple genParamValue)

def create_local_deformable_model_xld(contours: HObject, num_levels: Union[int, str], angle_start: Sequence[float], angle_extent: Sequence[float], angle_step: Union[float, str], scale_rmin: float, scale_rmax: Sequence[float], scale_rstep: Union[float, str], scale_cmin: float, scale_cmax: Sequence[float], scale_cstep: Union[float, str], optimization: MaybeSequence[str], metric: str, min_contrast: int, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]]) -> HHandle

Description

The operator create_local_deformable_model_xldcreate_local_deformable_model_xldCreateLocalDeformableModelXldCreateLocalDeformableModelXldcreate_local_deformable_model_xld creates a deformable model used for local deformable matching from the XLD contours passed in ContoursContoursContourscontourscontours. The XLD contours represent the gray-value edges of the object to be searched for. In contrast to the operator create_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model, which creates a deformable model from a template image, the operator create_local_deformable_model_xldcreate_local_deformable_model_xldCreateLocalDeformableModelXldCreateLocalDeformableModelXldcreate_local_deformable_model_xld creates the deformable model from XLD contours.

The center of gravity of the smallest surrounding rectangle of the ContoursContoursContourscontourscontours that is parallel to the coordinate axes is used as the origin (reference point) of the model. A different origin can be set with set_deformable_model_originset_deformable_model_originSetDeformableModelOriginSetDeformableModelOriginset_deformable_model_origin.

For further explanation on the deformable model and its parameters we refer to the description of create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model and create_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model. Note that set_local_deformable_model_metricset_local_deformable_model_metricSetLocalDeformableModelMetricSetLocalDeformableModelMetricset_local_deformable_model_metric can be used to change the metric of the model.

Attention

Note that, in contrast to the operator create_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model, it is not possible to specify a minimum size of the model components. To avoid small model components in the model, short contours can be eliminated with the operator select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldselect_contours_xld before calling create_local_deformable_model_xldcreate_local_deformable_model_xldCreateLocalDeformableModelXldCreateLocalDeformableModelXldcreate_local_deformable_model_xld.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

ContoursContoursContourscontourscontours (input_object)  xld_cont(-array) objectHXLDContHObjectHObjectHobject

Input contours that will be used to create the model.

NumLevelsNumLevelsNumLevelsnumLevelsnum_levels (input_control)  integer HTupleUnion[int, str]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)

Maximum number of pyramid levels.

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

List of values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 'auto'"auto""auto""auto""auto"

AngleStartAngleStartAngleStartangleStartangle_start (input_control)  angle.rad-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

This parameter is not used.

Default: []

AngleExtentAngleExtentAngleExtentangleExtentangle_extent (input_control)  angle.rad-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

This parameter is not used.

Default: []

AngleStepAngleStepAngleStepangleStepangle_step (input_control)  angle.rad HTupleUnion[float, str]HTupleHtuple (real / string) (double / string) (double / HString) (double / char*)

Step length of the angles (resolution).

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

Suggested values: 'auto'"auto""auto""auto""auto", 0.0175, 0.0349, 0.0524, 0.0698, 0.0873

Restriction: AngleStep > 0 && AngleStep <= pi / 16

ScaleRMinScaleRMinScaleRMinscaleRMinscale_rmin (input_control)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Minimum scale of the pattern in row direction.

Default: 1.0

Suggested values: 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Restriction: ScaleRMin > 0

ScaleRMaxScaleRMaxScaleRMaxscaleRMaxscale_rmax (input_control)  number-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

This parameter is not used.

Default: []

ScaleRStepScaleRStepScaleRStepscaleRStepscale_rstep (input_control)  number HTupleUnion[float, str]HTupleHtuple (real / string) (double / string) (double / HString) (double / char*)

Scale step length (resolution) in row direction.

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

Suggested values: 'auto'"auto""auto""auto""auto", 0.01, 0.02, 0.05, 0.1, 0.15, 0.2

Restriction: ScaleRStep > 0

ScaleCMinScaleCMinScaleCMinscaleCMinscale_cmin (input_control)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Minimum scale of the pattern in column direction.

Default: 1.0

Suggested values: 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Restriction: ScaleCMin > 0

ScaleCMaxScaleCMaxScaleCMaxscaleCMaxscale_cmax (input_control)  number-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

This parameter is not used.

Default: []

ScaleCStepScaleCStepScaleCStepscaleCStepscale_cstep (input_control)  number HTupleUnion[float, str]HTupleHtuple (real / string) (double / string) (double / HString) (double / char*)

Scale step length (resolution) in column direction.

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

Suggested values: 'auto'"auto""auto""auto""auto", 0.01, 0.02, 0.05, 0.1, 0.15, 0.2

Restriction: ScaleCStep > 0

OptimizationOptimizationOptimizationoptimizationoptimization (input_control)  string(-array) HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Kind of optimization used for generating the model.

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

List of values: 'auto'"auto""auto""auto""auto", 'none'"none""none""none""none", 'point_reduction_high'"point_reduction_high""point_reduction_high""point_reduction_high""point_reduction_high", 'point_reduction_low'"point_reduction_low""point_reduction_low""point_reduction_low""point_reduction_low", 'point_reduction_medium'"point_reduction_medium""point_reduction_medium""point_reduction_medium""point_reduction_medium"

MetricMetricMetricmetricmetric (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Match metric.

Default: 'ignore_local_polarity' "ignore_local_polarity" "ignore_local_polarity" "ignore_local_polarity" "ignore_local_polarity"

List of values: 'ignore_color_polarity'"ignore_color_polarity""ignore_color_polarity""ignore_color_polarity""ignore_color_polarity", 'ignore_global_polarity'"ignore_global_polarity""ignore_global_polarity""ignore_global_polarity""ignore_global_polarity", 'ignore_local_polarity'"ignore_local_polarity""ignore_local_polarity""ignore_local_polarity""ignore_local_polarity", 'ignore_part_polarity'"ignore_part_polarity""ignore_part_polarity""ignore_part_polarity""ignore_part_polarity", 'use_polarity'"use_polarity""use_polarity""use_polarity""use_polarity"

MinContrastMinContrastMinContrastminContrastmin_contrast (input_control)  number HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Minimum contrast of the objects in the search images.

Default: 5

Suggested values: 1, 2, 3, 5, 7, 10, 20, 30, 40

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

The generic parameter names.

Default: []

List of values: [], 'part_size'"part_size""part_size""part_size""part_size"

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

Values of the generic parameters.

Default: []

List of values: [], 'big'"big""big""big""big", 'medium'"medium""medium""medium""medium", 'small'"small""small""small""small"

ModelIDModelIDModelIDmodelIDmodel_id (output_control)  deformable_model HDeformableModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the model.

Result

If the parameters are valid, the operator create_local_deformable_model_xldcreate_local_deformable_model_xldCreateLocalDeformableModelXldCreateLocalDeformableModelXldcreate_local_deformable_model_xld returns the value 2 ( H_MSG_TRUE) . If necessary, an exception is raised. If the parameter NumLevelsNumLevelsNumLevelsnumLevelsnum_levels is chosen such that the model contains too few points, the error 8510 is raised.

Possible Predecessors

read_contour_xld_dxfread_contour_xld_dxfReadContourXldDxfReadContourXldDxfread_contour_xld_dxf, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixedges_sub_pix, select_contours_xldselect_contours_xldSelectContoursXldSelectContoursXldselect_contours_xld

Possible Successors

find_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModelfind_local_deformable_model

See also

create_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModelcreate_local_deformable_model

Module

Matching