You are here: Start » FIL.NET » Function Reference » Computer Vision » Image Analysis » FIL.CreateGoldenTemplate2
Create a model to be used with CompareGoldenTemplate2 filter.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void CreateGoldenTemplate2 ( IList<FilNet.Image> inImages, int inDownscale, int inMaxDisplacement, int inLargeDefectSize, int inBrightnessAugmentation, int inNoiseAugmentation, float inSmoothingAugmentationStdDev, FilNet.GoldenTemplate2Model outModel )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImages | System.Collections.Generic.IList<FilNet.Image> | List of input images that has to be uniform in terms of size and format. | ||
![]() | inDownscale | int | <1, INF> | 2 | Shrink the input for processing by dividing by specified value. Reduces sensitivity to minuscule (pixel-size) defects. Greatly improves processing speed. Default value: 2. |
![]() | inMaxDisplacement | int | <0, INF> | 2 | 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. Default value: 2. |
![]() | inLargeDefectSize | int | <0, INF> | 50 | Expected size (diameter) of largest, extensive defects. Default value: 50. |
![]() | inBrightnessAugmentation | int | 0 | Allows for greater (additional to the value inferred from inImages training set) brightness deviation in inspected images. Default value: 0. | |
![]() | inNoiseAugmentation | int | 0 | 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. Default value: 0. | |
![]() | inSmoothingAugmentationStdDev | float | <0.0f, INF> | 0.0f | Allows for greater (additional to the value inferred from inImages training set) image smoothing in inspected images. Uses gaussian smoothing with specified standard deviation. Default value: 0.0f. |
![]() | outModel | FilNet.GoldenTemplate2Model |
Description
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 FabImage 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.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | inImages - inObjectMask dimensions differ in CreateGoldenTemplate2. |
DomainError | inImages array must contain at least 3 different images of the object, 5 is recommended in CreateGoldenTemplate2 |
DomainError | Input image dimensions differ in CreateGoldenTemplate2. |
DomainError | Input image formats differ in CreateGoldenTemplate2. |