Point Polygon Test

This function block is designed to determine whether any points from a specified test shape lie within a defined enclosing shape. It visually represents the results on the output image.

πŸ“₯ Inputs

Image Gray The background image on which the shapes will be drawn.

Test Shape The set of points (shape) to test against the enclosing shape.

Enclosing Shape The larger shape used to check if the points from the test shape reside within it.

πŸ“€ Outputs

Output Image The resultant image that visually displays the test shape and enclosing shape, along with the points' positions.

Plot Image A boolean output that indicates whether there are points within the enclosing shape.

πŸ•ΉοΈ Controls

This function block does not have any additional controls; however, the behavior of the block depends on the configurations of the input shapes.

🎨 Features

Visual Representation Provides a visual output that clearly shows which points of the test shape are inside or outside the enclosing shape.

Distance Calculation Performs a point-in-polygon test for each point in the test shape, marking them accordingly on the output image.

πŸ“ Usage Instructions

  1. Connect Input Images: Link a grayscale image to the Image Gray input to use as your background.

  2. Define Shapes: Ensure you connect both a test shape and an enclosing shape to their respective inputs.

  3. Evaluate: Run the block to perform the point-in-polygon test. The output image will be generated with points marked according to their status (inside or outside the enclosing shape).

πŸ“Š Evaluation

When executed, this function block will check the specified points against the enclosing shape and return an annotated image and a boolean indicating if all points are inside the shape.

πŸ’‘ Tips and Tricks

Visual Clarity

Use a high contrast color for the enclosing shape to ensure it’s easily distinguishable from the test shape.

Shapes Alignment

Make sure your test and enclosing shapes correctly overlap to ensure meaningful results.

Preprocessing

Preprocessing the input grayscale image with Denoising or Image Threshold can help improve the detection of the shapes before performing the test.

πŸ› οΈ Troubleshooting

No Points Detected

If no points appear on the output image, ensure that the test shape is properly defined and overlaps with the enclosing shape. Ensure that the input shapes are formatted correctly.

Output Ambiguity

Adjust the colors and line widths used for drawing the contours if the results are not clearly visible. Consider using contrasting colors for better differentiation.

Last updated