Image ROI

Description

This operator extracts one or more specified rectangular ROIs from the input image. It provides two main operation modes: one is to directly crop the ROI area to generate a smaller new image; the other is to keep the original image dimensions unchanged and fill the area outside (or inside) the ROI with black pixels.

Overview

Crops or masks input images using one or more 2D ROIs.

Scenarios

  • Suitable for scenarios where only specific parts of the image need to be analyzed. This operator can be used first to extract the region, reducing unnecessary calculation load and improving processing efficiency.

  • By selecting the main object, irrelevant background or distractors in the image can be effectively removed, simplifying the data volume for subsequent processing.

  • Combined with the "Enable Invert" function, a certain area in the image can be "blacked out", allowing subsequent calculations to ignore these areas.

Inputs and Outputs

Inputs

Input Image: One or a set of images to be ROI processed.

2D ROI: One or more 2D rectangular boxes used to define the regions to be extracted.

Outputs

ROI image: The list of images output after ROI processing.

Parameters

Keep Original Shape

Description

Controls whether the output retains the input image dimensions.

Tuning Instructions

When enabled, output dimensions match the input and excluded areas are zeroed; when disabled, only the ROI crop is returned.

Parameter Range

Default: False

Enable Invert

Description

Controls whether the inside or outside of the ROI is blacked out when dimensions are retained.

Tuning Instructions

Used only when Keep Original Shape is enabled; enabling it zeros the inside of the ROI.

Parameter Range

Default: False