You are here: Start » Machine Vision Guide » Golden Template
Golden Template
Golden Template technique performs a pixel-to-pixel comparison of two images. This technique is especially useful when the object's surface or object's shape is very complex.
Adaptive Vision Studio offers two way of performing the golden template comparison.
-
Comparison based on pixels intensity - it can be achieved using the AvsFilter_CompareGoldenTemplate_Intensity. In this method two images are compared pixel-by-pixel and the defect is classified based on a difference between pixels intensity. This technique is especially useful in finding defects like smudges, scratches etc.



Golden template Defected object Found defects Example usage of Golden Template technique using the pixels intensity based comparison.
-
Comparison based on objects edges - this method is very useful when defects may occur on the edge of the object and pixel comparison may fail due to different light reflections or the checking the object surface is not necessary. For matching object's edges use the AvsFilter_CompareGoldenTemplate_Edges filter.



Golden template Defected object Found defects Example usage of Golden Template technique using the edges comparison.
How To Use
Golden template is a previously prepared image which is used to compare image from the camera. This robust technique allows us to perform quick comparison inspection but some conditions must be met:
- stable light conditions,
- position of the camera and the object must be still,
- precise object positioning,
- the camera calibration must be performed if non-telecentric lens is used.
Most applications use the Template Matching technique for finding objects and then matched rectangle is compared. Golden template image and image to compare must have this same dimensions. To get best results filter CropImageToRectangle should be used. Please notice that filter CropImageToRectangle performs cropping using a real values and it has sub-pixel precision.
The parameter inStaticModel informs the algorithm that golden template will not change during the execution and it should be analyzed only once, in the first iteration of the filter. If golden template has changed and inStaticModel is set to True the changes in template are ignored. Setting this parameter to False for static template will result in extended computation time.
