HALCON Reference Manual 10.0.2
Table of Contents / Matching / Deformable ClassesClassesClasses | | | Operators

create_planar_calib_deformable_modelT_create_planar_calib_deformable_modelcreate_planar_calib_deformable_modelCreatePlanarCalibDeformableModelCreatePlanarCalibDeformableModel (Operator)

Name

create_planar_calib_deformable_modelT_create_planar_calib_deformable_modelcreate_planar_calib_deformable_modelCreatePlanarCalibDeformableModelCreatePlanarCalibDeformableModel — Create a deformable model for calibrated perspective matching.

Signature

create_planar_calib_deformable_model(Template : : CamParam, ReferencePose, NumLevels, AngleStart, AngleExtent, AngleStep, ScaleRMin, ScaleRMax, ScaleRStep, ScaleCMin, ScaleCMax, ScaleCStep, Optimization, Metric, Contrast, MinContrast, ParamName, ParamValue : ModelID)

Herror T_create_planar_calib_deformable_model(const Hobject Template, const Htuple CamParam, const Htuple ReferencePose, 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 ParamName, const Htuple ParamValue, Htuple* ModelID)

Herror create_planar_calib_deformable_model(Hobject Template, const HTuple& CamParam, const HTuple& ReferencePose, 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& ParamName, const HTuple& ParamValue, Hlong* ModelID)

HDeformableModel HImage::CreatePlanarCalibDeformableModel(const HTuple& CamParam, const HTuple& ReferencePose, 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& ParamName, const HTuple& ParamValue) const

void HDeformableModel::CreatePlanarCalibDeformableModel(const HImage& Template, const HTuple& CamParam, const HTuple& ReferencePose, 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& ParamName, const HTuple& ParamValue)

void HOperatorSetX.CreatePlanarCalibDeformableModel(
[in] IHUntypedObjectX* Template, [in] VARIANT CamParam, [in] VARIANT ReferencePose, [in] VARIANT NumLevels, [in] VARIANT AngleStart, [in] VARIANT AngleExtent, [in] VARIANT AngleStep, [in] VARIANT ScaleRMin, [in] VARIANT ScaleRMax, [in] VARIANT ScaleRStep, [in] VARIANT ScaleCMin, [in] VARIANT ScaleCMax, [in] VARIANT ScaleCStep, [in] VARIANT Optimization, [in] VARIANT Metric, [in] VARIANT Contrast, [in] VARIANT MinContrast, [in] VARIANT ParamName, [in] VARIANT ParamValue, [out] VARIANT* ModelID)

void HDeformableModelX.CreatePlanarCalibDeformableModel(
[in] IHImageX* Template, [in] VARIANT CamParam, [in] VARIANT ReferencePose, [in] VARIANT NumLevels, [in] double AngleStart, [in] double AngleExtent, [in] VARIANT AngleStep, [in] double ScaleRMin, [in] double ScaleRMax, [in] VARIANT ScaleRStep, [in] double ScaleCMin, [in] double ScaleCMax, [in] VARIANT ScaleCStep, [in] VARIANT Optimization, [in] BSTR Metric, [in] VARIANT Contrast, [in] VARIANT MinContrast, [in] VARIANT ParamName, [in] VARIANT ParamValue)

IHDeformableModelX* HImageX.CreatePlanarCalibDeformableModel(
[in] VARIANT CamParam, [in] VARIANT ReferencePose, [in] VARIANT NumLevels, [in] double AngleStart, [in] double AngleExtent, [in] VARIANT AngleStep, [in] double ScaleRMin, [in] double ScaleRMax, [in] VARIANT ScaleRStep, [in] double ScaleCMin, [in] double ScaleCMax, [in] VARIANT ScaleCStep, [in] VARIANT Optimization, [in] BSTR Metric, [in] VARIANT Contrast, [in] VARIANT MinContrast, [in] VARIANT ParamName, [in] VARIANT ParamValue)

static void HOperatorSet.CreatePlanarCalibDeformableModel(HObject template, HTuple camParam, HTuple referencePose, 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 paramName, HTuple paramValue, out HTuple modelID)

public HDeformableModel(HImage template, HTuple camParam, HPose referencePose, HTuple numLevels, double angleStart, double angleExtent, HTuple angleStep, double scaleRMin, double scaleRMax, HTuple scaleRStep, double scaleCMin, double scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple paramName, HTuple paramValue)

public HDeformableModel(HImage template, HTuple camParam, HPose referencePose, int numLevels, double angleStart, double angleExtent, double angleStep, double scaleRMin, double scaleRMax, double scaleRStep, double scaleCMin, double scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple paramName, HTuple paramValue)

void HDeformableModel.CreatePlanarCalibDeformableModel(HImage template, HTuple camParam, HPose referencePose, HTuple numLevels, double angleStart, double angleExtent, HTuple angleStep, double scaleRMin, double scaleRMax, HTuple scaleRStep, double scaleCMin, double scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple paramName, HTuple paramValue)

