Name
prepare_variation_modelprepare_variation_modelPrepareVariationModelprepare_variation_modelPrepareVariationModelPrepareVariationModel — Prepare a variation model for comparison with an image.
prepare_variation_modelprepare_variation_modelPrepareVariationModelprepare_variation_modelPrepareVariationModelPrepareVariationModel prepares a variation model for the
image comparison with compare_variation_modelcompare_variation_modelCompareVariationModelcompare_variation_modelCompareVariationModelCompareVariationModel or
compare_ext_variation_modelcompare_ext_variation_modelCompareExtVariationModelcompare_ext_variation_modelCompareExtVariationModelCompareExtVariationModel. This is done by converting the
ideal image and the variation image that have been trained with
train_variation_modeltrain_variation_modelTrainVariationModeltrain_variation_modelTrainVariationModelTrainVariationModel into two threshold images and storing
them in the variation model. These threshold images are used in
compare_variation_modelcompare_variation_modelCompareVariationModelcompare_variation_modelCompareVariationModelCompareVariationModel or
compare_ext_variation_modelcompare_ext_variation_modelCompareExtVariationModelcompare_ext_variation_modelCompareExtVariationModelCompareExtVariationModel to speed up the comparison of
the current image to the variation model.
Two thresholds are used to compute the threshold images. The
parameter AbsThresholdAbsThresholdAbsThresholdAbsThresholdAbsThresholdabsThreshold 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
VarThresholdVarThresholdVarThresholdVarThresholdVarThresholdvarThreshold determines a factor relative to the variation
image for the minimum difference of the current image and the ideal
image. AbsThresholdAbsThresholdAbsThresholdAbsThresholdAbsThresholdabsThreshold and VarThresholdVarThresholdVarThresholdVarThresholdVarThresholdvarThreshold 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
variation image,
a{u}=AbsThresholdAbsThresholdAbsThresholdAbsThresholdAbsThresholdabsThreshold[0],
a{l}=AbsThresholdAbsThresholdAbsThresholdAbsThresholdAbsThresholdabsThreshold[1],
b{u}=VarThresholdVarThresholdVarThresholdVarThresholdVarThresholdvarThreshold[0],
and
b{l}=VarThresholdVarThresholdVarThresholdVarThresholdVarThresholdvarThreshold[1]
(or a{u}=AbsThresholdAbsThresholdAbsThresholdAbsThresholdAbsThresholdabsThreshold,
a{l}=AbsThresholdAbsThresholdAbsThresholdAbsThresholdAbsThresholdabsThreshold,
b{u}=VarThresholdVarThresholdVarThresholdVarThresholdVarThresholdvarThreshold, and
b{l}=VarThresholdVarThresholdVarThresholdVarThresholdVarThresholdvarThreshold,
respectively). Then the two threshold images t{u,l}
are computed as follows:
t{u}(x,y) = i(x,y) + max{a{u},b{u}*v(x,y)}
t{l}(x,y) = i(x,y) - max{a{l},b{l}*v(x,y)}
If the current image c(x,y) is compared to the
variation model using compare_variation_modelcompare_variation_modelCompareVariationModelcompare_variation_modelCompareVariationModelCompareVariationModel, the output
region contains all points that differ substantially from the model,
i.e., that fulfill the following condition:
c(x,y) > t{u}(x,y) or c(x,y) < t{l}(x,y) .
In compare_ext_variation_modelcompare_ext_variation_modelCompareExtVariationModelcompare_ext_variation_modelCompareExtVariationModelCompareExtVariationModel, 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
with get_thresh_images_variation_modelget_thresh_images_variation_modelGetThreshImagesVariationModelget_thresh_images_variation_modelGetThreshImagesVariationModelGetThreshImagesVariationModel. Furthermore, the
training data can be deleted with
clear_train_data_variation_modelclear_train_data_variation_modelClearTrainDataVariationModelclear_train_data_variation_modelClearTrainDataVariationModelClearTrainDataVariationModel to save memory.
- Multithreading type: exclusive (runs in parallel only with independent operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
ID of the variation model.
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
Restriction: AbsThreshold >= 0
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
Restriction: VarThreshold >= 0
prepare_variation_modelprepare_variation_modelPrepareVariationModelprepare_variation_modelPrepareVariationModelPrepareVariationModel returns 2 (H_MSG_TRUE) if all parameters are
correct.
train_variation_modeltrain_variation_modelTrainVariationModeltrain_variation_modelTrainVariationModelTrainVariationModel
compare_variation_modelcompare_variation_modelCompareVariationModelcompare_variation_modelCompareVariationModelCompareVariationModel,
compare_ext_variation_modelcompare_ext_variation_modelCompareExtVariationModelcompare_ext_variation_modelCompareExtVariationModelCompareExtVariationModel,
get_thresh_images_variation_modelget_thresh_images_variation_modelGetThreshImagesVariationModelget_thresh_images_variation_modelGetThreshImagesVariationModelGetThreshImagesVariationModel,
clear_train_data_variation_modelclear_train_data_variation_modelClearTrainDataVariationModelclear_train_data_variation_modelClearTrainDataVariationModelClearTrainDataVariationModel,
write_variation_modelwrite_variation_modelWriteVariationModelwrite_variation_modelWriteVariationModelWriteVariationModel
prepare_direct_variation_modelprepare_direct_variation_modelPrepareDirectVariationModelprepare_direct_variation_modelPrepareDirectVariationModelPrepareDirectVariationModel
create_variation_modelcreate_variation_modelCreateVariationModelcreate_variation_modelCreateVariationModelCreateVariationModel
Matching