Rectangles in Rectangle

This function block checks if specified rectangles are within a reference rectangle and highlights the outcomes visually on the input image.

πŸ“₯ Inputs

Input Image The original image where the rectangles are to be analyzed.

Rectangle The reference rectangle used as a boundary to check if the provided rectangles lie within it.

Rectangles Multiple rectangles that need to be checked against the reference rectangle.

πŸ“€ Outputs

Result The output image showing the reference rectangle and the checked rectangles with color coding based on whether they lie within the reference.

Not Empty A boolean output indicating if any of the specified rectangles are within the reference rectangle.

Count The number of rectangles that lie within the reference rectangle.

Rectangles The list of rectangles that are determined to be within the reference rectangle.

πŸ•ΉοΈ Controls

There are no specific controls for this function block as it automatically processes the input data based on provided rectangles.

🎨 Features

Visual Feedback The block provides immediate visual feedback by drawing bounding rectangles directly on the input image, facilitating easy identification of which rectangles are inside the reference.

Count Detection Easily counts how many rectangles are fully within the bounds of the reference rectangle.

πŸ“ Usage Instructions

  1. Connect Input: Link the image you wish to analyze to the Input Image input.

  2. Specify Reference Rectangle: Define the coordinates of the reference rectangle and connect it to the Rectangle input.

  3. Input Rectangles: Provide multiple rectangles for the check through the Rectangles input.

  4. Evaluate: Run the block to determine which rectangles are inside the reference rectangle. The results will be output as specified.

πŸ“Š Evaluation

On execution, this function block evaluates the placement of the provided rectangles relative to the reference rectangle and visually depicts the results, including counts of detected rectangles.

πŸ’‘ Tips and Tricks

Adjusting Rectangle Sizes

Make sure that the rectangles you are testing are not oversized beyond the boundaries of the reference rectangle, as this will ensure accurate tracking.

Boundary Condition Checks

Ensure that valid coordinates are used when defining rectangles as this can affect detection results. Using a visualization tool can help confirm the placements.

Combining with Other Blocks

Consider using Image ROI before passing to this block to crop the area of interest, eliminating unnecessary searches outside your target rectangle.

πŸ› οΈ Troubleshooting

No Rectangles Drawn

If no rectangles are visible on the output image, ensure that valid rectangles are inputted and that their coordinates fall within the bounds of the input image dimensions.

Detection Count Incorrect

If the count of detected rectangles appears to be incorrect, double-check the definitions of your rectangles to ensure they are correctly inputted. They should not overlap the reference rectangle unless you specifically wish to check their containment.

Last updated