> For the complete documentation index, see [llms.txt](https://nx.docs.scailable.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nx.docs.scailable.net/nx-ai-manager-v6.1.1/nx-ai-manager/configure-the-plugin/input-masks-and-roi.md).

# Input masks and ROI

The inclusion and exclusion areas add a mask over the image that is sent to the AI Manager, the Region of Interest (ROI) removes all information outside the designated region and sends only the information inside the rectangle to the AI Manager.

### Inclusion area

For the inclusion area results that are within the designated polygon will be detected in the inclusion results.&#x20;

{% columns %}
{% column %}
![](https://networkoptix.zendesk.com/attachments/token/q9G7xp2IMw9poDHTZMlYyGAV2/?name=inclusion+area.png)
{% endcolumn %}

{% column %}
![](https://networkoptix.zendesk.com/attachments/token/LWzYDefIq1GvnOaRECRWerEzc/?name=inclusion+results.png)
{% endcolumn %}
{% endcolumns %}

In practice the results will overlap the borders of the polygon a little bit because the middle of the bottom of the detection box is taken as the anchor location for the detected object.&#x20;

{% hint style="info" %}
The center of the bottom of the bounding box is chosen for the anchor location because that is usually a good indication for where a person or object is standing on the ground. In a line-crossing scenario for example, this would make it easier to detect if a person crosses a certain line.
{% endhint %}

### Exclusion area

The same works for the exclusion area - here only objects that have the anchor location outside of the area will be returned.&#x20;

{% columns %}
{% column %}
![](https://networkoptix.zendesk.com/attachments/token/6LjHE11WpF0uGmpEeTKGn3N5O/?name=exclusion+area.png)
{% endcolumn %}

{% column %}
![](https://networkoptix.zendesk.com/attachments/token/nrExKnv9G7JgeXHOkRuhp62r5/?name=exclusion+results.png)
{% endcolumn %}
{% endcolumns %}

### Region of Interest (ROI)

The region of interest defines a square region of the image that will be sent to the AI Manager - the parts outside of the region will not be seen by the model.

{% columns %}
{% column %}

<div align="left"><img src="https://networkoptix.zendesk.com/attachments/token/IVhmTVRZGGxI5KAtapOcZ3Dl3/?name=roi+area.png" alt="" width="375"></div>
{% endcolumn %}

{% column %} <img src="https://networkoptix.zendesk.com/attachments/token/HGdjMnEMGJczucUFIKXybm9mk/?name=roi+results.png" alt="" width="375">
{% endcolumn %}
{% endcolumns %}

This also means that the image can not be another shape than a rectangle, and you may need to change the model resizing method to letterbox for the models to work correctly.

<img src="https://networkoptix.zendesk.com/attachments/token/MCCUqVZiUCvdtdNFwz6jPxSPE/?name=model+resizing+method.png" alt="" width="375">

{% hint style="warning" %}
Note that using masks and region of interest at the same time is not supported.
{% endhint %}

### Custom external processing

If this behavior is not the desired behavior, is possible to create your own preprocessor to create a mask or postprocessor to exclude results from an area that you designate.

For more information on custom preprocessors and postprocessors you can checkout the examples in our GitHub repository&#x20;

{% embed url="<https://github.com/scailable/sclbl-integration-sdk>" %}

&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nx.docs.scailable.net/nx-ai-manager-v6.1.1/nx-ai-manager/configure-the-plugin/input-masks-and-roi.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
