__header__

Description

The template tool will allow the user to train Automation Manager to comparing an image to a predefined image (what we will call the template). 

Each "Template" is correlated against the trained feature. The correlation score returns the readability, i.e. a percentage where 100% represents a perfectly readable feature. Template matching looks for any print defects, the total defect area, and the largest defect area. Methodology Template matching is the process of comparing a trained image to the current sample image and analyzing the error produced. During the train, the mean, variation, and threshold images are produced. During the Run, the error image is produced.>

To begin drag this tool onto a program and select it.  When the tool is selected in the program an ROI box is displayed in the viewer window. This is the train and search ROI.

To Edit the tool right-click the tool and select Edit. The Edit pages are explained below.

Template Parameters

Train Settings--
When training the template, we are creating the threshold image. The threshold image is comprised of the variation image.
Where: Threshold = Offset (0-255) + Variation Constant /10 * Variation Image

Offset( threshold): The maximum constant noise allowed in judging a character in greylevels (0-255)

Variation Constant: Constant by which to multiply the variation image. The constant is divided by 10.

Method: Variation, Thin Edge, Thick Edge
The Variation Image can be calculated by one of 3 methods:

Variation - The Variation Image is the difference between the brightest pixels and the darkest pixels. This method requires statistical training where, in the set of images captured, the greatest variation is sorted.

Thin Edge -Uses edge detection to determine the edge pixels. These edge pixels form the variation image; thus, the edges are assumed to be the areas with the greatest tolerance for print defects.

Thick Edge -Uses thick edge detection to determine the "variation" image. This is like the thin edge method except with a greater tolerance for print defect on the edges.

NOTE: Edge Variation Image does not require multiple images for the training set. A single image is used to calculate the variation image.

Run Settings--
When running the template, we are creating the error image. The error image is calculated as:
Error = Absolute(sample – mean) - Threshold

Normalization: Off, On, On Non-Destructive
Normalization is the process by which the current sample image brightness is adjusted to the trained image brightness. Hence, this allows compensation for differing light levels and for the setting.
Off: No normalization is carried out
On (Destructive): The current sample image is adjusted so that its intensities match the trained sample. The current sample image pixel data is modified.
On Non Destructive: The current sample image is copied before it is adjusted. All further analysis is carried out on the copied modified sample image.

Minimum Defect Level (Noise)
Defects smaller than this defined size (in pixels) are ignored.

Image Display--
As a utility to the operator this shows the different images in the trained template. Displayed can be the
Mean: The mean image
Minimum: The darkest pixels in the training set
Maximum: The brightest pixel in the training set
Variation: The Variation Image
Threshold: The threshold Image
Error: The Calculated Error Image

Correlation Parameters

Correlation Method
Off
At Trained Position:
The current search is carried out at the trained position
At Current ROI Position: The current search is carried out at the current ROI defined position

Pad Size X/Pad Size Y
The added "pad size" to the trained ROI in pixels that defines the ROI used to locate the feature in question

Sub Sample X/Sub Sample Y
The correlation does a low pass search for the model. This low pass search is done before a high pass search is done. The low pass search speeds up the execution time to find the model.

Retrain
Retrains the Low Pass model only. The Train button programs the low pass and high pass model. This is useful when adjusting the Sub Sample X and Y factors and when the image under the current ROI is not used. Hence, retraining is independent on the current ROI position.

Image Display - Model, Model Low Resolution., Result Image
Displays the selected image.
- The model is the image of feature being sorted.
- The Low Resolution model shows how the model looks in low resolution mode.
- Result image shows the results of the correlation. This shows while spots.

Results

Score
The correlation score. 100% is a perfect match

Total Defect Area
The total defect area. These are returned in image units

Largest Defect Area
The Largest Defect Area

__footer__