Skip to content

Extract ROI

⚠️ Warning

This node is exclusive to the Forxai Mirror project and requires a specific installation for use.

Overview

The Extract ROI (Region of Interest) node creates a polygon around a detected body part. It allows for expanding the region by configurable margins, which is useful for creating stable cropping areas for further analysis.

Use Extract ROI when:

  • You need a bounding area for a specific body part like a face or hand.
  • You want to include some surrounding context around a detection.

💡 Tip

Use this node to generate the polygon needed for a Crop node to zoom in on a specific feature.

Inputs

NameTypeDescription
face_pointslist[point]Points defining the face region (method dependant).
face_polygonpolygonPolygon defining the face region (method dependant).
hand_polygonpolygonPolygon defining the hand region (method dependant).

Input can be dynamically adjusted based on choose configuration Type of Roi in parameters.

Outputs

NameTypeDescription
polygonpolygonThe enlarged region of interest polygon.

Parameters

ParameterDefaultValid valuesTunable
Horizontal Enlarge0.0float
Vertical Enlarge0.0float
Right Enlarge0.0float
Lower Enlarge0.0float
Type of Roiface_maskTypeOfRoi

Horizontal Enlarge

Expands the region to the left and right by the specified factor.

  • Lower values create a tighter horizontal boundary.
  • Higher values provide more side context.

Vertical Enlarge

Expands the region to the top and bottom by the specified factor.

  • Lower values create a tighter vertical boundary.
  • Higher values provide more top and bottom context.

Right_enlarge

Expands the region specifically to the right side by the specified factor.

  • This parameter is used to asymmetrically extend the right boundary of the polygon, for example relative to the hand's width

Lower_enlarge

Expands the region specifically towards the bottom by the specified factor.

  • This parameter controls the downward expansion of the polygon.
  • It allows for extending the ROI further down the arm or wrist area relative to the hand's height.

Type of Roi

Possible methods are: beard, eyes, face_mask, hair, hard_hat, hand_wrist, headwear, neck, sleeve, smock, sleeve_cover, vest

Example

Face ROI extraction

A face is detected, and a region is extracted with extra space on the sides for better visualization.

Configuration:

  • Horizontal Enlarge: 0.2
  • Vertical Enlarge: 0.1
  • Type of Roi: face_mask

Result: A polygon is generated that is 20% wider and 10% taller than the original detection.

Reference: