You are here: Start » Program Examples » Mounts (Golden Template Edges)

Mounts (Golden Template Edges)

Aim

The task is to detect mounts and divide them into OK/NG parts.

Input

An image of mounts. The position of the objects is variable. Some of the objects are damaged.

Output

The marked mounts divided into OK and NG objects. The defects are also visible.

Hints

Location of object is variable. To find object the Template Matching technique can be used.

To separate OK and NG parts, the GoldenTemplate technique can be used.

Use the ClassifyByPredicate to mark OK and NG items and the DilateRegion to enlarge the missing edges.

Solution (AVS)

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

  2. Add the LocateMultipleObjects_Edges1 to find position of the mounts:

    • Connect its inImage input to the Image
    • In the Edge Model editor mark a correct object, like on the picture below.
    • Label the outObjects.Match as Match, the outObject.Alignment as Alignment and the outObjects.Score as Scores.
  3. Add the CompareGoldenTemplate_Edges to test the objects:

  4. Add the DilateRegion to enlarge the defects edges:

    • Connect its input to the Defects.
    • Set the inRadiusX to 0.
    • Label the output as DefectsStronger.
  5. Add the ClassifyByPredicate to divide objects into OK and NG parts:

Macrofilter Main.

Further Readings

  • Golden Template - Article explaining how Golden Template technique works.