set_offset_template
— Gray value offset for template.
set_offset_template
is obsolete and is only provided for
reasons of backward compatibility. New applications should use the
shape-based or NCC-based operators instead.
set_offset_template( : : TemplateID, GrayOffset : )
set_offset_template
adds a gray value offset
to the template to eliminate gray value changes in the image.
The parameter GrayOffset
specifies a difference
relative to the gray values of the pattern when it was
created with create_template
(not relative to the last call of set_offset_template
).
The values of GrayOffset
has to be chosen according
to the gray values of the image: A brighter image results
in a positive value, a darker image results in a negative
value. set_offset_template
has to be called each time
the gray values of the image changes.
The gray values can be measured in a reference area using
intensity
or min_max_gray
This operator modifies the state of the following input parameter:
The value of this parameter may not be shared across multiple threads without external synchronization.
TemplateID
(input_control, state is modified) template →
(handle)
Template number.
GrayOffset
(input_control) number →
(integer)
Offset of gray values.
Default value: 0
Suggested values: -10, -5, -2, -1, 0, 1, 2, 5, 10
Typical range of values: -255
≤
GrayOffset
≤
255
Minimum increment: 1
Recommended increment: 1
If the parameter values are correct, the operator
set_offset_template
returns the value 2 (H_MSG_TRUE).
If necessary, an exception is raised.
create_template
,
adapt_template
,
read_template
best_match
,
best_match_mg
,
best_match_rot
,
fast_match
,
fast_match_mg
Matching