Extract Image from Mask List
Description
This operator extracts (or "crops") the region corresponding to each mask from a source image based on one or more input binary masks. You can control the extraction shape, such as using the precise mask contour, using its bounding rectangle, or extracting only the target edges.
Overview
Crops the original image based on mask regions, supporting cropping by polygon, minimum bounding rectangle, or extreme point range, with options to retain only edges or extract inversely.
Scenarios
After obtaining the mask of the target through segmentation or detection algorithms, this operator can be used to extract the image region of each target individually, for example, removing complex background information and displaying only the target image of interest.
Inputs and Outputs
Inputs |
Image: A source image to be extracted. Detection result mask image list: A list of one or more binary mask images. Each mask defines the region to extract from the source image. |
Outputs |
Masked Image List: An image list, where each image in the list is the result of the source image being extracted by the corresponding mask. 2D ROI: A 2x2 ROI list represented as [{min: [min_pixel_row, min_pixel_col], max: [max_pixel_row, max_pixel_col]}]. |
Parameters
Shape Type
Description |
Selects the shape type for image extraction. |
Tuning Instructions |
|
Parameter Range |
Values/Range:
Default: Minimum bounding rectangle |
Bounding Box Scale Ratio
Description |
Controls the scale ratio of the extracted region relative to the original bounding box. |
Tuning Instructions |
|
Parameter Range |
Values/Range: [0.01, 10000.0] Default: 1.0 |
Mask Edge Only
Tuning Instructions |
Used to analyze the contour features of the object. When enabled, the operator only extracts the image region at the mask contour edge, not the entire mask interior. |
Parameter Range |
Values/Range:
Default: False |
Edge Thickness
Tuning Instructions |
Sets the pixel width of the edge contour. The larger the value, the thicker the extracted edge band, containing more pixels. |
Parameter Range |
Values/Range: [1, 50] Default: 1 |
Enable Invert
Tuning Instructions |
Inverts the extraction logic. Disabled means extracting the image region inside the specified shape; enabled can be used to remove identified objects and retain the background. |
Parameter Range |
Default: False |