2.3. Masking the images

After adding images to the project, the next step in 3DSOM Pro is to mask the images. Masking the images refers to the process of marking the background around the object, so that 3DSOM Pro knows where the object is within the images. This section of the User Guide explains how to automatically mask images within 3DSOM Pro and how to work with masked images.

The Edit Masks Window section explains how to use 3DSOM Pro to manually edit a single mask. The Creating or editing masks in an external application tutorial shows how you can use your usual image editing software to edit the masks externally.

TIP:

It can be useful to save masks associated with a set of images in order to use them in another 3DSOM Project. Use the Masking > Save Masks... menu item to do this. Each mask is saved using the same filename as the corresponding image (but with a different file extension). This means they can be easily loaded back into a new project.

Step 1

If you want to automatically mask all the images (or all the unmasked images), press the ID_MAKE_MASKS.jpgMask all images... button to launch the Mask Wizard to guide you through the automasking process.

If you just want to apply automasking to a selection of the images, you can use the Masking > Mask Images... menu item. This opens the same Mask Wizard as before but only affects the masks of the selected images.

To try this out, follow the instructions in the Creating a 3DSOM Pro Project section to create a new project from the images in the Examples/doll directory included with your installation.

Step 2

Before the masking operation starts, you will get the chance to modify the parameters used.

If you want to discard all the existing masks on your images then select the "Replace any existing masks" option. Unselect this option if some images have had their masks manually edited to prevent 3DSOM Pro from over-writing the edits.

You should select the "Use colour normalisation" option if you used a coloured backdrop and have shadows or other slight variations of lighting on the backdrop in the images. This will attempt to compensate for the shadows and avoid treating them as part of the object.

The "Background detection threshold" field lets you change the threshold that is used to separate the foreground from the background. You should only change this from the default value if you have problems generating the masks (see below).

The Preview button can be used to interactively preview the result on the currently selected image. Once you clicked the button, use the slider to interactively vary the threshold. You can also switch preview image by double-clicking a thumbnail.

Step 3

Hit the Next > button to start the masking process.

TIP:

If you have an image loaded into the Edit Masks Window while you are performing automasking you will see each image displayed as it is masked.

Step 4

Check through the masks by looking at the thumbnails in the Thumbnail Window or loading them into the Edit Masks Window by double-clicking on the thumbnail.

It is important that none of the object is covered by the masked area in any of the images, otherwise some of the object will be carved away when you create the wireframe geometry. It is less important that all of the background is masked, since 3DSOM Pro will often be able to use information from other images to define the shape of the object.

Figure 2.3.1. This mask is OK as long as the shape of the base of the object is masked clearly in another image.
Figure 2.3.2. This mask must be altered, otherwise the model on the right will be created.
Figure 2.3.3. The model generated from the overmasked image showing the hole cut through it.
TIP:

The automatic masking requires a good contrast between the background and object; a good choice of background colour will result in much better automatic masking. Lighting can also affect the results of automatic masking.

If you are not happy with your masks, click < Back button to return to the Mask Generation Window and try changing the parameter values. If areas of the background are consistently not being masked then increase the "Background detection threshold". If regions of the object are being incorrectly masked then reduce this number.

TIP:

You can use interactive masking on an representative mask to help you pick a threshold value then apply it to all the other images as described in the Fine tuning the auto-masking tutorial.

Step 5

When you are finished, click the Finish button to close the Mask Wizard.

In some cases the automatic masking of an image may not be perfect; but this is not a problem as the masked images can be improved individually as explained in the Fine tuning the auto-masking and Manual masking with the shrink-wrap tool tutorials.