best_match_rot_mgT_best_match_rot_mgBestMatchRotMgBestMatchRotMgbest_match_rot_mg (Operator)
best_match_rot_mgT_best_match_rot_mgBestMatchRotMgBestMatchRotMgbest_match_rot_mg
— Searching the best matching of a template and a pyramid with rotation.
Warning
best_match_rot_mgbest_match_rot_mgBestMatchRotMgBestMatchRotMgbest_match_rot_mg
is obsolete and is only provided for
reasons of backward compatibility.
The operator will be removed with HALCON 25.11.
New applications should use the
shape-based or NCC-based operators instead.
Signature
Herror T_best_match_rot_mg(const Hobject Image, const Htuple TemplateID, const Htuple AngleStart, const Htuple AngleExtend, const Htuple MaxError, const Htuple SubPixel, const Htuple NumLevels, Htuple* Row, Htuple* Column, Htuple* Angle, Htuple* Error)
void BestMatchRotMg(const HObject& Image, const HTuple& TemplateID, const HTuple& AngleStart, const HTuple& AngleExtend, const HTuple& MaxError, const HTuple& SubPixel, const HTuple& NumLevels, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Error)
void HTemplate::BestMatchRotMg(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, Hlong NumLevels, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Error) const
void HTemplate::BestMatchRotMg(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, Hlong NumLevels, double* Row, double* Column, double* Angle, double* Error) const
void HTemplate::BestMatchRotMg(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const char* SubPixel, Hlong NumLevels, double* Row, double* Column, double* Angle, double* Error) const
void HTemplate::BestMatchRotMg(const HImage& Image, double AngleStart, double AngleExtend, double MaxError, const wchar_t* SubPixel, Hlong NumLevels, double* Row, double* Column, double* Angle, double* Error) const
(
Windows only)
void HImage::BestMatchRotMg(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, Hlong NumLevels, HTuple* Row, HTuple* Column, HTuple* Angle, HTuple* Error) const
void HImage::BestMatchRotMg(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const HString& SubPixel, Hlong NumLevels, double* Row, double* Column, double* Angle, double* Error) const
void HImage::BestMatchRotMg(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const char* SubPixel, Hlong NumLevels, double* Row, double* Column, double* Angle, double* Error) const
void HImage::BestMatchRotMg(const HTemplate& TemplateID, double AngleStart, double AngleExtend, double MaxError, const wchar_t* SubPixel, Hlong NumLevels, double* Row, double* Column, double* Angle, double* Error) const
(
Windows only)
static void HOperatorSet.BestMatchRotMg(HObject image, HTuple templateID, HTuple angleStart, HTuple angleExtend, HTuple maxError, HTuple subPixel, HTuple numLevels, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)
void HTemplate.BestMatchRotMg(HImage image, double angleStart, double angleExtend, double maxError, string subPixel, int numLevels, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)
void HTemplate.BestMatchRotMg(HImage image, double angleStart, double angleExtend, double maxError, string subPixel, int numLevels, out double row, out double column, out double angle, out double error)
void HImage.BestMatchRotMg(HTemplate templateID, double angleStart, double angleExtend, double maxError, string subPixel, int numLevels, out HTuple row, out HTuple column, out HTuple angle, out HTuple error)
void HImage.BestMatchRotMg(HTemplate templateID, double angleStart, double angleExtend, double maxError, string subPixel, int numLevels, out double row, out double column, out double angle, out double error)
def best_match_rot_mg(image: HObject, template_id: HHandle, angle_start: float, angle_extend: float, max_error: float, sub_pixel: str, num_levels: int) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float]]
def best_match_rot_mg_s(image: HObject, template_id: HHandle, angle_start: float, angle_extend: float, max_error: float, sub_pixel: str, num_levels: int) -> Tuple[float, float, float, float]
Description
The operator best_match_rot_mgbest_match_rot_mgBestMatchRotMgBestMatchRotMgbest_match_rot_mg
performs a matching of the template
of TemplateIDTemplateIDTemplateIDtemplateIDtemplate_id
and ImageImageImageimageimage
.
It works similar to best_match_mgbest_match_mgBestMatchMgBestMatchMgbest_match_mg
with the extension
that the pattern can be rotated analogously to best_match_rotbest_match_rotBestMatchRotBestMatchRotbest_match_rot
.
The parameters AngleStartAngleStartAngleStartangleStartangle_start
and AngleExtendAngleExtendAngleExtendangleExtendangle_extend
define the maximum rotation of the pattern: AngleStartAngleStartAngleStartangleStartangle_start
specifies the maximum counter clockwise rotation and
AngleExtendAngleExtendAngleExtendangleExtendangle_extend
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_rotCreateTemplateRotCreateTemplateRotcreate_template_rot
).
In addition to best_match_mgbest_match_mgBestMatchMgBestMatchMgbest_match_mg
best_match_rot_mgbest_match_rot_mgBestMatchRotMgBestMatchRotMgbest_match_rot_mg
returns the rotation angle of the pattern in AngleAngleAngleangleangle
(radiant).
The value of MaxErrorMaxErrorMaxErrormaxErrormax_error
must be set larger in comparison with
the operator best_match_rotbest_match_rotBestMatchRotBestMatchRotbest_match_rot
, because often the error is larger at
higher levels of the pyramid.
In the case of SubPixelSubPixelSubPixelsubPixelsub_pixel
= 'true'"true""true""true""true" the position
and the angle are calculated with “sub pixel” accuracy.
The value of NumLevelsNumLevelsNumLevelsnumLevelsnum_levels
has to equal or smaller than
the value used to create the template.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
Parameters
ImageImageImageimageimage
(input_object) singlechannelimage(-array) →
objectHImageHObjectHObjectHobject (byte)
Input image inside of which the pattern has to
be found.
TemplateIDTemplateIDTemplateIDtemplateIDtemplate_id
(input_control) template →
HTemplate, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Template number.
AngleStartAngleStartAngleStartangleStartangle_start
(input_control) angle.rad →
HTuplefloatHTupleHtuple (real) (double) (double) (double)
Smallest Rotation of the pattern.
Default:
-0.39
Suggested values:
-3.14, -1.57, -0.79, -0.39, -0.20, 0.0
AngleExtendAngleExtendAngleExtendangleExtendangle_extend
(input_control) angle.rad →
HTuplefloatHTupleHtuple (real) (double) (double) (double)
Maximum positive Extension of AngleStartAngleStartAngleStartangleStartangle_start
.
Default:
0.79
Suggested values:
6.28, 3.14, 1.57, 0.79, 0.39
Restriction:
AngleExtend > 0
MaxErrorMaxErrorMaxErrormaxErrormax_error
(input_control) real →
HTuplefloatHTupleHtuple (real) (double) (double) (double)
Maximum average difference of the gray values.
Default:
40.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
Value range:
0
≤
MaxError
MaxError
MaxError
maxError
max_error
≤
255
Minimum increment:
1
Recommended increment:
1
SubPixelSubPixelSubPixelsubPixelsub_pixel
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Subpixel accuracy in case of 'true'"true""true""true""true".
Default:
'false'
"false"
"false"
"false"
"false"
List of values:
'false'"false""false""false""false", 'true'"true""true""true""true"
NumLevelsNumLevelsNumLevelsnumLevelsnum_levels
(input_control) integer →
HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of the used resolution levels.
Default:
3
Suggested values:
1, 2, 3, 4, 5, 6
RowRowRowrowrow
(output_control) point.y(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Row position of the best match.
ColumnColumnColumncolumncolumn
(output_control) point.x(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Column position of the best match.
AngleAngleAngleangleangle
(output_control) angle.rad(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Rotation angle of pattern.
ErrorErrorErrorerrorerror
(output_control) real(-array) →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Average divergence of the gray values of the
best match.
Result
If the parameter values are correct, the operator best_match_rot_mgbest_match_rot_mgBestMatchRotMgBestMatchRotMgbest_match_rot_mg
returns the value 2 (
H_MSG_TRUE)
.
If the input is empty (no input images are available) the behavior can
be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)
.
If necessary, an exception is raised.
Possible Predecessors
create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotcreate_template_rot
,
set_reference_templateset_reference_templateSetReferenceTemplateSetReferenceTemplateset_reference_template
,
set_offset_templateset_offset_templateSetOffsetTemplateSetOffsetTemplateset_offset_template
,
adapt_templateadapt_templateAdaptTemplateAdaptTemplateadapt_template
,
draw_regiondraw_regionDrawRegionDrawRegiondraw_region
,
draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1draw_rectangle1
,
reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain
Alternatives
best_match_rotbest_match_rotBestMatchRotBestMatchRotbest_match_rot
,
best_match_mgbest_match_mgBestMatchMgBestMatchMgbest_match_mg
,
find_ncc_modelfind_ncc_modelFindNccModelFindNccModelfind_ncc_model
,
find_ncc_modelsfind_ncc_modelsFindNccModelsFindNccModelsfind_ncc_models
See also
fast_matchfast_matchFastMatchFastMatchfast_match
Module
Matching