Check Area (Polygon)

This function block allows users to interactively define a polygonal area on an image and check whether specified points fall within that area. It provides visualization tools for drawing and managing coordinates on the image.

📥 Inputs

Input Image The image in which you will define a polygon and check point locations.

Position Coordinate List A list of coordinates (points) that will be checked against the defined polygon.

📤 Outputs

Output Image The original image with the defined polygon area highlighted.

Polygon Coordinates The coordinates of the defined polygon.

Object In Area A boolean indicating whether any of the specified points fall inside the polygon.

Detected Positions The coordinates of the points that fall within the defined polygon area.

🕹️ Controls

Mouse Clicks Use left mouse clicks to draw points that form the polygon; press C to clear the points or U to undo the last added point.

🎨 Features

Interactive Polygon Drawing Users can easily define polygonal areas on the image using mouse clicks.

Real-Time Feedback The image is updated in real-time to reflect the currently defined polygon and detected points.

📝 Usage Instructions

  1. Connect Input Image: Provide an image to the Input Image input of the block.

  2. Define Polygon: Click on the image to create points that form the vertices of the polygon.

  3. Check Points: Connect points to the Position Coordinate List to check if they lie within the defined polygon.

  4. Clear or Undo Points: Use the C key to clear all points or U to undo the last point added.

📊 Evaluation

When executed, this block will check if the provided points are inside the drawn polygon and return the modified image, along with polygon coordinates and detection results.

💡 Tips and Tricks

Point Precision

Ensure that the points added to define the polygon are as precise as necessary for your application, as they directly impact the area checked against the specified coordinates.

Polygon Complexity

For complex shapes, create additional points as necessary. The more points you add, the more accurately the polygon shape will represent your intended area.

Overlay Transparency

Adjust the alpha value in the code to change the transparency of the overlaying polygon in the output image.

🛠️ Troubleshooting

No Points Detected Inside

If no points are detected inside the polygon, verify that the points used are indeed within the defined area. Double-check the coordinates for accuracy.

Polygon Not Appearing

If the polygon does not appear upon clicking, ensure that the mouse events are being registered properly. Verify that the input image is correctly connected.

Last updated