create_planar_uncalib_deformable_modelT_create_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model (Operator)
create_planar_uncalib_deformable_modelT_create_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
— Creates a deformable model for uncalibrated, perspective matching.
Signature
create_planar_uncalib_deformable_model(Template : : NumLevels, AngleStart, AngleExtent, AngleStep, ScaleRMin, ScaleRMax, ScaleRStep, ScaleCMin, ScaleCMax, ScaleCStep, Optimization, Metric, Contrast, MinContrast, GenParamName, GenParamValue : ModelID)
Herror T_create_planar_uncalib_deformable_model(const Hobject Template, 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 Contrast, const Htuple MinContrast, const Htuple GenParamName, const Htuple GenParamValue, Htuple* ModelID)
void CreatePlanarUncalibDeformableModel(const HObject& Template, 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& Contrast, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ModelID)
void HDeformableModel::HDeformableModel(const HImage& Template, 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, const HTuple& Contrast, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::HDeformableModel(const HImage& Template, 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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::HDeformableModel(const HImage& Template, 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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::HDeformableModel(const HImage& Template, 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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
(
Windows only)
void HDeformableModel::CreatePlanarUncalibDeformableModel(const HImage& Template, 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, const HTuple& Contrast, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::CreatePlanarUncalibDeformableModel(const HImage& Template, 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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::CreatePlanarUncalibDeformableModel(const HImage& Template, 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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
void HDeformableModel::CreatePlanarUncalibDeformableModel(const HImage& Template, 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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue)
(
Windows only)
HDeformableModel HImage::CreatePlanarUncalibDeformableModel(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, const HTuple& Contrast, const HTuple& MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
HDeformableModel HImage::CreatePlanarUncalibDeformableModel(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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
HDeformableModel HImage::CreatePlanarUncalibDeformableModel(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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
HDeformableModel HImage::CreatePlanarUncalibDeformableModel(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, const HTuple& Contrast, Hlong MinContrast, const HTuple& GenParamName, const HTuple& GenParamValue) const
(
Windows only)
static void HOperatorSet.CreatePlanarUncalibDeformableModel(HObject template, 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 contrast, HTuple minContrast, HTuple genParamName, HTuple genParamValue, out HTuple modelID)
public HDeformableModel(HImage template, HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, double scaleRMin, HTuple scaleRMax, HTuple scaleRStep, double scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple genParamName, HTuple genParamValue)
public HDeformableModel(HImage template, int numLevels, HTuple angleStart, HTuple angleExtent, double angleStep, double scaleRMin, HTuple scaleRMax, double scaleRStep, double scaleCMin, HTuple scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple genParamName, HTuple genParamValue)
void HDeformableModel.CreatePlanarUncalibDeformableModel(HImage template, HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, double scaleRMin, HTuple scaleRMax, HTuple scaleRStep, double scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple genParamName, HTuple genParamValue)
void HDeformableModel.CreatePlanarUncalibDeformableModel(HImage template, int numLevels, HTuple angleStart, HTuple angleExtent, double angleStep, double scaleRMin, HTuple scaleRMax, double scaleRStep, double scaleCMin, HTuple scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple genParamName, HTuple genParamValue)
HDeformableModel HImage.CreatePlanarUncalibDeformableModel(HTuple numLevels, HTuple angleStart, HTuple angleExtent, HTuple angleStep, double scaleRMin, HTuple scaleRMax, HTuple scaleRStep, double scaleCMin, HTuple scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple genParamName, HTuple genParamValue)
HDeformableModel HImage.CreatePlanarUncalibDeformableModel(int numLevels, HTuple angleStart, HTuple angleExtent, double angleStep, double scaleRMin, HTuple scaleRMax, double scaleRStep, double scaleCMin, HTuple scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple genParamName, HTuple genParamValue)
def create_planar_uncalib_deformable_model(template: 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, contrast: Sequence[Union[int, str]], min_contrast: Union[int, str], gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]]) -> HHandle
Description
The operator create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
prepares a
template, which is passed in the image TemplateTemplateTemplatetemplatetemplate
, as a deformable
model used for uncalibrated perspective matching. The ROI of the model is
passed as the domain of TemplateTemplateTemplatetemplatetemplate
.
The planar uncalibrated matching can be used to detect planar objects
or planar subparts of non-planar objects that are distorted by a projective
view.
This is an alternative to create_generic_shape_modelcreate_generic_shape_modelCreateGenericShapeModelCreateGenericShapeModelcreate_generic_shape_model
,
where typically the search image must be rectified by
calibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCamerascalibrate_cameras
and gen_image_to_world_plane_mapgen_image_to_world_plane_mapGenImageToWorldPlaneMapGenImageToWorldPlaneMapgen_image_to_world_plane_map
beforehand.
In contrast to create_shape_model_3dcreate_shape_model_3dCreateShapeModel3dCreateShapeModel3dcreate_shape_model_3d
there is no need to
pre-generate different views of an object, resulting into a smaller memory
consumption. Hence, in case of a planar perspectively distorted object,
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
should be preferred.
The model is generated using multiple image pyramid levels and is
stored in memory. The output parameter
ModelIDModelIDModelIDmodelIDmodel_id
is a handle for this model, which is used in
subsequent calls to find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
.
Input parameters in detail
NumLevelsNumLevelsNumLevelsnumLevelsnum_levels
:
-
The number of pyramid levels is determined with the parameter
NumLevelsNumLevelsNumLevelsnumLevelsnum_levels
. It should be chosen as large as possible
because by this the time necessary to find the object is
significantly reduced. On the other hand, NumLevelsNumLevelsNumLevelsnumLevelsnum_levels
must
be chosen such that the model is still recognizable and contains a
sufficient number of points on the highest pyramid level. If not enough
model points are generated, the number of pyramid levels is reduced
internally until enough model points are found on the highest pyramid level.
If this procedure would lead to a model with no pyramid levels, i.e., if the
number of model points is already too small on the lowest pyramid level,
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
returns with an error message.
If NumLevelsNumLevelsNumLevelsnumLevelsnum_levels
is set to 'auto'"auto""auto""auto""auto",
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
determines the number of
pyramid levels automatically. The automatically computed number of pyramid
levels can be queried using get_deformable_model_paramsget_deformable_model_paramsGetDeformableModelParamsGetDeformableModelParamsget_deformable_model_params
. In rare
cases, it might happen that create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
determines a value for the number of pyramid levels that is too
large or too small. If the number of pyramid levels is chosen too
large, the model may not be recognized in the image or it may be
necessary to select very low parameters for MinScoreMinScoreMinScoreminScoremin_score
or
GreedinessGreedinessGreedinessgreedinessgreediness
in find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
in order
to find the model.
If the number of pyramid levels is chosen too small, the time required
to find the model in find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
increases.
In these cases, the number of pyramid levels should be selected using the
output of inspect_shape_modelinspect_shape_modelInspectShapeModelInspectShapeModelinspect_shape_model
.
- Angle and Scale parameters:
-
Note that the parameters AngleStartAngleStartAngleStartangleStartangle_start
, AngleExtentAngleExtentAngleExtentangleExtentangle_extent
,
ScaleRMaxScaleRMaxScaleRMaxscaleRMaxscale_rmax
, and ScaleCMaxScaleCMaxScaleCMaxscaleCMaxscale_cmax
are not used by this operator.
Instead, they have to be specified within the operator
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
. ScaleRMinScaleRMinScaleRMinscaleRMinscale_rmin
and
ScaleCMinScaleCMinScaleCMinscaleCMinscale_cmin
can be relevant if you expect matches that are
smaller than in the original image TemplateTemplateTemplatetemplatetemplate
. Then, if
NumLevelsNumLevelsNumLevelsnumLevelsnum_levels
is set to 'auto'"auto""auto""auto""auto", the number of used pyramid
levels may decrease.
Generally, the parameters AngleStepAngleStepAngleStepangleStepangle_step
, ScaleRStepScaleRStepScaleRStepscaleRStepscale_rstep
and
ScaleCStepScaleCStepScaleCStepscaleCStepscale_cstep
can be determined automatically. The automatically
computed angle and scale step lengths can be queried using
get_deformable_model_paramsget_deformable_model_paramsGetDeformableModelParamsGetDeformableModelParamsget_deformable_model_params
. For more information
about how these parameters work, please refer to the operator
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
.
OptimizationOptimizationOptimizationoptimizationoptimization
:
-
For particularly large models, it may be useful to reduce the number
of model points by setting OptimizationOptimizationOptimizationoptimizationoptimization
to a value
different from 'none'"none""none""none""none". If OptimizationOptimizationOptimizationoptimizationoptimization
=
'none'"none""none""none""none", all model points are stored. In all other cases,
the number of points is reduced according to the value of
OptimizationOptimizationOptimizationoptimizationoptimization
.
If the number of points is reduced, it may be necessary in
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
to set the parameter
ScoreScoreScorescorescore
and GreedinessGreedinessGreedinessgreedinessgreediness
to a smaller value as, e.g.,
0.7 or 0.8.
For small models, the reduction of the number of model points does not result
in a speed-up of the search because in this case usually
significantly more potential instances of the model must be
examined. If OptimizationOptimizationOptimizationoptimizationoptimization
is set to 'auto'"auto""auto""auto""auto",
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
automatically determines the
reduction of the number of model points.
ContrastContrastContrastcontrastcontrast
:
-
The parameter ContrastContrastContrastcontrastcontrast
determines the contrast the model
points (edges) must have. The contrast is a measure for local gray value
differences between the object and the background and between
different parts of the object. ContrastContrastContrastcontrastcontrast
should be chosen
such that only the significant features of the template are used for
the model.
The following values can be set for ContrastContrastContrastcontrastcontrast
:
In certain cases, it might happen that the automatic determination of the
contrast thresholds is not satisfying. For example, a manual setting of these
parameters should be preferred if certain model components should be included
or suppressed because of application-specific reasons or if the object
contains several different contrasts. Therefore, the contrast
thresholds should be automatically determined with
determine_deformable_model_paramsdetermine_deformable_model_paramsDetermineDeformableModelParamsDetermineDeformableModelParamsdetermine_deformable_model_params
and subsequently verified using
inspect_shape_modelinspect_shape_modelInspectShapeModelInspectShapeModelinspect_shape_model
before calling
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
. Note that
MinContrastMinContrastMinContrastminContrastmin_contrast
influences the automatic contrast estimation, and
hence also the estimation of the minimum size.
MinContrastMinContrastMinContrastminContrastmin_contrast
:
-
With MinContrastMinContrastMinContrastminContrastmin_contrast
, it can be determined which minimal contrast the
model must have in the recognition performed by
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
. In other words, this parameter
separates the model from the noise in the image. Therefore, a good
choice is the range of gray value changes caused by the noise in the
image. If, for example, the gray values fluctuate within a range of
10 gray levels, MinContrastMinContrastMinContrastminContrastmin_contrast
should be set to 10.
Obviously, MinContrastMinContrastMinContrastminContrastmin_contrast
must be smaller than ContrastContrastContrastcontrastcontrast
. If
the model should be recognized in very low contrast images,
MinContrastMinContrastMinContrastminContrastmin_contrast
must be set to a correspondingly small value. If the
model should be recognized even if it is severely occluded,
MinContrastMinContrastMinContrastminContrastmin_contrast
should be slightly larger than the range of gray value
fluctuations created by noise in order to ensure that the position and
rotation of the model are extracted robustly and accurately by
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
. If MinContrastMinContrastMinContrastminContrastmin_contrast
is set
to 'auto'"auto""auto""auto""auto", the minimum contrast is determined automatically
based on the noise in the model image. Consequently, an automatic
determination only makes sense if the image noise during the recognition is
similar to the noise in the model image. Furthermore, in some cases it is
advisable to increase the automatically determined value in order to
increase the robustness against occlusions (see above). The automatically
computed minimum contrast can be queried using
get_deformable_model_paramsget_deformable_model_paramsGetDeformableModelParamsGetDeformableModelParamsget_deformable_model_params
. The MinContrastMinContrastMinContrastminContrastmin_contrast
of a deformable
model can later be changed with the help of
set_deformable_model_paramset_deformable_model_paramSetDeformableModelParamSetDeformableModelParamset_deformable_model_param
.
MetricMetricMetricmetricmetric
:
-
The parameter MetricMetricMetricmetricmetric
determines the conditions under which
the model is recognized in the image. If MetricMetricMetricmetricmetric
=
'use_polarity'"use_polarity""use_polarity""use_polarity""use_polarity", the object in the image and the model must
have the same contrast. If, for example, the model is a bright
object on a dark background, the object is found only if it is also
brighter than the background. If MetricMetricMetricmetricmetric
=
'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_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
will increase slightly in
this case. If MetricMetricMetricmetricmetric
= 'ignore_part_polarity'"ignore_part_polarity""ignore_part_polarity""ignore_part_polarity""ignore_part_polarity", the
the contrast polarity is allowed to change only between different
parts of the model, whereas the polarity of model points that are
within the same model part must not change. Please note that the
term 'ignore_part_polarity'"ignore_part_polarity""ignore_part_polarity""ignore_part_polarity""ignore_part_polarity" is capable of being
misunderstood. It means that polarity changes between
neighboring model parts do not influence the score, and hence
are ignored. If MetricMetricMetricmetricmetric
= 'ignore_local_polarity'"ignore_local_polarity""ignore_local_polarity""ignore_local_polarity""ignore_local_polarity",
the model is found even if the contrast changes for each individual model
point. This mode can, for example, be useful if the object consists of a part
with medium gray value, within which either darker or brighter
sub-objects lie. In this case the runtime of
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
increases significantly. The
above four metrics can only be applied to single-channel images. If a
multichannel image is used as the model image or as the search image only the
first channel will be used (and no error message will be returned). If
MetricMetricMetricmetricmetric
= 'ignore_color_polarity'"ignore_color_polarity""ignore_color_polarity""ignore_color_polarity""ignore_color_polarity", the model is
found even if the color contrast changes locally. This is, for
example, the case if parts of the object can change their color,
e.g., from red to green. In particular, this mode is useful if it
is not known in advance in which channels the object is visible. In
this mode, the runtime of find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
can
also increase significantly. The metric 'ignore_color_polarity'"ignore_color_polarity""ignore_color_polarity""ignore_color_polarity""ignore_color_polarity" can
be used for images with an arbitrary number of channels. If it is used
for single-channel images it has the same effect as
'ignore_local_polarity'"ignore_local_polarity""ignore_local_polarity""ignore_local_polarity""ignore_local_polarity". It should be noted that for
MetricMetricMetricmetricmetric
= 'ignore_color_polarity'"ignore_color_polarity""ignore_color_polarity""ignore_color_polarity""ignore_color_polarity" the number of
channels in the model creation with
create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
and in the search with
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
can be different. This
can, for example, be used to create a model from a synthetically
generated single-channel image. Furthermore, it should be noted
that the channels do not need to contain a spectral subdivision of
the light (like in an RGB image). The channels can, for example,
also contain images of the same object that were obtained by
illuminating the object from different directions.
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
, GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
:
-
With the help of the generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
and
GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
, the user can set parameters for the deformable model
generation.
The following parameters can be set for GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
.
- 'part_size'"part_size""part_size""part_size""part_size":
-
Adapts the average size of the sub-parts
that the deformable model should consist of.
For objects that consist of many small contours, 'small'"small""small""small""small"
should be selected. For objects that consist of only big contours,
'big'"big""big""big""big" should be set.
List of values:
'small'"small""small""small""small", 'medium'"medium""medium""medium""medium", 'big'"big""big""big""big"
Default:
'big'"big""big""big""big".
- 'min_size'"min_size""min_size""min_size""min_size":
-
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 specified
in the corresponding GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
are suppressed.
This threshold for the minimum size is divided by two for each
successive pyramid level. 'min_size'"min_size""min_size""min_size""min_size" can be set to an
arbitrary integer value greater or equal 0.
It can also be set to 'auto'"auto""auto""auto""auto" which means that
the minimum size will be determined automatically.
Default:
'auto'"auto""auto""auto""auto"
The center of gravity of the domain (region) of the model image
TemplateTemplateTemplatetemplatetemplate
is used as the origin (reference point) of the model.
A different origin for the model can be set with
set_deformable_model_originset_deformable_model_originSetDeformableModelOriginSetDeformableModelOriginset_deformable_model_origin
.
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
TemplateTemplateTemplatetemplatetemplate
(input_object) (multichannel-)image →
objectHImageHObjectHObjectHobject (byte / uint2)
Input image whose domain 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:
0, 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:
'none'
"none"
"none"
"none"
"none"
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:
'use_polarity'
"use_polarity"
"use_polarity"
"use_polarity"
"use_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"
ContrastContrastContrastcontrastcontrast
(input_control) number-array →
HTupleSequence[Union[int, str]]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)
Thresholds or hysteresis thresholds for the contrast
of the object in the template image.
Default:
'auto'
"auto"
"auto"
"auto"
"auto"
Suggested values:
'auto'"auto""auto""auto""auto", 10, 20, 30, 40, 60, 80, 100, 120, 140, 160
MinContrastMinContrastMinContrastminContrastmin_contrast
(input_control) number →
HTupleUnion[int, str]HTupleHtuple (integer / string) (int / long / string) (Hlong / HString) (Hlong / char*)
Minimum contrast of the objects in the search images.
Default:
'auto'
"auto"
"auto"
"auto"
"auto"
Suggested values:
'auto'"auto""auto""auto""auto", 1, 2, 3, 5, 7, 10, 20, 30, 40
Restriction:
MinContrast < Contrast
GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
(input_control) string-array →
HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
The generic parameter names.
Default:
[]
List of values:
[], 'min_size'"min_size""min_size""min_size""min_size", '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 parameter.
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_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModelcreate_planar_uncalib_deformable_model
returns the value 2 (
H_MSG_TRUE)
. If
necessary an exception is raised.
Possible Predecessors
determine_deformable_model_paramsdetermine_deformable_model_paramsDetermineDeformableModelParamsDetermineDeformableModelParamsdetermine_deformable_model_params
Possible Successors
set_deformable_model_originset_deformable_model_originSetDeformableModelOriginSetDeformableModelOriginset_deformable_model_origin
,
set_deformable_model_paramset_deformable_model_paramSetDeformableModelParamSetDeformableModelParamset_deformable_model_param
,
get_deformable_model_contoursget_deformable_model_contoursGetDeformableModelContoursGetDeformableModelContoursget_deformable_model_contours
,
find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModelfind_planar_uncalib_deformable_model
,
get_deformable_model_paramsget_deformable_model_paramsGetDeformableModelParamsGetDeformableModelParamsget_deformable_model_params
,
write_deformable_modelwrite_deformable_modelWriteDeformableModelWriteDeformableModelwrite_deformable_model
,
clear_deformable_modelclear_deformable_modelClearDeformableModelClearDeformableModelclear_deformable_model
Alternatives
read_deformable_modelread_deformable_modelReadDeformableModelReadDeformableModelread_deformable_model
Module
Matching