# Projector masking

Digital masks play an important role in VIOSO. These are commonly referred to as ‘projector masks’ as they are defined per projector (and not per content) .

## 1. Purpose of projector masks

### 1.1. Masks to limit overspill and unwanted covering

Whenever this will affect the stability and quality of the scan, masks should be applied before the scan. Projector masks can also help to optimise the quality of the overall projection after warping.

Example: Masking to avoid overshooting on the floor of a cylindrical panoramic projection:

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2Fwc56hnibUoHPAZM7GQ2E%2Fimage.png?alt=media&#x26;token=a89a0198-a35b-4d47-9378-86192d1e6a84" alt=""><figcaption><p>projection without masking</p></figcaption></figure>

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FNzaAQI9hqMlN3GyVoter%2Fimage.png?alt=media&#x26;token=f4bd5f93-0d01-442a-8800-bbfd4b79e8a4" alt=""><figcaption><p>projection with added digital mask on each projector</p></figcaption></figure>

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FxNlv3f1ALUWLzjEXDA2N%2Fimage.png?alt=media&#x26;token=b1bc6050-2806-4e76-96c0-953f2f33f73a" alt=""><figcaption><p>typical shape of such mask on a single projector</p></figcaption></figure>

### 1.2. Masks for optimising the blending zones (cropping masks)

These masks are created for each projector and are used to limit the blending. In this way, blending lines can be optimised. We call this ‘cropping masks’, which are used in the pre-scan step of the ‘curved screen/dome’ scanning process.

#### 1.2.1. Example: Dome projection without cropping masks

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2F7wk6vP9GgfXObrWhONG4%2FIMG_1773.jpg?alt=media&#x26;token=658f524b-9fe5-40dd-905a-0baad01a231a" alt=""><figcaption><p>native projection</p></figcaption></figure>

Projection with applied cropping masks - the overlapping areas are now more uniform, resulting in a better overall blending quality:

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FA9mT3vO5kKBkOjaqStYq%2FIMG_1772.jpg?alt=media&#x26;token=d0207eb5-0638-4373-92cf-8736c6941dbd" alt=""><figcaption><p>cropping masks applied to uniform the blending regions</p></figcaption></figure>

#### 1.2.2. Creating cropping masks

