Image ROI

This function block allows users to define a region of interest (ROI) within an image. It utilizes sliders to enable cropping of the input image, providing a focused area for further processing.

📥 Inputs

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

📤 Outputs

Image Any This output returns the cropped region of interest from the input image.

Rectangle The coordinates of the defined ROI, provided in a shape format.

🕹️ Controls

Input Image Size (H, W) This label displays the height and width of the input image for reference.

Width A horizontal slider that allows you to adjust the width of the ROI to be cropped from the input image.

Height A horizontal slider that allows you to adjust the height of the ROI to be cropped from the input image.

🎨 Features

Dynamic ROI Definition Users can interactively define the ROI in the input image by adjusting the sliders to their desired dimensions.

Real-time Feedback As the sizes of the ROI are adjusted, the updated dimensions reflect immediately in the label.

📝 Usage Instructions

  1. Input Image Connection: Connect any image to the Image Any input.

  2. Adjust Width and Height: Use the Width and Height sliders to select the desired ROI dimensions from the input image.

  3. Evaluate: Run the block to see the cropped region as output, along with the rectangle coordinates of the defined area.

📊 Evaluation

Upon execution, this block outputs the cropped image based on the defined ROI set by the sliders.

💡 Tips and Tricks

Sizing the ROI

Make sure to only define the ROI size within the bounds of the original image dimensions to avoid any indexing errors.

Dynamic Range Adjustment

If you modify the image size, consider checking to dynamic range update of the sliders so they always match your current input image dimensions.

Previewing Before Finalizing

For interactive sessions, frequently evaluating the block after adjusting the sliders will help you find the perfect ROI.

🛠️ Troubleshooting

Invalid ROI Size

If you receive an error about the ROI dimensions, verify that the selected width and height fit within the constraints of the input image size.

Output Image Appears Blank

If the output image is blank, ensure that the selected ROI dimensions actually cover an area of the input image that contains visible data; otherwise, adjust the sliders accordingly.

Last updated