fast_match ( Image : Matches : MaxError, TemplateID : )

Searching all good matches of a template and an image.

The operator fast_match performs a matching of the template of TemplateID and Image. Hereby the template will be moved over the points of Image so that the template always lies completely inside of Image. The matching criterion (`"displaced frame difference'") is defined as follows:

              SUMu,v {ABS { Image[i-u][j-v] - Template[l-u][c-v] }}     
error[i][j] = -----------------------------------------------------,
                                AREA ( Template )                     
The runtime of the procedure depends on the size of the domain of Image. Therefore it is important to restrict the domain as far as possible, i.e. to apply the operator only in a very confined "region of interest". The parameter MaxError determines the maximal error which the searched position is allowed to show. The lower this value is, the faster the procedure runs.

All points which show a matching error smaller than MaxError will be returned in the output region Matches.


Parameters

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

Matches (output_object)
region(-array) -> object
All points whose error lies below a certain threshold.

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

TemplateID (input_control)
integer -> integer
Template number.
Default value: 0


Result

If the parameter values are correct, the operator fast_match returns the value 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 is raised.


Possible Predecessors

adapt_template, draw_region, draw_rectangle1, reduce_domain


Alternatives

best_match, fast_mg_match, match__, mg_match__



Copyright © 1996-1997 MVTec Software GmbH