You are here: Start » Tutorial Exercises » Gray-based Template Matching: Basic (gbtm_basic)

Gray-based Template Matching: Basic (gbtm_basic)

Aim

Your task is to create a simple algorithm which will be able to detect a marker on a printed circuit board.

Input

Images of a printed circuit board at different angles.

The input images are stored in gbtm_basic directory.

Output

An application that detects the marker.

Hints

This exercise shows a way to find an object in an image using Gray-based Template Matching. To use GbTM please use LocateSingleObject_NCC filter.

Solution (AVS)

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

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

  3. Open a template matching editor on inGrayModel and set model parameters as shown in the image below.

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

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

Further Readings