Create a model to be used with CompareGoldenTemplate2 filter.
void avl::CreateGoldenTemplate2 ( const atl::Array<avl::Image>& inImages, const atl::Optional<const avl::Region&>& inObjectMask, int inDownscale, int inMaxDisplacement, int inLargeDefectSize, int inBrightnessAugmentation, int inNoiseAugmentation, float inSmoothingAugmentationStdDev, avl::GoldenTemplate2Model& outModel )
|List of input images that has to be uniform in terms of size and format.
|const Optional<const Region&>&
|Shrink the input for processing by dividing by specified value. Reduces sensitivity to minuscule (pixel-size) defects. Greatly improves processing speed.
|Error in object positioning. If in doubt, it is better to set this value too high. If set too low, subtle defects won't be detected, or no defects may not be detected at all. High values may impair detection of small defects, especially near edges.
|Expected size (diameter) of largest, extensive defects.
|Allows for greater (additional to the value inferred from inImages training set) brightness deviation in inspected images.
|Allows for greater (additional to the value inferred from inImages training set) noise presence in inspected images. Uses a uniform noise with specified distribution width.
|Allows for greater (additional to the value inferred from inImages training set) image smoothing in inspected images. Uses gaussian smoothing with specified standard deviation.
This filter creates a template that can be later used in CompareGoldenTemplate2 filter.
Multiple images (at least 3, however it is recommended to use at least 5) of inspected object are required to properly create the model. Also, the filter expects the object to be positioned precisely. The positioning of inspected object can be achieved in Aurora Vision Studio by using following filter sequence.
Please note, that it is recommended to enable the scale adjustment in EnhanceSingleObjectMatch filter, as all input images for Golden Template model creation need to have the same dimensions.
The CreateGoldenTemplate2 filter also requires an object mask - pixels outside this mask won't be taken into consideration, however when object is visible against an uniform and constant background it is recommended to include some of the background in order to improve defect detection near the object edges.
It is important to set the inMaxDisplacement parameter properly, which describes the object positioning error, in pixels. If it is set too low, subtle defects won't be detected, or no defects may not be detected at all. On the other hand, high values may impair detection of small defects, especially near edges.
The augmentation could be used when it is known that images subjected to inspection will be different in some specific manner from the training image set. Namely, inBrightnessAugmentation is to be used when inspected images could differ in brightness from the training set, inNoiseAugmentation - for noise content difference and inSmoothingAugmentationStdDev - when inspected images could be blurred w.r.t the training set. Note, that it is always better to obtain a representative training set than to use augmentation parameters. Also note, that the overall sensitivity of the defect detection is governed by CompareGoldenTemplate2 filter sensitivity parameters.
List of possible exceptions:
|inImages - inObjectMask dimensions differ in CreateGoldenTemplate2.
|inImages array must contain at least 3 different images of the object, 5 is recommended in CreateGoldenTemplate2
|Input image dimensions differ in CreateGoldenTemplate2.
|Input image formats differ in CreateGoldenTemplate2.
- CompareGoldenTemplate2 – Compares an image with a multi-image model using an ensemble of image features approach.