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 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 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

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.

Example

Example below shows how to use a basic golden template matching.

Example application performs following operations

  1. Finding object location using the Template Matching technique.
  2. Comparing input image with previously prepared golden template.
Previous: Camera Calibration and World Coordinates Next: Deep Learning