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

find_local_deformable_modelT_find_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModel (Operator)

Name

find_local_deformable_modelT_find_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModel — Find the best matches of a local deformable model in an image.

Signature

find_local_deformable_model(Image : ImageRectified, VectorField, DeformedContours : ModelID, AngleStart, AngleExtent, ScaleRMin, ScaleRMax, ScaleCMin, ScaleCMax, MinScore, NumMatches, MaxOverlap, NumLevels, Greediness, ResultType, ParamName, ParamValue : Score, Row, Column)

Herror T_find_local_deformable_model(const Hobject Image, Hobject* ImageRectified, Hobject* VectorField, Hobject* DeformedContours, const Htuple ModelID, const Htuple AngleStart, const Htuple AngleExtent, const Htuple ScaleRMin, const Htuple ScaleRMax, const Htuple ScaleCMin, const Htuple ScaleCMax, const Htuple MinScore, const Htuple NumMatches, const Htuple MaxOverlap, const Htuple NumLevels, const Htuple Greediness, const Htuple ResultType, const Htuple ParamName, const Htuple ParamValue, Htuple* Score, Htuple* Row, Htuple* Column)

Herror find_local_deformable_model(Hobject Image, Hobject* ImageRectified, Hobject* VectorField, Hobject* DeformedContours, const HTuple& ModelID, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleCMin, const HTuple& ScaleCMax, const HTuple& MinScore, const HTuple& NumMatches, const HTuple& MaxOverlap, const HTuple& NumLevels, const HTuple& Greediness, const HTuple& ResultType, const HTuple& ParamName, const HTuple& ParamValue, HTuple* Score, HTuple* Row, HTuple* Column)

HImageArray HImage::FindLocalDeformableModel(HImageArray* VectorField, HXLDContArray* DeformedContours, const HDeformableModel& ModelID, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleCMin, const HTuple& ScaleCMax, const HTuple& MinScore, const HTuple& NumMatches, const HTuple& MaxOverlap, const HTuple& NumLevels, const HTuple& Greediness, const HTuple& ResultType, const HTuple& ParamName, const HTuple& ParamValue, HTuple* Score, HTuple* Row, HTuple* Column) const

HImageArray HDeformableModel::FindLocalDeformableModel(const HImage& Image, HImage* VectorField, HXLDContArray* DeformedContours, const HTuple& AngleStart, const HTuple& AngleExtent, const HTuple& ScaleRMin, const HTuple& ScaleRMax, const HTuple& ScaleCMin, const HTuple& ScaleCMax, const HTuple& MinScore, const HTuple& NumMatches, const HTuple& MaxOverlap, const HTuple& NumLevels, const HTuple& Greediness, const HTuple& ResultType, const HTuple& ParamName, const HTuple& ParamValue, HTuple* Score, HTuple* Row, HTuple* Column) const

void HOperatorSetX.FindLocalDeformableModel(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageRectified, [out] IHUntypedObjectX*VectorField, [out] IHUntypedObjectX*DeformedContours, [in] VARIANT ModelID, [in] VARIANT AngleStart, [in] VARIANT AngleExtent, [in] VARIANT ScaleRMin, [in] VARIANT ScaleRMax, [in] VARIANT ScaleCMin, [in] VARIANT ScaleCMax, [in] VARIANT MinScore, [in] VARIANT NumMatches, [in] VARIANT MaxOverlap, [in] VARIANT NumLevels, [in] VARIANT Greediness, [in] VARIANT ResultType, [in] VARIANT ParamName, [in] VARIANT ParamValue, [out] VARIANT* Score, [out] VARIANT* Row, [out] VARIANT* Column)

IHImageX* HDeformableModelX.FindLocalDeformableModel(
[in] IHImageX* Image, [out] IHImageX*VectorField, [out] IHXLDContX*DeformedContours, [in] double AngleStart, [in] double AngleExtent, [in] double ScaleRMin, [in] double ScaleRMax, [in] double ScaleCMin, [in] double ScaleCMax, [in] double MinScore, [in] Hlong NumMatches, [in] double MaxOverlap, [in] VARIANT NumLevels, [in] double Greediness, [in] VARIANT ResultType, [in] VARIANT ParamName, [in] VARIANT ParamValue, [out] VARIANT* Score, [out] VARIANT* Row, [out] VARIANT* Column)

IHImageX* HImageX.FindLocalDeformableModel(
[out] IHImageX*VectorField, [out] IHXLDContX*DeformedContours, [in] IHDeformableModelX* ModelID, [in] double AngleStart, [in] double AngleExtent, [in] double ScaleRMin, [in] double ScaleRMax, [in] double ScaleCMin, [in] double ScaleCMax, [in] double MinScore, [in] Hlong NumMatches, [in] double MaxOverlap, [in] VARIANT NumLevels, [in] double Greediness, [in] VARIANT ResultType, [in] VARIANT ParamName, [in] VARIANT ParamValue, [out] VARIANT* Score, [out] VARIANT* Row, [out] VARIANT* Column)

