HALCON Reference Manual 10.0.2
Table of Contents / Matching / Gray-Value-Based ClassesClassesClasses | | | Operators

best_match_rotbest_match_rotbest_match_rotBestMatchRotBestMatchRot (Operator)

Name

best_match_rotbest_match_rotbest_match_rotBestMatchRotBestMatchRot — Searching the best matching of a template and an image with rotation.

Signature

best_match_rot(Image : : TemplateID, AngleStart, AngleExtend, MaxError, SubPixel : Row, Column, Angle, Error)

Herror best_match_rot(const Hobject Image, const Hlong TemplateID, double AngleStart, double AngleExtend, double MaxError, const char* SubPixel, double* Row, double* Column, double* Angle, double* Error)

Herror T_best_match_rot(const Hobject Image, const Htuple TemplateID, const Htuple AngleStart, const Htuple AngleExtend, const Htuple MaxError, const Htuple SubPixel, Htuple* Row, Htuple* Column, Htuple* Angle, Htuple* Error)

Herror best_match_rot(Hobject Image, const HTuple& TemplateID, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& MaxError, const HTuple& SubPixel, double* Row, double* Column, double* Angle, double* Error)

Herror best_match_rot(Hobject Image, const HTuple& TemplateID, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Error)

double HImage::BestMatchRot(const HTemplate& TemplateID, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& MaxError, const HTuple& SubPixel, double* Column, double* Angle, double* Error) const

HTuple HImageArray::BestMatchRot(const HTemplate& TemplateID, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Column, HTuple* Angle, HTuple* Error) const

HTuple HTemplate::BestMatchRot(const HImageArray& Image, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& MaxError, const HTuple& SubPixel, HTuple* Column, HTuple* Angle, HTuple* Error) const

void HOperatorSetX.BestMatchRot(
[in] IHUntypedObjectX* Image, [in] VARIANT TemplateID, [in] VARIANT AngleStart, [in] VARIANT AngleExtend, [in] VARIANT MaxError, [in] VARIANT SubPixel, [out] VARIANT* Row, [out] VARIANT* Column, [out] VARIANT* Angle, [out] VARIANT* Error)

VARIANT HTemplateX.BestMatchRot(
[in] IHImageX* Image, [in] double AngleStart, [in] double AngleExtend, [in] double MaxError, [in] BSTR SubPixel, [out] VARIANT* Column, [out] VARIANT* Angle, [out] VARIANT* Error)

VARIANT HImageX.BestMatchRot(
[in] IHTemplateX* TemplateID, [in] double AngleStart, [in] double AngleExtend, [in] double MaxError, [in] BSTR SubPixel, [out] VARIANT* Column, [out] VARIANT* Angle, [out] VARIANT* Error)

static void HOperatorSet.BestMatchRot(HObject image, HTuple templateID, HTuple angleStart, HTuple angleExtend, HTuple maxError, HTuple subPixel, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)

void HTemplate.BestMatchRot(HImage image, double angleStart, double angleExtend, double maxError, string subPixel, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)

void HTemplate.BestMatchRot(HImage image, double angleStart, double angleExtend, double maxError, string subPixel, out double row, out double column, out double angle, out double error)

void HImage.BestMatchRot(HTemplate templateID, double angleStart, double angleExtend, double maxError, string subPixel, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)

void HImage.BestMatchRot(HTemplate templateID, double angleStart, double angleExtend, double maxError, string subPixel, out double row, out double column, out double angle, out double error)

Description

The operator best_match_rotbest_match_rotbest_match_rotBestMatchRotBestMatchRot performs a matching of the template of TemplateIDTemplateIDTemplateIDTemplateIDtemplateID and ImageImageImageImageimage. It works similar to best_matchbest_matchbest_matchBestMatchBestMatch with the extension that the pattern can be rotated. The parameters AngleStartAngleStartAngleStartAngleStartangleStart and AngleExtendAngleExtendAngleExtendAngleExtendangleExtend define the maximum rotation of the pattern: AngleStartAngleStartAngleStartAngleStartangleStart specifies the maximum counter clockwise rotation and AngleExtendAngleExtendAngleExtendAngleExtendangleExtend the maximum clockwise rotation relative to this angle. Both values have to smaller or equal to the values used for the creation of the pattern (see create_template_rotcreate_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRot). In addition to best_matchbest_matchbest_matchBestMatchBestMatch best_match_rotbest_match_rotbest_match_rotBestMatchRotBestMatchRot returns the rotion angle of the pattern in AngleAngleAngleAngleangle (radiant). The accuracy of this angle depends on the parameter AngleStep of create_template_rotcreate_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRot. In the case of SubPixelSubPixelSubPixelSubPixelsubPixel = 'true'"true""true""true""true" the position and the angle are calculated with “sub pixel” accuracy.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  image(-array) objectHImageHImageHImageXHobject (byte)

Input image inside of which the pattern has to be found.

TemplateIDTemplateIDTemplateIDTemplateIDtemplateID (input_control)  template HTemplate, HTupleHTemplate, HTupleHTemplateX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Template number.

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

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

Maximum positive Extension of AngleStartAngleStartAngleStartAngleStartangleStart.

Default value: 0.79

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

Restriction: AngleExtend > 0

MaxErrorMaxErrorMaxErrorMaxErrormaxError (input_control)  real HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Maximum average difference of the grayvalues.

Default value: 30.0

Suggested values: 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 9.0, 11.0, 15.0, 17.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0

Typical range of values: 0 ≤ MaxError MaxError MaxError MaxError maxError ≤ 255

Minimum increment: 1

Recommended increment: 3

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

Subpixel accuracy in case of 'true'"true""true""true""true".

Default value: 'false' "false" "false" "false" "false"

List of values: 'true'"true""true""true""true", 'false'"false""false""false""false"

RowRowRowRowrow (output_control)  point.y(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Row position of the best match.

ColumnColumnColumnColumncolumn (output_control)  point.x(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Column position of the best match.

AngleAngleAngleAngleangle (output_control)  angle.rad(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Rotation angle of pattern.

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

Average divergence of the grayvalues of the best match.

Result

If the parameter values are correct, the operator best_match_rotbest_match_rotbest_match_rotBestMatchRotBestMatchRot returns the value 2 (H_MSG_TRUE). If the input is empty (no input images are available) the behaviour can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

create_template_rotcreate_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRot, read_templateread_templateread_templateReadTemplateReadTemplate, set_offset_templateset_offset_templateset_offset_templateSetOffsetTemplateSetOffsetTemplate, set_reference_templateset_reference_templateset_reference_templateSetReferenceTemplateSetReferenceTemplate, adapt_templateadapt_templateadapt_templateAdaptTemplateAdaptTemplate, draw_regiondraw_regiondraw_regionDrawRegionDrawRegion, draw_rectangle1draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain

Alternatives

best_match_rot_mgbest_match_rot_mgbest_match_rot_mgBestMatchRotMgBestMatchRotMg

See also

best_matchbest_matchbest_matchBestMatchBestMatch, best_match_mgbest_match_mgbest_match_mgBestMatchMgBestMatchMg

Module

Matching


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