set_planar_uncalib_deformable_model_metricT_set_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metric (算子名称)
名称
set_planar_uncalib_deformable_model_metricT_set_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metric — Set the metric of a planar uncalibrated deformable model that was created
from XLD contours.
参数签名
Herror T_set_planar_uncalib_deformable_model_metric(const Hobject Image, const Htuple ModelID, const Htuple HomMat2D, const Htuple Metric)
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 HDeformableModel::SetPlanarUncalibDeformableModelMetric(const HImage& Image, const HHomMat2D& HomMat2D, const wchar_t* Metric) const
(
Windows only)
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 HImage::SetPlanarUncalibDeformableModelMetric(const HDeformableModel& ModelID, const HHomMat2D& HomMat2D, const wchar_t* Metric) const
(
Windows only)
描述
set_planar_uncalib_deformable_model_metricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metric changes the value of the
parameter MetricMetricMetricMetricmetricmetric that was selected during the creation of the
deformable model ModelIDModelIDModelIDModelIDmodelIDmodel_id 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 HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d, which can be obtained
by a previous call to find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model.
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_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
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 (HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d) 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.
注意
set_planar_uncalib_deformable_model_metricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metric can only be used with
deformable models that were created from XLD contours.
运行信息
- 多线程类型:可重入(与非独占操作符并行运行)。
- 多线程作用域:全局(可以从任何线程调用)。
- 未经并行化处理。
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.
参数表
ImageImageImageImageimageimage (input_object) singlechannelimage → objectHImageHObjectHImageHobject (byte / uint2)
Input image used for the determination of the
polarity.
ModelIDModelIDModelIDModelIDmodelIDmodel_id (input_control, state is modified) deformable_model → HDeformableModel, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Handle of the model.
HomMat2DHomMat2DHomMat2DHomMat2DhomMat2Dhom_mat_2d (input_control) hom_mat2d → HHomMat2D, HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Transformation matrix.
MetricMetricMetricMetricmetricmetric (input_control) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Match metric.
Default:
'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"
结果
如果参数均有效,算子
set_planar_uncalib_deformable_model_metricset_planar_uncalib_deformable_model_metricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricSetPlanarUncalibDeformableModelMetricset_planar_uncalib_deformable_model_metric 返回值 2 (
H_MSG_TRUE)
.
如有必要,将引发异常。
可能的前置算子
create_planar_uncalib_deformable_model_xldcreate_planar_uncalib_deformable_model_xldCreatePlanarUncalibDeformableModelXldCreatePlanarUncalibDeformableModelXldCreatePlanarUncalibDeformableModelXldcreate_planar_uncalib_deformable_model_xld,
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
可能的后置算子
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
参考其它
create_planar_uncalib_deformable_model_xldcreate_planar_uncalib_deformable_model_xldCreatePlanarUncalibDeformableModelXldCreatePlanarUncalibDeformableModelXldCreatePlanarUncalibDeformableModelXldcreate_planar_uncalib_deformable_model_xld
模块
Matching