Herror ::best_match_rot_mg (
Hobject Image,
const HTuple &TemplateID,
const HTuple &AngleStart,
const HTuple &AngleExtend,
const HTuple &MaxError,
const HTuple &SubPixel,
const HTuple &NumLevels,
double *Row,
double *Column,
double *Angle,
double *Error
)
Herror ::best_match_rot_mg (
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
)
double HImage::BestMatchRotMg (
const HTuple &TemplateID,
const HTuple &AngleStart,
const HTuple &AngleExtend,
const HTuple &MaxError,
const HTuple &SubPixel,
const HTuple &NumLevels,
double *Column,
double *Angle,
double *Error
) const
HTuple HImageArray::BestMatchRotMg (
const HTuple &TemplateID,
const HTuple &AngleStart,
const HTuple &AngleExtend,
const HTuple &MaxError,
const HTuple &SubPixel,
const HTuple &NumLevels,
HTuple *Column,
HTuple *Angle,
HTuple *Error
) const
Searching the best matching of a template and a pyramid with rotation.
The operator ::best_match_rot_mg performs a matching of the template
of TemplateID and Image.
It works similar to ::best_match_mg with the extension
that the pattern can be rotated analogously to ::best_match_rot.
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_mg ::best_match_rot_mg
returns the rotion angle of the pattern in Angle (radiant).
The value of MaxError has to set larger compared with
::best_match_rot, because the error is at higher levels
of the pyramid often increased.
In the case of SubPixel = 'true' the position
and the angle are calculated with ``sub pixel'' accuracy.
The value of NumLevels has to equal or smaller than
the value used to create the template.
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: 40 |
|
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: 1
|
SubPixel (input_control)
|
string -> HTuple.char *
|
|
Subpixel accuracy in case of 'true'. |
|
Default value: 'false' |
|
List of values: 'true', 'false' |
NumLevels (input_control)
|
integer -> HTuple.long
|
|
Number of the used resolution levels. |
|
Default value: 3 |
|
List of values: 1, 2, 3, 4, 5, 6 |
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_mg
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,
::set_reference_template,
::set_offset_template,
::adapt_template,
::draw_region,
::draw_rectangle1,
::reduce_domain
Alternatives
::best_match_rot,
::best_match_mg
See also
::fast_match
Module
Gray value template matching
Copyright © 1996-2002 MVTec Software GmbH