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

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

The operator best_match_rot performs a matching of the template of TemplateID and Image. It works similar to best_match with the extension that the pattern can be rotated. The parameters AngleStart and AngleExtend define the maximum rotation of the pattern: AngleStart specifies the maximum counter clockwise rotation and AngleExtend 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_rot). In addition to best_match best_match_rot returns the rotion angle of the pattern in Angle (radiant). The accuracy of this angle depends on the parameter AngleStep of create_template_rot. In the case of SubPixel = 'true' the position and the angle are calculated with ``sub pixel'' accuracy.


Parameters

Image (input_object)
image(-array) -> object : byte
Input image inside of which the pattern has to be found.

TemplateID (input_control)
template -> integer
Template number.

AngleStart (input_control)
angle.rad -> real
Smallest Rotation auf the pattern.
Default value: -0.39
Suggested values: -3.14, -1.57, -0.79, -0.39, -0.20, 0.0

AngleExtend (input_control)
angle.rad -> real
Maximum positive Extention of AngleStart.
Default value: 0.79
Suggested values: 6.28, 3.14, 1.57, 0.79, 0.39
Restriction: AngleExtend > 0

MaxError (input_control)
real -> real
Maximum average difference of the grayvalues.
Default value: 30
Suggested values: 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 15, 17, 20, 30, 40, 50, 60, 70
Typical range of values: 0 <= MaxError <= 255
Minimum increment: 1
Recommended increment: 3

SubPixel (input_control)
string -> string
Subpixel accuracy in case of 'true'.
Default value: 'false'
List of values: 'true', 'false'

Row (output_control)
point.y(-array) -> real
Row position of the best match.

Column (output_control)
point.x(-array) -> real
Column position of the best match.

Angle (output_control)
angle.rad(-array) -> real
Rotation angle of pattern.

Error (output_control)
real(-array) -> real
Average divergence of the grayvalues of the best match.


Result

If the parameter values are correct, the operator best_match_rot 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>). If necessary, an exception handling is raised.


Parallelization Information

best_match_rot is reentrant and automatically parallelized (on tuple level).


Possible Predecessors

create_template_rot, read_template, set_offset_template, set_reference_template, adapt_template, draw_region, draw_rectangle1, reduce_domain


Alternatives

best_match_rot_mg


See also

best_match, best_match_mg


Module

Template matching



Copyright © 1996-2005 MVTec Software GmbH