Fill Contour

This function block allows you to fill the inside or outside of a specified contour in an image, enabling effective shape analysis and manipulation.

📥 Inputs

Input Image The image in which you want to fill the specified contour.

Contour The coordinates of the contour that defines the area to fill. This must consist of at least two points.

📤 Outputs

Output Image The image after the specified contour has been filled according to user settings.

🕹️ Controls

Fill Inside A checkbox that lets you specify whether to fill the area inside the contour or outside it. By default, it is checked to fill the inside.

🎨 Features

Contour Filling The block can be used to fill either the inside or outside of a given contour, enhancing image processing tasks.

Dynamic Contour Handling The block handles both rectangular contours defined by two points and arbitrary contours defined by multiple points.

📝 Usage Instructions

  1. Connect Input: Provide an image to the Input Image input and the contour points to the Contour input.

  2. Select Filling Option: Use the Fill Inside checkbox to choose whether to fill within the contour (checked) or outside the contour (unchecked).

  3. Evaluate: Execute the block to fill the specified area in the image, and the modified image will be output.

📊 Evaluation

When executed, this function block will return an image filled according to the contour specifications and user's choice of filling direction.

💡 Tips and Tricks

Using Accurate Contours

Ensure that your contours are defined correctly and are continuous. You may want to utilize other analytical blocks like Find Contour to refine your contours before using this block.

Dynamic Applications

Consider using this block alongside other processing blocks like Image Threshold or Blur to improve the quality of the contours drawn before filling.

Experimenting with Different Shapes

Shapes can be combined by passing multiple contours for advanced filling operations. Make sure to carefully manage the input to produce desired results.

🛠️ Troubleshooting

Invalid Contour Data Error

If you receive an error stating that the contour must have at least two points, verify that at least two valid points are provided in the contour array.

Filling Not Working as Expected

Ensure that the checkbox reflecting your desired filling option (inside or outside) is set correctly and that the contour is properly defined without any discontinuities.

Last updated