# Camera Masking (Region of interest)

For all types of cameras the procedure to define a Region of Interest by creating a mask is identical. The masking tools are integrated in the camera adjustment dialog

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

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2F5arguX1xhfgqNYmpY7GS%2Fimage.png?alt=media&#x26;token=55d2c5c4-1735-457d-b7cf-19f69d12974b" alt=""><figcaption></figcaption></figure>

### Load/Save <a href="#load-save" id="load-save"></a>

* 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

### Adding shapes <a href="#adding-shapes" id="adding-shapes"></a>

Click "+ Poligon" to start drawing a shape. It creates a layer with a rectangle mask, where the inner part is see-through and the outer part is red. Areas covered by red are excluded from the camera view.

{% hint style="info" %}
The camera mask does not mask projectors, nor does it restrict the projection or influence the screen coverage. This mask is solely to define the area which are taken into consideration during the scan. To limit the projector coverage we use warping and projector masking.
{% endhint %}

<figure><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FKrZ2srpKW98wZSD2m8SG%2Fimage.png?alt=media&#x26;token=27d0e545-1395-4fb8-82be-e7e2db29d54b" alt=""><figcaption></figcaption></figure>

Clicking`+ Empty` to add a layer without any pre-defined shape. +Bitmap loads an image file - typically a black-white image - that is used to define the region of interest (black = see through, white = masked).

**Tools to draw shapes:**

<table data-header-hidden><thead><tr><th width="187"></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%2FgjTm6xmZtaczaKO22YX0%2Fimage.png?alt=media&#x26;token=2254f354-a787-4594-b957-b9ee365fa853" alt="" data-size="original"></td><td>Select drawing point</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FDwoXFlJ7UTfQYuN9a0Nk%2Fimage.png?alt=media&#x26;token=47ab5ea7-196c-458b-8a01-c92aea7c2f9d" alt="" data-size="original"></td><td>Add point to shape</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FvUd59PeIcJe5gEgHCRZL%2Fimage.png?alt=media&#x26;token=6c55a040-f3e9-426e-90f0-9c3cbbddb712" alt="" data-size="original"></td><td>Delete point from shape</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FTFwzOtjOS27pM6san6Re%2Fimage.png?alt=media&#x26;token=9726d332-37d5-4883-913e-d982c56210ed" alt="" data-size="original"></td><td>Toggle between linear and spline based shape drawing</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2Fz0bglJRSvVwf62tSwlZX%2Fimage.png?alt=media&#x26;token=f51ac0d6-624f-48a7-b83d-f9fb2a578b8d" alt="" data-size="original"></td><td>Insert rectangle shape (replacing existing shape - careful!)</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FRyqsf7ja1RNI0hjhzwCe%2Fimage.png?alt=media&#x26;token=521bb0be-627b-4d4e-ab7b-3bf797adc7be" alt="" data-size="original"></td><td>Insert round shape (replacing existing shape - careful)</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2FYSdYqfD16CF6SIMgudFY%2Fimage.png?alt=media&#x26;token=40c1a6d2-f39e-423e-ae10-733a42a1db9a" alt="" data-size="original"></td><td>Display a helper grid</td></tr><tr><td><img src="https://3901153090-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqQOJaA9kiXUCmPo5Lma3%2Fuploads%2F4G4laBESgoUQ5QQp3ExD%2Fimage.png?alt=media&#x26;token=9850dc06-322d-4ea6-8344-8ae3abd325f0" alt="" data-size="original"></td><td>Display a helper crosshair</td></tr></tbody></table>

### Modifying Layer properties <a href="#modifying-layer-properties" id="modifying-layer-properties"></a>

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

**Tools to modify the layer properdies**

<table data-header-hidden><thead><tr><th width="195"></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%2FHNEHjloWDDvYCITXcAhw%2Fimage.png?alt=media&#x26;token=2e30098a-0b96-4f85-98be-5315509fdc29" 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%2FdZ3E481boGTUWM4zgkB4%2Fimage.png?alt=media&#x26;token=8ec02824-2fb6-4d75-9265-ff9bb0ada7cb" 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%2FZvfHNOeVKQOeimsX1oZm%2Fimage.png?alt=media&#x26;token=f8ffc5bf-37a1-4499-bceb-b92ac3b0e075" 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%2FI6Xpsi8VbVT3zLiv8h40%2Fimage.png?alt=media&#x26;token=c21859cd-bae5-493c-8ae1-8465fa37e102" 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.