static void HOperatorSet.FindLocalDeformableModel(HObject image, out HObject imageRectified, out HObject vectorField, out HObject deformedContours, HTuple modelID, HTuple angleStart, HTuple angleExtent, HTuple scaleRMin, HTuple scaleRMax, HTuple scaleCMin, HTuple scaleCMax, HTuple minScore, HTuple numMatches, HTuple maxOverlap, HTuple numLevels, HTuple greediness, HTuple resultType, HTuple paramName, HTuple paramValue, out HTuple score, out HTuple row, out HTuple column)

HImage HDeformableModel.FindLocalDeformableModel(HImage image, out HImage vectorField, out HXLDCont deformedContours, double angleStart, double angleExtent, double scaleRMin, double scaleRMax, double scaleCMin, double scaleCMax, double minScore, int numMatches, double maxOverlap, HTuple numLevels, double greediness, HTuple resultType, HTuple paramName, HTuple paramValue, out HTuple score, out HTuple row, out HTuple column)

HImage HDeformableModel.FindLocalDeformableModel(HImage image, out HImage vectorField, out HXLDCont deformedContours, double angleStart, double angleExtent, double scaleRMin, double scaleRMax, double scaleCMin, double scaleCMax, double minScore, int numMatches, double maxOverlap, int numLevels, double greediness, HTuple resultType, HTuple paramName, HTuple paramValue, out HTuple score, out HTuple row, out HTuple column)

HImage HImage.FindLocalDeformableModel(out HImage vectorField, out HXLDCont deformedContours, HDeformableModel modelID, double angleStart, double angleExtent, double scaleRMin, double scaleRMax, double scaleCMin, double scaleCMax, double minScore, int numMatches, double maxOverlap, HTuple numLevels, double greediness, HTuple resultType, HTuple paramName, HTuple paramValue, out HTuple score, out HTuple row, out HTuple column)

HImage HImage.FindLocalDeformableModel(out HImage vectorField, out HXLDCont deformedContours, HDeformableModel modelID, double angleStart, double angleExtent, double scaleRMin, double scaleRMax, double scaleCMin, double scaleCMax, double minScore, int numMatches, double maxOverlap, int numLevels, double greediness, HTuple resultType, HTuple paramName, HTuple paramValue, out HTuple score, out HTuple row, out HTuple column)

Description

The operator find_local_deformable_modelfind_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModel finds the best NumMatchesNumMatchesNumMatchesNumMatchesnumMatches instances of the locally deformable model ModelIDModelIDModelIDModelIDmodelID in the input ImageImageImageImageimage. The model must have been created previously by calling create_local_deformable_modelcreate_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModel or read_deformable_modelread_deformable_modelread_deformable_modelReadDeformableModelReadDeformableModel. The operator find_local_deformable_modelfind_local_deformable_modelfind_local_deformable_modelFindLocalDeformableModelFindLocalDeformableModel returns the RowRowRowRowrow and ColumnColumnColumnColumncolumn coordinates of the found instances.

Additionally, a rectified part of the image, the respective vector field, and the contours of the found deformed model instance can be returned in ImageRectifiedImageRectifiedImageRectifiedImageRectifiedimageRectified, VectorFieldVectorFieldVectorFieldVectorFieldvectorField, and DeformedContoursDeformedContoursDeformedContoursDeformedContoursdeformedContours. By default, these iconic objects are not returned. In case that they are needed the parameter ResultTypeResultTypeResultTypeResultTyperesultType should be set to 'image_rectified', 'vector_field' and 'deformed_contours'. The size of ImageRectifiedImageRectifiedImageRectifiedImageRectifiedimageRectified and VectorFieldVectorFieldVectorFieldVectorFieldvectorField is the smallest axis-aligned rectangle of the domain of the image that was used to create the local deformable model with create_local_deformable_modelcreate_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModel. The size of the rectified image and the vector field can be expanded in all directions by setting ParamNameParamNameParamNameParamNameparamName to 'expand_border' and the respective ParamValueParamValueParamValueParamValueparamValue to the number of pixels. Optionally, a specific direction can be selected with 'expand_border_top', 'expand_border_bottom', 'expand_border_left', and 'expand_border_right'. Please note that the returned VectorFieldVectorFieldVectorFieldVectorFieldvectorField is in absolute coordinates and can be used for convert_map_typeconvert_map_typeconvert_map_typeConvertMapTypeConvertMapType.

The smoothness of the estimated deformation can be selected with ParamNameParamNameParamNameParamNameparamName set to 'deformation_smoothness'. The value for 'deformation_smoothness' can be imagined as the size of a smoothing filter to the estimated deformation field. A too small value expects a strong deformation a too big value expects a rigid object. A typical value is 11, but can be increased to 31 for only small global deformations.

Finally, the score of each found instance is returned in ScoreScoreScoreScorescore. The score is a number between 0 and 1, which is an approximate measure of how much of the model is visible in the image.

For further explanation on the parameters used for the search of a local deformable model we refer to the description of find_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelfind_planar_uncalib_deformable_modelFindPlanarUncalibDeformableModelFindPlanarUncalibDeformableModel.