Masks for use to crop the blending areas are created in the same way as other projection masks. Create the mask using the toolset explained here:  [projector-masking](https://docs.vioso.com/calibration/scanning/projector-masking "mention")

{% hint style="info" %}
Save the mask after creation. You need to access this masks later during the scanning procedure.

{% endhint %}

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2F4gRltcNhWbzN27aeNpsR%2Fimage.png?alt=media&#x26;token=95720b74-32fc-4db8-a422-b3bea86b5a7f" alt=""><figcaption><p>Save each cropping mask for later use</p></figcaption></figure>

#### 1.2.3. Apply cropping masks after each scan

After each projector scan (see [#parameters-explained](https://docs.vioso.com/calibration/scan-result#parameters-explained "mention")), these cropping masks have to be applied to the appropriate projector in this dialog:

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FMNurXt01qJgEc6vTrPeH%2Fimage.png?alt=media&#x26;token=dcf6f515-7cdc-435f-9d78-9f975d43ea6a" alt=""><figcaption><p>After each projector scan, these cropping masks are then applied</p></figcaption></figure>

{% hint style="info" %}
Note: \
Cropping masks can be applied only when running the scans in "curved screen" mode!
{% endhint %}

## 2. Creating Projector Masks

### 2.1. Prior to the scanning

In the calibration settings, check the box "set display calibration mask":

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2F094m53LOp5wYoILLdJjw%2Fimage.png?alt=media&#x26;token=d1cee8fa-0460-4839-a93f-f951f085175e" alt=""><figcaption></figcaption></figure>

After configuring the camera, a dialog to select projectors and masks will show up:

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FI7Ond0zbZdrhoxxfVWyH%2Fimage.png?alt=media&#x26;token=fe40961f-02de-4e0e-ab6b-b06ce1dccbf6" alt=""><figcaption></figcaption></figure>

* Select the projector you want to create a mask. Tick the box "Show display identification" to get the display name printed on the projector when it's marked on the list - this will help you selecting the intended projector.
* Click "create mask" to open the mask creation and editng dialog (see below)
* "Clear mask" will delete any mask that is applied already.
* From file let's you load and apply a mask created as image (bitmap, png) e.g. from an image processing software.&#x20;

### 2.2. On an existing calibration

Whenever a calibration is made, projector masks are available as a post-calibration adjustment. Select the approrpiate target and Activate. The buttons in group "Adjustment" get active. Then choose "Adjust projectors".

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FOqWCMcNqK7l8x5fi3I77%2Fimage.png?alt=media&#x26;token=c9350545-44d7-42d8-91ae-e1d64a814b71" alt=""><figcaption><p>Accessing the projector adjustment dialog </p></figcaption></figure>

In this dialog, select the appropriate projector from the list and choose "new/edit mask".

## 3. Projector masking tools

Whenever new projector masks are created or edited, the mask tool described below is used. It consists of a drawing area (A) and an area that displays mask layers. It is possible to create multiple shapes and thus generate complex masks.

### 3.1. Load/Save

* Save: This saves the mask as XML and PNG into extra files\
  The XML lets you modify the mask anytime while PNG represents the mask as pixel per pixel dataset. PNG masks are required to use a mask for cropping.\
  Masks are saved internally with the whole calibration, but you might consider to save the masks additionally.
* Load: This loads an ediable mask from XML

### 3.2. Adding shapes

Click "+ Poligon" to start drawing a shape. It creates a layer with a rectanle mask, blacked out on the outer border. This is the recommended approach for most masking tasks.

Black parts are covered while white parts let anything through. By adding more shapes, complex masking tasks can be handled easily.

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2F1ClBk1E93rGnIFXQRC9J%2Fimage.png?alt=media&#x26;token=3a25e05b-9ec9-4842-8e30-7016477abf38" alt=""><figcaption></figcaption></figure>

Click "+ Empty"  to add a layer without any pre-defined shape.

#### Tools to draw shapes:

| ![](https://helpdesk.vioso.com/wp-content/uploads/2022/08/arrow-1.png)              | Select drawing point                                         |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| ![](https://helpdesk.vioso.com/wp-content/uploads/2022/08/add_point-1.png)          | Add point to shape                                           |
| ![](https://helpdesk.vioso.com/wp-content/uploads/2022/08/minus_point-1.png)        | Delete point from shape                                      |
| ![](https://helpdesk.vioso.com/wp-content/uploads/2022/08/toggle_cornerstyle-1.png) | Toggle between linear and spline based shape drawing         |
| ![](https://helpdesk.vioso.com/wp-content/uploads/2022/08/insert_form_square-1.png) | Insert rectangle shape (replacing existing shape - careful!) |
| ![](https://helpdesk.vioso.com/wp-content/uploads/2022/08/insert_form_circle-1.png) | Insert round shape (replacing existing shape - careful)      |

### 3.3. Modifying Layer properties

Each shape acts as a layer that are arranged top-down. By modifying the layers, the overall mask output will be processed.&#x20;

#### Tools to modify the layer properdies <a href="#id-2047138396-v1cheu" id="id-2047138396-v1cheu"></a>

<table data-header-hidden><thead><tr><th width="356"></th><th></th></tr></thead><tbody><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FFObLmsG39JCfACxdcTLK%2Fimage.png?alt=media&#x26;token=cadb69d5-1342-47cd-b9f7-d6b52b5dfcc1" alt="" data-size="original"></td><td>Toggle layer visibility</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FCQNQ3VObhVl00JORbKZ9%2Fimage.png?alt=media&#x26;token=803e694e-d9ec-42dd-a4cc-0e88be1a993a" alt="" data-size="original"></td><td>Toggle layer black/white</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FLvgQ7MwOpHoxdBgcBW8h%2Fimage.png?alt=media&#x26;token=c96851d9-1bee-4bd7-9fd3-3954a4b6f01b" alt="" data-size="original"></td><td>Invert layer</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FTvhtbWnI0m68IsyKLOAK%2Fimage.png?alt=media&#x26;token=02cc2537-1296-43b6-a671-40f3b4717493" alt="" data-size="original"></td><td>Delete layer</td></tr></tbody></table>

After all masking tasks are completed, consider to click "Save" to have the mask saved independently from the current calibration, e.g. to share with anohter calibration or use the mask for other purposes (e.g. as cropping mask).
