Get ROI

This function block extracts a region of interest (ROI) from a given image based on specified rectangle coordinates. It allows users to isolate significant parts of an image for further analysis or processing.

📥 Inputs

Image Any The input image from which you want to extract a region of interest.

Rectangle The coordinates defining the rectangle for the region of interest. It should specify two points in the format [(x1, y1), (x2, y2)].

📤 Outputs

Image Any The output image containing only the extracted region of interest.

🎨 Features

Flexible ROI Definition Users can specify any rectangular ROI by providing the coordinates.

Boundary Handling Automatically adjusts the coordinates to ensure they stay within the image dimensions to prevent errors.

📝 Usage Instructions

  1. Input Image: Connect the image you wish to extract a region from to the Image Any input.

  2. Define Rectangle: Set the coordinates for the rectangle in which you want to extract the ROI. These coordinates must be specified in the format [(x1, y1), (x2, y2)].

  3. Evaluate: Once configured, run the block to extract the designated ROI.

📊 Evaluation

Upon evaluation, this function block outputs the specified region from the input image based on the rectangle coordinates provided.

💡 Tips and Tricks

Defining Accurate Coordinates

Make sure to define the coordinates accurately for the desired region. If unsure, use the Get Pixel function block to obtain correct coordinates.

Using with Other Blocks

You can connect the output from this block to any image processing blocks like Image ROI Select Multi or Blur to further process the extracted ROI.

Boundary Consideration

If the output image does not appear as expected, ensure that the specified rectangle does not exceed the input image dimensions.

🛠️ Troubleshooting

ROI Extraction Errors

If you encounter issues with the ROI extraction, double-check the rectangle coordinates and make sure they fit within the bounds of the input image.

Empty ROI Output

If the output is empty, verify the coordinates provided to ensure they are valid and correspond to a region that exists within the input image.

Last updated