4.1. Tutorial: Fine tuning the auto-masking


Sometimes auto-masking the images with the default settings results in an unsatisfactory mask. Determining a single threshold for the whole image can require a lot of trial and error. Different thresholds may also be required for different areas of the image.


An interactive auto-masking capability is provided which allows the settings to be varied and the resulting mask displayed in real time. The settings can also be applied to a selected region.

Starting Point

Load one or more photographs of the object (including calibration mat) for masking. Select one of the images by double-clicking the desired thumbnail.

Step 1

Click the ID_AUTOMASK_IMAGE.jpgRegenerate mask button from the Edit Masks toolbar to initialise interactive auto-masking.


If you wish to use colour normalisation so that shadows on the coloured backdrop are ignored then make sure the "Shadows" checkbox is selected before initialising interactive masking.

Step 2

Drag the masking slider to vary the background detection threshold until the desired result is obtained. Move the slider to the right to increase the threshold and create more mask colour or to the left for the opposite effect.


If the mask display updates too slowly as you drag the slider for large images, try changing the mask display mode to Display Mask > Solid Mask menu item. With the slider selected you can also use the cursor keys to change its value by small steps.

Applying the masking settings to all the images.

If by dragging the slider a good result is obtained on the current image, you can now try the same settings for all the images using the ID_MAKE_MASKS.jpgMask all images... button.

The wizard settings will already have been updated so do not edit them.

Step 3

Select or deselect the "Holes" checkbox to allow or disallow holes in the object. If this option is selected then regions that appear similar to the background colour seen inside the object boundary are treated as part of the background mask. Clicking this button will instantly update the mask.

Figure 4.1.1. Example mask without holes option
Figure 4.1.2. Example mask with holes option selected
Step 4

For finer control you can modify the background detection threshold in a rectangular region of the image. Simply click the ID_PAINT_SELECTREGION.jpgregion select button. Then select the desired image region by dragging with the left mouse button.

Figure 4.1.3. Selecting a region

Note: To remove the region selection just click on the image without dragging.

Step 5

Now drag the slider to modify the masking within the currently selected region without affecting the mask elsewhere.

As before the "Holes" checkbox will switch the allow holes option on and off. If you wish to change the colour normalisation setting with the "Shadows" checkbox, you will need to re-initialise the auto-masking using the ID_AUTOMASK_IMAGE.jpgRegenerate mask button.

Figure 4.1.4. Region masked with no holes option