Improving the Score of Found Instances by Using "Don't Care Areas"

Setting Search Parameters

Objective

Following this tutorial, you will learn how to use EasyFind to handle "don't care areas" in geometric pattern matching. "Don't care areas" help to define in the image the meaningful features only, by masking the areas that might change from image to image, such as text and numbers.

You'll need first to load a reference image, define an ROI where EasyFind will learn the reference model, and set a rotation tolerance for the expected instances to search for (steps 1-4). Then you're ready to perform automatic detection of instances of the reference model, without using "don't care areas" (step 5). As the matching scores of the found instances are not high enough, you'll define a "don't care area" on the reference model, and restart the detection. The matching scores are slightly better (steps 6-7).

Reference model

    

Found instances and matching scores, without (left) and with (right) using "don't care areas"

Step 1: Loading the reference image

1. From the main menu, click EasyFind, then New EasyFind Tool.
2. Keep the default variable name for the new PatternFinder object, and click OK. The PatternFinder management dialog box is opened.
3. In the Model tab, click the Open icon, and load the image file EasyFind\Solder Pad 1.tif.
4. Keep the default variable name for the new Image object, and click OK.

Step 2: Creating an ROI to define the reference model on the reference image

1. In the image, right-click and select New ROI... item from the 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. Drag the ROI over the reference model and resize it using its handles. Alternatively, enter the following coordinates in the ROI dialog box: 200, 130, 190, 130 for OrgX, OrgY, Width, and Height respectively, and click Close.

Step 3: Learning the reference model

1. In the PatternFinder Model tab, select the ROI object from the source image drop-down list, and click Learn. The reference model is detected.
2. In the PatternFinder Search Field tab, select the Image object from the source image drop-down list. Tick the Draw Features check-box. The model location and feature points are highlighted in the source image.

Step 4: Setting a rotation tolerance

1. In the PatternFinder Allowances tab, set the angle tolerance to 5.0.

Step 5: Detecting instances of the reference model without "don't care areas"

1. In the PatternFinder Search Field tab, set Max Instances to 4, and click Find. The instances matching the reference model are highlighted.
2. Click Results to see the matching score of each found instance. Even though the scores are good, we can still improve them slightly by using a "don't care area" to mask the text appearing in the learned pattern.

Step 6: Defining the "don't care area"

1. In the PatternFinder Don't Care Areas tab, select the Rectangle radio button from the Blacken Inside group.
2. In the ROI defining the reference model, move your mouse pointer on the top-left corner of the text "U9", left-click and drag the don't care area (rectangle with red stripes) to mask out the text.

Step 7: Detecting instances of the reference model with "don't care areas"

1. In the PatternFinder Don't Care Areas tab, click Learn, and then click Find.

The instances matching the reference model are still highlighted, but the text is not found anymore.

2. Click Results to compare the new matching scores.

They are slightly better.