ClassesClassesClassesClasses | | | | Operators

set_planar_uncalib_deformable_model_metricT_set_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetric (Operator)

Name

set_planar_uncalib_deformable_model_metricT_set_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetric — Set the metric of a planar uncalibrated deformable model that was created from XLD contours.

Signature

set_planar_uncalib_deformable_model_metric(Image : : ModelID, HomMat2D, Metric : )

Herror T_set_planar_uncalib_deformable_model_metric(const Hobject Image, const Htuple ModelID, const Htuple HomMat2D, const Htuple Metric)

Herror set_planar_uncalib_deformable_model_metric(Hobject Image, const HTuple& ModelID, const HTuple& HomMat2D, const HTuple& Metric)

void HImage::SetPlanarUncalibDeformableModelMetric(const HDeformableModel& ModelID, const HTuple& HomMat2D, const HTuple& Metric) const

void HDeformableModel::SetPlanarUncalibDeformableModelMetric(const HImage& Image, const HTuple& HomMat2D, const HTuple& Metric) const

void SetPlanarUncalibDeformableModelMetric(const HObject& Image, const HTuple& ModelID, const HTuple& HomMat2D, const HTuple& Metric)

void HDeformableModel::SetPlanarUncalibDeformableModelMetric(const HImage& Image, const HHomMat2D& HomMat2D, const HString& Metric) const

void HDeformableModel::SetPlanarUncalibDeformableModelMetric(const HImage& Image, const HHomMat2D& HomMat2D, const char* Metric) const

void HImage::SetPlanarUncalibDeformableModelMetric(const HDeformableModel& ModelID, const HHomMat2D& HomMat2D, const HString& Metric) const

void HImage::SetPlanarUncalibDeformableModelMetric(const HDeformableModel& ModelID, const HHomMat2D& HomMat2D, const char* Metric) const

void HOperatorSetX.SetPlanarUncalibDeformableModelMetric(
[in] IHUntypedObjectX* Image, [in] VARIANT ModelID, [in] VARIANT HomMat2d, [in] VARIANT Metric)

void HDeformableModelX.SetPlanarUncalibDeformableModelMetric(
[in] IHImageX* Image, [in] IHHomMat2DX* HomMat2d, [in] BSTR Metric)

void HImageX.SetPlanarUncalibDeformableModelMetric(
[in] IHDeformableModelX* ModelID, [in] IHHomMat2DX* HomMat2d, [in] BSTR Metric)

static void HOperatorSet.SetPlanarUncalibDeformableModelMetric(HObject image, HTuple modelID, HTuple homMat2D, HTuple metric)

void HDeformableModel.SetPlanarUncalibDeformableModelMetric(HImage image, HHomMat2D homMat2D, string metric)

void HImage.SetPlanarUncalibDeformableModelMetric(HDeformableModel modelID, HHomMat2D homMat2D, string metric)

Description

set_planar_uncalib_deformable_model_metricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetric changes the value of the parameter MetricMetricMetricMetricMetricmetric that was selected during the creation of the deformable model ModelIDModelIDModelIDModelIDModelIDmodelID from XLD contours. Because no information about the polarity of the model contours is available for XLD contours, the polarity is determined based on a representative ImageImageImageImageImageimage. For this, the model contours are mapped to the respective position where the object appears in the ImageImageImageImageImageimage using HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D, which can be obtained by a previous call to find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModel.

The parameter MetricMetricMetricMetricMetricmetric then determines the conditions under which the model is recognized later in the search image. If MetricMetricMetricMetricMetricmetric = 'use_polarity'"use_polarity""use_polarity""use_polarity""use_polarity""use_polarity", the object in the image and the model must have the same contrast. If, e.g., the model is a bright object on a dark background, the object is found only if it is also brighter than the background. If MetricMetricMetricMetricMetricmetric = 'ignore_global_polarity'"ignore_global_polarity""ignore_global_polarity""ignore_global_polarity""ignore_global_polarity""ignore_global_polarity", the object is found in the image also if the contrast reverses globally. In the above example, the object hence is also found if it is darker than the background. The runtime of find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModel will increase slightly in this case.

It must be ensured that the object contours in the ImageImageImageImageImageimage have the same (or inverse) polarity as the object contours in the image in which the object must be searched later. Especially, the object must not be occluded in the ImageImageImageImageImageimage and the background must be either brighter than the object or darker. Otherwise, the determined polarity of the model contour will not represent the polarity of the object contour during the search. Note that only the polarity of the contours is determined, not their contrast. Note also that the polarity is determined from a single-channel image, only. If a multi-channel image is passed in ImageImageImageImageImageimage, only the first channel will be used (and no error message will be returned).

A typical proceeding is to read the XLD contours from file. Since these XLD contours do not provide polarity information, the model must be created from the XLD contours by setting the parameter MetricMetricMetricMetricMetricmetric to 'ignore_local_polarity'"ignore_local_polarity""ignore_local_polarity""ignore_local_polarity""ignore_local_polarity""ignore_local_polarity". Then, in a first search image the model is recognized. The transformation that maps the model contours to the position of the object in the search image (HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D) can be determined from the matching result. To verify the match interactively, the model contours can be mapped to this position. If the matching result is correct, the value of the parameter MetricMetricMetricMetricMetricmetric can be changed, e.g., to 'use_polarity'"use_polarity""use_polarity""use_polarity""use_polarity""use_polarity". This leads to a faster and more robust recognition in the following images.

Attention

set_planar_uncalib_deformable_model_metricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetric can only be used with deformable models that were created from XLD contours.

Parallelization

Parameters

ImageImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageHImageXHobject (byte / uint2)

Input image used for the determination of the polarity.

ModelIDModelIDModelIDModelIDModelIDmodelID (input_control)  deformable_model HDeformableModel, HTupleHTupleHDeformableModel, HTupleHDeformableModelX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Handle of the model.

HomMat2DHomMat2DHomMat2DHomMat2DHomMat2DhomMat2D (input_control)  hom_mat2d HHomMat2D, HTupleHTupleHTupleHHomMat2DX, VARIANTHtuple (real) (double) (double) (double) (double) (double)

Transformation matrix.

MetricMetricMetricMetricMetricmetric (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Match metric.

Default value: 'use_polarity' "use_polarity" "use_polarity" "use_polarity" "use_polarity" "use_polarity"

List of values: 'ignore_global_polarity'"ignore_global_polarity""ignore_global_polarity""ignore_global_polarity""ignore_global_polarity""ignore_global_polarity", 'use_polarity'"use_polarity""use_polarity""use_polarity""use_polarity""use_polarity"

Result

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

Possible Predecessors

create_planar_uncalib_deformable_model_xldcreate_planar_uncalib_deformable_model_xldCreatePlanarUncalibDeformableModelXldcreate_planar_uncalib_deformable_model_xldCreatePlanarUncalibDeformableModelXldCreatePlanarUncalibDeformableModelXld, find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModel

Possible Successors

find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModel

See also

create_planar_uncalib_deformable_model_xldcreate_planar_uncalib_deformable_model_xldCreatePlanarUncalibDeformableModelXldcreate_planar_uncalib_deformable_model_xldCreatePlanarUncalibDeformableModelXldCreatePlanarUncalibDeformableModelXld

Module

Matching


ClassesClassesClassesClasses | | | | Operators