Aurora Visio Studio TOP » Program Examples » Comparing Golden Template

Comparing Golden Template

目的

This example shows how to find defects on the bottle head. Golden Template technique can be used to find even the smallest defect.

Input

Set of images with a single bottle head.

Output

Image with marked defects on it.

ヒント

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

In this case one should use the CompareGoldenTemplate_Edges filter.

接続のラベル付けについては こちらを参照ください。

Solution (Studio)

  1. In Workspace Explorer open workspace Examples and in Film strip window select CompareTemplate dataset. Drag the Image channel to the ACQUIRE section.

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

    Thanks to using two separated areas in Template Matching, the location is more precise, while model is still tiny.

  3. Add the CompareGoldenTemplate_Edges and connect the inImage to the output of the ReadFilmstrip.

  4. Using the Golden Template Editor, select a template on the first image. Set the EdgeThreshold to 30 and the EdgeHysteresis to 20.

  5. Configure the CompareGoldenTemplate_Edges filter with the same values as in the Golden Template Editor. Set the inEdgeThreshold to 30.0 and the inEdgeHysteresis to 20.

  6. Add the DilateRegion filter and connect it to data from the outDefects to expand defects region and make it more visible.

  7. Connect the dilated region with the inRegions of the DrawRegions_SingleColor to draw defect regions on an output image.

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

使用したフィルタ

アイコン 名前 説明
CompareGoldenTemplate_Edges Finding general object defects by analyzing missing or excessive edges.
LocateSingleObject_Edges1 輪郭がシャープで硬い物体の検出。 多くの場合、プログラムの最初のフィルターの 1 つです。
DrawRegions_SingleColor Draws regions on an image with a single color.
DilateRegion Making the region thicker or filling-in small holes within it.

その他の資料

  • Golden Template - Article explaining how Golden Template technique works.
  • Template Matching - テンプレート マッチング テクニックの最も詳細な説明をしています。