create_template ( Template : : FirstError, NumLevel, Optimize, GreyValues : TemplateID )

Preparing a pattern for template matching.

The operator create_template preprocesses a pattern, which is passed as an image, for the template matching. After the transformation, a number (TemplateID) is assigned to the template for being used in the further process.

If the pattern is no longer used, it has to be free by the operator delete_template in order to deallocate the memory.

Before the template, which is stored independently of the image size, can be applied it has to be adapted to the size of a definite image by using adapt_template.


Parameters

Template (input_object)
image -> object : byte
Input image whose domain will be processed for the pattern matching.

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

NumLevel (input_control)
integer -> integer
Maximal number of pyramid levels.
Default value: 4
List of values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Optimize (input_control)
string -> string
Kind of optimizing.
Default value: 'sort'
List of values: 'none', 'sort'

GreyValues (input_control)
string -> string
Kind of grayvalues.
Default value: 'original'
List of values: 'original', 'gradient', 'sobel'

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


Result

If the number of the template is valid, the operator create_template returns the value TRUE. If necessary an exception will be raised.


Possible Predecessors

draw_region, reduce_domain


Possible Successors

adapt_template, delete_template



Copyright © 1996-1997 MVTec Software GmbH