prepare_variation_model — Prepare a variation model for comparison with an image.
prepare_variation_model prepares a variation model for the
image comparison with
compare_ext_variation_model. This is done by converting the
ideal image and the variation image that have been trained with
train_variation_model into two threshold images and storing
them in the variation model. These threshold images are used in
compare_ext_variation_model to speed up the comparison of
the current image to the variation model.
Two thresholds are used to compute the threshold images. The
AbsThreshold determines the minimum amount of
gray levels by which the image of the current object must differ
from the image of the ideal object. The parameter
VarThreshold determines a factor relative to the variation
image for the minimum difference of the current image and the ideal
VarThreshold each can
contain one or two values. If two values are specified, different
thresholds can be determined for too bright and too dark pixels. In
this mode, the first value refers to too bright pixels, while the
second value refers to too dark pixels. If one value is specified,
this value refers to both the too bright and too dark pixels. Let
i(x,y) be the ideal image, v(x,y) the
respectively). Then the two threshold images
are computed as follows:
If the current image c(x,y) is compared to the
variation model using
compare_variation_model, the output
region contains all points that differ substantially from the model,
i.e., that fulfill the following condition:
compare_ext_variation_model, extended comparison modes
are available, which return only too bright errors, only too dark
errors, or bright and dark errors as separate regions.
After the threshold images have been created they can be read out
get_thresh_images_variation_model. Furthermore, the
training data can be deleted with
clear_train_data_variation_model to save memory.
This operator modifies the state of the following input parameter:
During execution of this operator, access to the value of this parameter must be synchronized if it is used across multiple threads.
ModelID(input_control, state is modified) variation_model
ID of the variation model.
→(real / integer)
Absolute minimum threshold for the differences between the image and the variation model.
Default value: 10
Suggested values: 0, 5, 10, 15, 20, 30, 40, 50
AbsThreshold >= 0
→(real / integer)
Threshold for the differences based on the variation of the variation model.
Default value: 2
Suggested values: 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5
VarThreshold >= 0
prepare_variation_model returns 2 (H_MSG_TRUE) if all parameters are