Parallelization

Parameters

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

Input image in which the model should be found.

ImageRectifiedImageRectifiedImageRectifiedImageRectifiedimageRectified (output_object)  (multichannel-)image(-array) objectHImageHImageHImageXHobject * (byte / uint2)

Rectified image of the found model.

VectorFieldVectorFieldVectorFieldVectorFieldvectorField (output_object)  singlechannelimage(-array) objectHImageHImageHImageXHobject * (vector_field)

Vector field of the rectification transformation.

DeformedContoursDeformedContoursDeformedContoursDeformedContoursdeformedContours (output_object)  xld_cont-array objectHXLDContHXLDContArrayHXLDContXHobject *

Contours of the found instances of the model.

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

Handle of the model.

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

Smallest rotation of the model.

Default value: -0.39

Suggested values: -3.14, -1.57, -0.78, -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.78

Suggested values: 6.29, 3.14, 1.57, 0.78, 0.39, 0.0

Restriction: AngleExtent >= 0

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

Minimum scale of the model 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 model in row direction.

Default value: 1.0

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

Restriction: ScaleRMax >= ScaleRMin

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

Minimum scale of the model 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 model in column direction.

Default value: 1.0

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

Restriction: ScaleCMax >= ScaleCMin

MinScoreMinScoreMinScoreMinScoreminScore (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Minumum score of the instances of the model to be found.

Default value: 0.5

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

Typical range of values: 0 ≤ MinScore MinScore MinScore MinScore minScore ≤ 1

Minimum increment: 0.01

Recommended increment: 0.05

NumMatchesNumMatchesNumMatchesNumMatchesnumMatches (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of instances of the model to be found.

Default value: 1

Suggested values: 0, 1, 2, 3, 4, 5, 10, 20

MaxOverlapMaxOverlapMaxOverlapMaxOverlapmaxOverlap (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Maximum overlap of the instances of the model to be found.

Default value: 1.0

Suggested values: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Typical range of values: 0 ≤ MaxOverlap MaxOverlap MaxOverlap MaxOverlap maxOverlap ≤ 1

Minimum increment: 0.01

Recommended increment: 0.05

NumLevelsNumLevelsNumLevelsNumLevelsnumLevels (input_control)  integer(-array) HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Number of pyramid levels used in the matching.

Default value: 0

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

GreedinessGreedinessGreedinessGreedinessgreediness (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

“Greediness” of the search heuristic (0: safe but slow; 1: fast but matches may be missed).

Default value: 0.9

Suggested values: 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0

Typical range of values: 0 ≤ Greediness Greediness Greediness Greediness greediness ≤ 1

Minimum increment: 0.01

Recommended increment: 0.05

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

Switch for requested iconic result.

Default value: []

List of values: [], 'image_rectified'"image_rectified""image_rectified""image_rectified""image_rectified", 'vector_field'"vector_field""vector_field""vector_field""vector_field", 'deformed_contours'"deformed_contours""deformed_contours""deformed_contours""deformed_contours"

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

The general parameter names.

Default value: []

List of values: [], 'subpixel'"subpixel""subpixel""subpixel""subpixel", 'angle_step'"angle_step""angle_step""angle_step""angle_step", 'scale_r_step'"scale_r_step""scale_r_step""scale_r_step""scale_r_step", 'scale_c_step'"scale_c_step""scale_c_step""scale_c_step""scale_c_step", 'deformation_smoothness'"deformation_smoothness""deformation_smoothness""deformation_smoothness""deformation_smoothness", 'expand_border'"expand_border""expand_border""expand_border""expand_border", 'expand_border_top'"expand_border_top""expand_border_top""expand_border_top""expand_border_top", 'expand_border_bottom'"expand_border_bottom""expand_border_bottom""expand_border_bottom""expand_border_bottom", 'expand_border_left'"expand_border_left""expand_border_left""expand_border_left""expand_border_left", 'expand_border_right'"expand_border_right""expand_border_right""expand_border_right""expand_border_right"

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 general parameters.

Default value: []

List of values: [], 'none'"none""none""none""none", 'least_squares'"least_squares""least_squares""least_squares""least_squares", 'least_squares_high'"least_squares_high""least_squares_high""least_squares_high""least_squares_high", 'least_squares_very_high'"least_squares_very_high""least_squares_very_high""least_squares_very_high""least_squares_very_high"

ScoreScoreScoreScorescore (output_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Scores of the found instances of the model.

RowRowRowRowrow (output_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Row coordinates of the found instances of the model.

ColumnColumnColumnColumncolumn (output_control)  real-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Column coordinates of the found instances of the model.

Result

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

Possible Predecessors

create_local_deformable_modelcreate_local_deformable_modelcreate_local_deformable_modelCreateLocalDeformableModelCreateLocalDeformableModel, create_local_deformable_model_xldcreate_local_deformable_model_xldcreate_local_deformable_model_xldCreateLocalDeformableModelXldCreateLocalDeformableModelXld, read_deformable_modelread_deformable_modelread_deformable_modelReadDeformableModelReadDeformableModel

Module

Matching


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