Appearance
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
| Name | Type | Description |
|---|---|---|
| face_points | list[point] | Points defining the face region (method dependant). |
| face_polygon | polygon | Polygon defining the face region (method dependant). |
| hand_polygon | polygon | Polygon defining the hand region (method dependant). |
Input can be dynamically adjusted based on choose configuration Type of Roi in parameters.
Outputs
| Name | Type | Description |
|---|---|---|
| polygon | polygon | The enlarged region of interest polygon. |
Parameters
| Parameter | Default | Valid values | Tunable |
|---|---|---|---|
| Horizontal Enlarge | 0.0 | float | ✅ |
| Vertical Enlarge | 0.0 | float | ✅ |
| Right Enlarge | 0.0 | float | ✅ |
| Lower Enlarge | 0.0 | float | ✅ |
| Type of Roi | face_mask | TypeOfRoi | ✅ |
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.
Related links
Reference:
- Region of Interest — generates ROI from a polygon
- Dynamic ROI — adaptively shifts ROI
- Crop Image — crops an image to a polygon area