Herror ::best_match_pre_mg (
    Hobject ImagePyramid,
    const HTuple &TemplateID,
    const HTuple &MaxError,
    const HTuple &SubPixel,
    const HTuple &NumLevels,
    const HTuple &WhichLevels,
    double *Row,
    double *Column,
    double *Error
)
HTuple HImageArray::BestMatchPreMg (
    const HTuple &TemplateID,
    const HTuple &MaxError,
    const HTuple &SubPixel,
    const HTuple &NumLevels,
    const HTuple &WhichLevels,
    HTuple *Column,
    HTuple *Error
) const

Searching the best grayvalue matches in a pre generated pyramid.

::best_match_pre_mg applies gray value matching using an image pyramid. ::best_match_pre_mg works analogously to ::best_match_mg, but it makes use of pre calculated pyramid which has to be generated beforehand using ::gen_gauss_pyramid. This reduces runtime if more than one match has to be done or the pyramid has be used otherwise. The pyramid has to be generated using the zooming factor 0.5 and the mode 'constant'.


Parameters

ImagePyramid (input_object)
image-array -> Hobject: HImageArray ( byte )
Image pyramid inside of which the pattern has to be found.

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

MaxError (input_control)
real -> HTuple.double
Maximal 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 *
Exactness in subpixels 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

WhichLevels (input_control)
integer -> HTuple.long / char *
Resolution level up to which the method ``best match'' is used.
Default value: 'original'
Suggested values: 'all', 'original', 0, 1, 2, 3, 4, 5, 6

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

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

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


Result

If the parameter values are correct, the operator ::best_match_pre_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

::gen_gauss_pyramid, ::create_template, ::read_template, ::adapt_template, ::draw_region, ::draw_rectangle1, ::reduce_domain, ::set_reference_template


Alternatives

::fast_match, ::fast_match_mg, ::exhaustive_match, ::exhaustive_match_mg


Module

Gray value template matching



Copyright © 1996-2002 MVTec Software GmbH