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 HTuple &TemplateID,
    const HTuple &AngleStart,
    const HTuple &AngleExtend,
    const HTuple &MaxError,
    const HTuple &SubPixel,
    double *Column,
    double *Angle,
    double *Error
) const
HTuple HImageArray::BestMatchRot (
    const HTuple &TemplateID,
    const HTuple &AngleStart,
    const HTuple &AngleExtend,
    const HTuple &MaxError,
    const HTuple &SubPixel,
    HTuple *Column,
    HTuple *Angle,
    HTuple *Error
) const

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) -> Hobject: HImage(Array) ( byte )
Input image inside of which the pattern has to be found.

TemplateID (input_control)
template -> HTuple.long
Template number.

AngleStart (input_control)
angle.rad -> HTuple.double
Smalltest 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 -> HTuple.double
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 -> HTuple.double
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 -> HTuple.char *
Subpixel accuracy in case of 'true'.
Default value: 'false'
List of values: 'true', 'false'

Row (output_control)
point.y(-array) -> (HTuple.) double *
Row position of the best match.

Column (output_control)
point.x(-array) -> (HTuple.) double *
Column position of the best match.

Angle (output_control)
angle.rad(-array) -> (HTuple.) double *
Rotation angle of pattern.

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


Result

If the parameter values are correct, the operator ::best_match_rot returns the value 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.


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

Gray value template matching



Copyright © 1996-2002 MVTec Software GmbH