Masks are used in Metashape to specify the areas on the photos which can otherwise be confusing to the program or lead to incorrect reconstruction results. Workflow can be used in Professional and Standard versions.


Editing masks


Recommended masking all irrelevant elements on the source photos (background, accidental foreground, etc.). Masks in Metashape are represented by contours bounding certain image regions. Modification of the current mask is performed in Photo View through adding or subtracting selections.


1. To switch to the Photo View double-click on the corresponding photo in the Workspace or Photo pane. 


2. To create a selection using one of the supported Selection tools (available from the Toolbar or Photo menu). 



When using a magic wand, use Ctrl and Shift respectively to add and remove areas. To reset mask selection on the current photo press Esc key.


3. The selection wouldn't be incorporated in the current mask until it is merged with the mask using Add selection, Subtract selection, Invert selection buttons from the Toolbar



In the project, we selected an object using the Intelligent Scissors and Add selection. To display the mask in Model view click Show mask on the Toolbar

To see which image masks are created, you can also click on the Show mask in the Photo pane.  



Masked areas could be ignored at Align Photos processing stage (set Apply masks to option in Align Photos dialog) and are always ignored at Build Model and Build Texture stages.


Saving masks


The created mask can be also saved for external editing or storage.


1. Select Export Masks... command from the File menu.


2. In the Export Mask dialog select suitable parameters. Click OK button when done.

File type - specifies the type of generated files:

  • Single channel mask image - generates single channel black and white mask images
  • Image with alpha channel - generates color images from source photos combined with mask data in alpha channel

Filename template - specifies the file name template used to generate mask file names. This template can contain special tokens, that will be substituted by corresponding data for each photo being processed. The following tokens are supported:

    {filename} - file name of the source photo without extension

    {fileext} - extension of the source photo

    {camera} - camera label

    {frame} - frame number

    {filenum} - sequential number of the mask being exported


3. Browse to the folder where the masks should be saved and select it.


4. The progress dialog box will appear displaying the current processing status. To cancel processing click Cancel button. 


When importing/exporting mask for the current photo only, Metashape will prompt for the actual image instead of image folder. Mask file names parameter will not be used in this case. 


Loading masks


Masks can be loaded from external sources, as well as generated automatically from background images if such data is available. Metashape supports loading masks from the following sources:

  • from alpha channel of the source photos;
  • from separate images;
  • generated from background photos based on background difference technique ;
  • based on reconstructed 3D model.

1. Select Import Masks... command from the File menu.


2. In the Import Mask dialog select suitable parameters. Click OK button when done.

Method - specifies the source of the mask data. 

Operation - specifies the action to be done in case a second mask is imported for the photo.

Filename template - specifies the file name template used to generate mask file names. This template can contain special tokens, that will be substituted by corresponding data for each photo being processed. The following tokens are supported:

    {filename} - file name of the source photo without extension.

    {fileext} - extension of the source photo.

    {camera} - camera label.

    {frame} - frame number.

    {filenum} - sequential number of the mask being imported

Tolerance (from Background method only) - specifies the tolerance threshold used for background differencing. Tolerance value should be set according to the color separation between foreground and background pixels. For large separation higher tolerance values can be used.


3. When generating masks from separate or background images, the folder selection dialog will appear. Browse to the folder containing corresponding images and select it. 


4. The progress dialog box will appear displaying the current processing status. To cancel processing click Cancel button.