Learning a Pattern According to an ROI

Pattern Learning

Objective

Following this tutorial, you will learn how to use EasyMatch to learn a model from an ROI in a source image, and to perform pattern matching on the same image.

You'll need first to load the source image, and define an ROI inside (steps 1-2). Then, you'll have to learn the model, using this ROI (step 3). Finally, you'll perform pattern matching in the source image (step 4), and will find additional occurrences of the model.

ROI that will be learned

Occurrences matching the model ROI

Step 1: Load the source image

1. From the main menu, click Image, then Open.
2. Load the image file EasyMatch\BOARD.JPG.
3. Keep the default variable name for the new image object, and click OK.

Step 2: Define an ROI

1. Right-click in the image, and select New ROI... from the contextual menu.
2. Keep the default variable name for the new ROI object, and click OK. A default ROI is placed over the image (blue rectangle with handles).

The ROI management dialog box is opened.

3. Resize the ROI and move it around one of the blue capacitors at the lower left part of the image.

Step 3: Learn a model from the ROI

1. From the main menu, click EasyMatch, then New Match Tool.
2. Keep the default variable name for the new matcher object, and click OK.
3. In the Learning tab of the matcher dialog box, select the ROI object from the Source Image drop-down list, and click Learn to acquire the model pattern.

Step 4: Match the pattern

1. In the Matching tab, increase the Max Occurrences field to 2.
2. Select the image object from the Source Image drop-down list.
3. Click Execute. The occurrences of the learned model are highlighted in the source image.
4. Further information about each occurrence can be found by clicking Results.
5. Click in a row to see the corresponding occurrence highlighted in the image.