You are here: Start » Tutorial Exercises » Edge-based Template Matching: Gasket (ebtm_gasket)

Edge-based Template Matching: Gasket (ebtm_gasket)

Aim

Your task is to create a program which will be able to detect a the position of a gasket.

Input

Images of a gasket having variable location and rotation.

The input images are stored in gasket_inspection directory.

Output

The location of the object.

Hints

This exercise shows the way to find an object in an image using Edge-based Template Matching. To use EbTM please use the LocateSingleObject_Edges filter.

Solution (AVS)

  1. Add the EnumerateImages filter to load consecutive images from a disk directory.

  2. Add the LocateSingleObject_Edges filter and connect it with the input image.

  3. Open a template matching editor on inEdgeModel and select the template region as on the picture below.

  4. Set the range of possible rotations from -20 to +20.

  5. In the next tab mark a reference rectangle as on the image below.

  6. Add the outImage and outObject.Match outputs to a data preview.

  7. Perform several iterations of the program and verify if the results are correct.

  8. Set inSearchRegion as on the picture below to further improve the filter's performance.

  9. Add the inSearchRegion and outObject.Point outputs to the data preview to verify the search region.