void HDeformableModel.CreatePlanarCalibDeformableModel(HImage template, HTuple camParam, HPose referencePose, int numLevels, double angleStart, double angleExtent, double angleStep, double scaleRMin, double scaleRMax, double scaleRStep, double scaleCMin, double scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple paramName, HTuple paramValue)

HDeformableModel HImage.CreatePlanarCalibDeformableModel(HTuple camParam, HPose referencePose, HTuple numLevels, double angleStart, double angleExtent, HTuple angleStep, double scaleRMin, double scaleRMax, HTuple scaleRStep, double scaleCMin, double scaleCMax, HTuple scaleCStep, HTuple optimization, string metric, HTuple contrast, HTuple minContrast, HTuple paramName, HTuple paramValue)

HDeformableModel HImage.CreatePlanarCalibDeformableModel(HTuple camParam, HPose referencePose, int numLevels, double angleStart, double angleExtent, double angleStep, double scaleRMin, double scaleRMax, double scaleRStep, double scaleCMin, double scaleCMax, double scaleCStep, string optimization, string metric, HTuple contrast, int minContrast, HTuple paramName, HTuple paramValue)

Description

The operator create_planar_calib_deformable_modelcreate_planar_calib_deformable_modelcreate_planar_calib_deformable_modelCreatePlanarCalibDeformableModelCreatePlanarCalibDeformableModel prepares a template, which is passed in the image TemplateTemplateTemplateTemplatetemplate, as a deformable model used for planar calibrated matching. The ROI of the model is passed as the domain of TemplateTemplateTemplateTemplatetemplate.

The planar calibrated matching can be used to detect the 3D pose of a planar object or planar subparts of non-planar objects that are distorted by a projective view. This is an alternative to create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModel, which returns the position as a 2D projective transformation (homography), but not as a metric 3D pose.

In order to determine the 3D pose, the internal camera parameters CamParamCamParamCamParamCamParamcamParam must be provided. Typically, the internal parameters are determined with the help of calibrate_camerascalibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCameras.

Additionally to the internal camera parameters, the metric size of the image part that is passed in TemplateTemplateTemplateTemplatetemplate must be known. For this, a 3D reference pose that defines a 3D model plane in which the object resides must be provided with ReferencePoseReferencePoseReferencePoseReferencePosereferencePose. The 3D model plane is spanned by the x and y axis of the coordinate system defined by ReferencePoseReferencePoseReferencePoseReferencePosereferencePose.

As described in create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModel, the origin (reference point) of the model is defined as the center of gravity of the domain (region) of the model image TemplateTemplateTemplateTemplatetemplate. This image point defines a ray that is cut with the plane that is provided with ReferencePoseReferencePoseReferencePoseReferencePosereferencePose to obtain the absolute 3D model pose. This is also the absolute pose that is later returned in find_planar_calib_deformable_modelfind_planar_calib_deformable_modelfind_planar_calib_deformable_modelFindPlanarCalibDeformableModelFindPlanarCalibDeformableModel. Hence, the 3D pose of the model might differ from the reference pose by a 2D translation in the model plane. The final model pose can be determined by calling get_deformable_model_paramsget_deformable_model_paramsget_deformable_model_paramsGetDeformableModelParamsGetDeformableModelParams. The 3D model plane can be estimated by using calibrate_camerascalibrate_camerascalibrate_camerasCalibrateCamerasCalibrateCameras or vector_to_posevector_to_posevector_to_poseVectorToPoseVectorToPose.

For further explanation on the planar deformable model and its parameters we refer to the description of create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModel.

Parallelization

Parameters

TemplateTemplateTemplateTemplatetemplate (input_object)  (multichannel-)image objectHImageHImageHImageXHobject (byte / uint2)

Input image whose domain will be used to create the model.

CamParamCamParamCamParamCamParamcamParam (input_control)  number-array HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

The parameters of the internal orientation of the camera.

Number of elements: (CamParam == 8) || (CamParam == 12)

ReferencePoseReferencePoseReferencePoseReferencePosereferencePose (input_control)  pose-array HPose, HTupleHTupleHPoseX, VARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

The reference pose of the object in the reference image.

NumLevelsNumLevelsNumLevelsNumLevelsnumLevels (input_control)  integer HTupleHTupleVARIANTHtuple (integer / string) (int / long / string) (Hlong / char*) (Hlong / BSTR) (Hlong / char*)

Maximum number of pyramid levels.

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

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

AngleStartAngleStartAngleStartAngleStartangleStart (input_control)  angle.rad HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Smallest rotation of the pattern.

Default value: -0.39

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

AngleExtentAngleExtentAngleExtentAngleExtentangleExtent (input_control)  angle.rad HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Extent of the rotation angles.

Default value: 0.79

