Masking images

Various options allow or require a mask file. The mask file can be used, for example, to restrict a transforms colour changes to the facial area, or is needed for building active appearance models. Mask files work with template files, the particular locations of lines and points is supplied by the template, and the indices of points and lines which form the masking polygon are supplied in the mask file.

Creating a mask

To create a mask you first need to load an image with a template of the type you would like to use the mask with into the Transform window. From the Delineate menu select "Add to mask" and from the View menu select "Display Mask". Now click on lines or points to add them to the mask. Left clicking on lines will follow them from start to end, right clicking on lines will follow them from end to start. If you decide you have added a line in the "wrong" direction, select "undo" from the Delineate menu and try again. When you are happy with your mask save it using "Save mask" from the file menu.

Using masks

Masks can be used in a number of features, a few of these are listed here:

  • For obscuring parts of an image Edit->Apply Mask. You are prompted for a colour to draw, if the mask should be inverted (i.e. usually points inside the polygon are drawn, but this can be reversed), and how much to smooth the mask.
  • When transforming select Transform Options -> Mask Colour. Only areas inside the mask polygon are altered in terms of colour and texture. The Match Colour option also uses a mask and attempts to normalise the colours of the averages to the subject (mean and standard deviation) within the masked region.
  • Constructing PCA models of appearance, including when constructing AAMs for tracking. When building PCA models from images the mask can be used to restrict the operations to the face area (for example when calculating the dot products between images). There are options to mask the input images (before calculating the covariance matrix and the eigen analysis of it) and masking the output images (before reconstructing the image component.
Last modified 11 years ago Last modified on 05/04/11 14:39:58