FloodFill

This function block utilizes the flood fill algorithm to fill enclosed shapes within a grayscale image. It is particularly useful for isolating and modifying specific regions based on connected pixel values.

πŸ“₯ Inputs

Image Gray A grayscale image that will be processed to fill enclosed areas.

πŸ“€ Outputs

Image Gray The output is a modified grayscale image where enclosed shapes have been filled.

πŸ•ΉοΈ Controls

This function block does not have additional user controls beyond the input and output connections.

🎨 Features

Shape Filling Efficiently fills connected regions in the image, allowing for various applications in image processing and analysis.

Automatic Handling The algorithm identifies and fills shapes based on the specified starting point.

πŸ“ Usage Instructions

  1. Connect Input: Link a grayscale image to the Image Gray input.

  2. Run Evaluation: Initiate the block to fill enclosed shapes in the input image. The result will be output as a new filled image.

πŸ“Š Evaluation

When executed, the flood fill algorithm will process the input image, filling enclosed shapes with the specified fill color (in this case, white).

πŸ’‘ Tips and Tricks

Custom Fill Color

To modify the fill color, you would need to adapt the starting point in the flood fill function. The default starting point is at the top left corner (0, 0), and it fills with white. Changing the color requires additional configuration, which may involve modifying algorithm implementation.

Using Masks for Specific Regions

You can create a mask beforehand if you want to fill only specific areas. This can be achieved by combining or creating regions utilizing other function blocks like Image ROI.

Performance Optimization

Flood filling can be computationally intensive for large images. Consider resizing images or cropping unnecessary areas before processing.

πŸ› οΈ Troubleshooting

Flood Fill Not Filling Shapes

If the flood fill does not appear to fill any shapes, check whether the starting point (0, 0) is within the desired region. You may need to change the starting point or ensure the area is indeed enclosed.

Image Size Issues

Ensure that the image provided to the input socket is a valid grayscale image. If the image dimensions are incorrect or the format is not compatible, the flood fill may not work as expected.

Last updated