Suggested values: 6.29, 3.14, 1.57, 0.79, 0.39

Restriction: AngleExtent >= 0

AngleStepAngleStepAngleStepAngleStepangleStep (input_control)  angle.rad HTupleHTupleVARIANTHtuple (real / string) (double / string) (double / char*) (double / BSTR) (double / char*)

Step length of the angles (resolution).

Default value: '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

ScaleRMinScaleRMinScaleRMinScaleRMinscaleRMin (input_control)  number HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Minimum scale of the pattern in row direction.

Default value: 1.0

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

Restriction: ScaleRMin > 0

ScaleRMaxScaleRMaxScaleRMaxScaleRMaxscaleRMax (input_control)  number HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Maximum scale of the pattern in row direction.

Default value: 1.0

Suggested values: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5

Restriction: ScaleRMax >= ScaleRMin

ScaleRStepScaleRStepScaleRStepScaleRStepscaleRStep (input_control)  number HTupleHTupleVARIANTHtuple (real / string) (double / string) (double / char*) (double / BSTR) (double / char*)

Scale step length (resolution) the row direction.

Default value: '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

ScaleCMinScaleCMinScaleCMinScaleCMinscaleCMin (input_control)  number HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Minimum scale of the pattern in column direction.

Default value: 1.0

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

Restriction: ScaleCMin > 0

ScaleCMaxScaleCMaxScaleCMaxScaleCMaxscaleCMax (input_control)  number HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Maximum scale of the pattern in column direction.

Default value: 1.0

Suggested values: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5

Restriction: ScaleCMax >= ScaleCMin

ScaleCStepScaleCStepScaleCStepScaleCStepscaleCStep (input_control)  number HTupleHTupleVARIANTHtuple (real / string) (double / string) (double / char*) (double / BSTR) (double / char*)

Scale step length (resolution) in the column direction.

Default value: '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) HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Kind of optimization used for generating the model.

Default value: 'none' "none" "none" "none" "none"

List of values: 'auto'"auto""auto""auto""auto", 'none'"none""none""none""none", '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", 'point_reduction_high'"point_reduction_high""point_reduction_high""point_reduction_high""point_reduction_high"

MetricMetricMetricMetricmetric (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Match metric.

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

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

ContrastContrastContrastContrastcontrast (input_control)  number-array HTupleHTupleVARIANTHtuple (integer / string) (int / long / string) (Hlong / char*) (Hlong / BSTR) (Hlong / char*)

Thresholds or hysteresis thresholds for the contrast of the object in the template image.

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

Suggested values: 'auto'"auto""auto""auto""auto", 10, 20, 30, 40, 60, 80, 100, 120, 140, 160

MinContrastMinContrastMinContrastMinContrastminContrast (input_control)  number HTupleHTupleVARIANTHtuple (integer / string) (int / long / string) (Hlong / char*) (Hlong / BSTR) (Hlong / char*)

Minimum contrast of the objects in the search images.

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

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

Restriction: MinContrast < Contrast

ParamNameParamNameParamNameParamNameparamName (input_control)  string-array HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

The parameter names.

Default value: []

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

ParamValueParamValueParamValueParamValueparamValue (input_control)  integer-array HTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

Values of the parameters.

Default value: []

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

ModelIDModelIDModelIDModelIDmodelID (output_control)  deformable_model HDeformableModel, HTupleHDeformableModel, HTupleHDeformableModelX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Handle of the model.

Result

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

Possible Predecessors

determine_deformable_model_paramsdetermine_deformable_model_paramsdetermine_deformable_model_paramsDetermineDeformableModelParamsDetermineDeformableModelParams

Possible Successors

set_deformable_model_originset_deformable_model_originset_deformable_model_originSetDeformableModelOriginSetDeformableModelOrigin, set_deformable_model_paramset_deformable_model_paramset_deformable_model_paramSetDeformableModelParamSetDeformableModelParam, get_deformable_model_contoursget_deformable_model_contoursget_deformable_model_contoursGetDeformableModelContoursGetDeformableModelContours, find_planar_calib_deformable_modelfind_planar_calib_deformable_modelfind_planar_calib_deformable_modelFindPlanarCalibDeformableModelFindPlanarCalibDeformableModel, get_deformable_model_paramsget_deformable_model_paramsget_deformable_model_paramsGetDeformableModelParamsGetDeformableModelParams, write_deformable_modelwrite_deformable_modelwrite_deformable_modelWriteDeformableModelWriteDeformableModel, clear_deformable_modelclear_deformable_modelclear_deformable_modelClearDeformableModelClearDeformableModel

Alternatives

read_deformable_modelread_deformable_modelread_deformable_modelReadDeformableModelReadDeformableModel

See also

create_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelcreate_planar_uncalib_deformable_modelCreatePlanarUncalibDeformableModelCreatePlanarUncalibDeformableModel

Module

Matching


Table of Contents / Matching / Deformable ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH