You are here: Start » Program Examples » Comparing Golden Template

Comparing Golden Template

Aim

This example shows how to find defects at the end of a blade. Golden Template technique can be used to find even the smallest defect.

Input

Set of images with a single blade.

Output

Image with marked defects on it.

Hints

Best way to find defects is to locate blade using Template Matching and compare the matches using Golden Template technique.

In this case both filters can be used CompareGoldenTemplate_Intensity and CompareGoldenTemplate_Edges. Notice that CompareGoldenTemplate_Edges provides more information about defects.

Solution (Studio)

  1. Add the EnumerateImages filter to load images from the images directory.

  2. Find the position of an object add filter LocateSingleObject_Edges and prepare a template model like on the image below:

  3. Add filter CompareGoldenTemplate_Edges and connect to inImage output of EnumerateImages.

  4. Using the Golden Template Editor select a template on the first image.

  5. Configure the CompareGoldenTemplate_Edges by setting inEdgeThreshold to 35.0 and inEdgeHysteresis to 15.0 and inMaxDistance to 2.0.

  6. Add DilateRegion filter and connect to it data from outDefects to make results more visible.

Macrofilter Main uses the Template Matching and Golden Template techniques to find defects on a blade.

Used Filters

Icon Name Description
CompareGoldenTemplate_Edges Finding general object defects by analyzing missing or excessive edges.
LocateSingleObject_Edges Detection of an object whose outlines are sharp and rigid. Often one of the first filters in a program.
EnumerateImages Emulates image acquisition with images stored on disk.
DilateRegion Making the region thicker or filling-in small holes within it.