3.4. Reference: The Edit Masks Window

This section describes the tools available for examining and editing the mask associated with each image in the project. Please read the Intermediate Tutorials section to understand when and why you might want to do this and hints and tips for using the tools effectively.

Figure 3.4.1. The Edit Masks toolbar and Edit Masks Window.

All the tools available from the Edit Masks toolbar can also be accessed from the Main Menu > Mask Tools menu except for the interactive masking slider. This menu can be accessed either from the main menubar when the Edit Masks Window is active or by right-clicking in the Edit Masks Window.

3.4.1. Viewing the image

To load a mask into this window, you can either drag and drop a thumbnail from the Thumbnail Window, double-click on a thumbnail in the Thumbnail Window or select an image and choose Images > Edit Mask menu item.

The mask is displayed semi-transparently over the top of the colour image. The masked region defines the parts of this view that are definitely not part of the object (in other words the background). It is important not to over-mask the object, but it does not necessarily matter if you do not mask all of the background.

You can change how the mask is displayed from the Mask Tools > Display Mask menu. You can change the colour used to display the mask so that it shows up well against your images from The 3DSOM Pro Settings Window.

With the ID_ZOOM_IN.jpgZoom in button or ID_ZOOM_OUT.jpgZoom out button selected, you can zoom into or out from the image by a single click of the left mouse button. Alternatively, you can select the zoom value from the drop down menu or the Mask Tools > Zoom to... menu.

When you are zoomed into the image, you can scroll around freely in two dimensions by selecting the ID_PAN.jpgPan image button. Alternatively, you can use the scrollbars around the window to scroll vertically or horizontally.

TIP:

As a shortcut, holding down the SPACE key temporarily switches to the Pan tool and releasing it returns you to your previous tool.

The ID_ZOOM_FIT.jpgZoom to fit button changes the magnification and pans so that the whole unmasked region fits within the window.

3.4.2. Undoing Mask Changes

A short undo history is kept for all changes to the masks for each image. You can only undo changes to the image that is currently displayed in the Edit Masks Window, but the history is kept separately for each image, even while you have a different image displayed in the Edit Masks Window. Even changes made from the Mask Wizard can be undone. This can be particularly useful for seeing whether automatic masking with different parameters has made an improvement or not. Note that this undo information is not saved in the project file.

Use the ID_EDIT_UNDO.jpgUndo model or mask change button in the main toolbar to return to the previous mask for the image and ID_EDIT_REDO.jpgRedo model or mask change button to re-apply the change.

3.4.3. Automatic Masking Tools

The automatic masking tools in the Edit Masks Window enable you to perform automatic masking interactively, allowing you to adjust the parameters to improve the mask and to apply the tools to selected regions of the image only. See the Fine tuning the auto-masking and Using the Magic Highlighter masking tool tutorials for a description of how to use these tools effectively.

The ID_MAGIC_MARKER.jpgMagic highlighter mode button switches to a new quick masking mode based on using a "highlighter" to draw around the edge of the object and allowing 3DSOM Pro to automatically refine the shape. A popup palette of tools is displayed whilst in this mode. See Using the Magic Highlighter masking tool for details.

The ID_AUTOMASK_IMAGE.jpgRegenerate mask button sets up interactive masking for the current image. After this has been run, the threshold for the image can be varied interactively by adjusting the slider that appears in the toolbar below this button. Changing the slider also adjusts the threshold that will be used for masking further images automatically through the Mask Wizard.

The ID_SHRINKWRAP.jpgShrink-wrap Mask button sets up an alternative interactive masking technique. Unlike Regenerate mask this technique uses the current mask as a starting point and then shrinks the unmasked region down. Again, moving the slider adjusts how far the unmasked regions are shrunk.

The ID_UNMASK_IMAGE.jpgUnmask image button is a quick way of deleting the entire mask for the image.

The ID_CLEANMASK.jpgClean Mask button is only available once some geometry has been generated. Clicking on it uses the shape of the current model to clean up the mask so that all parts of the image that fall outside the model when viewed from this viewpoint are masked out. It can also be used for generating an initial mask for new images as utilised in Advanced Masking for a large set of images.

The "Shadows" option toggles whether colour normalisation is used by the automatic masking algorithms to attempt to compensate for shadows on the backdrop.

If the "Holes" option is selected, the automatic masking tools may create isolated patches of mask. If your object is made of a single structure without any holes, it is worth keeping this option deselected to avoid holes being made in the mask.

3.4.4. Manual Masking Tools

The manual masking tools allow you to modify the mask by hand. We recommend that you avoid doing this by using the automatic masking tools wherever possible. The Creating or editing masks in an external application tutorial explains how to use your favourite third party image editing software to perform masking.

Each tool can be used either with the ID_PAINT_MASK.jpgPaint mask button selected to add to the masked region or with the ID_UNPAINT_MASK.jpgUnpaint mask button selected to add to the unmasked region.

TIP:

While using any of the manual masking tools, you can temporarily switch between Mask and Unmask by pressing and holding the Ctrl key.

There are two brush tools for freehand painting. Click on either the ID_PAINT_ROUND_BRUSH.jpgRound Brush button or the ID_PAINT_SQUARE_BRUSH.jpgSquare Brush button to select them. The size of the brush is adjusted using the slider above these tools. The cursor changes to show the shape and size of the brush (except when zoomed right in).

TIP:

You can also use the < and > keys to change the brush size in large steps or the , and . keys to change the brush size in single pixel steps.

Note: If you are zoomed in, as you paint near the edge of the window, the window will automatically scroll to keep the brush visible. If you don't like this behaviour or it is too slow on your graphics card, you can switch it off by deselecting the "Automatically scroll canvas when painting" option from the 3DSOM Pro Settings Window.

The ID_FILLMASK.jpgFill mask button selects a simple fill tool. Clicking on a region of unmasked pixels will mask them (or vice versa depending on the current painting mode). If you have constructed a polygon or curve outline, the fill region will be contained within the outline.

The ID_POLYGON_SELECT.jpgOutline polygon button switches to a polygon drawing mode. Click once on each vertex of the polygon you want to fill in turn and then double-click on the last vertex to close the polygon. As you click each vertex, you can drag the vertex around to adjust the position of the line before releasing the mouse button at the chosen position. In this mode you can use the undo CTRL Z and redo CTRL Y shortcuts to undo or redo the last polygon vertex. Once the polygon is closed, use the left and right arrow keys to select the previous or next polygon and the Delete key to delete the selected polygon. Once you have defined a polygon you can use the fill tool to paint or unpaint the mask inside the polygon.

The ID_POLYCURVE_SELECT.jpgOutline curve button switches to an interactive curve drawing mode. Click once on each boundary point to be interpolated with a smooth curve — if your point selections can not be smoothly interpolated a sharp corner is inserted. By default the curve will be attracted to edges in the current image — you can toggle this behaviour using the Polygons > Snap curves menu item from the right-mouse menu. Close the curve by double-clicking or clicking on the starting point. Hit CTRL key to insert a sharp corner (i.e. Outline polygon mode). As for the Outline polygon mode you can undo, redo, delete and select the next or previous curve or polygon. Once you have defined a curve it can be used in conjunction with the fill tool.