Fill Holes¶
Cleans pepper noise (black holes) by doing a flood fill
plantcv.fill_holes(bin_img, roi=None)
returns fill_image
- Parameters:
- bin_img - Binary image data
- roi - Optional rectangular ROI as returned by
pcv.roi.rectanglewithin which to apply this function. (default = None, which uses the entire image)
- Context:
- Used to reduce image noise
- Example use:
- Below
from plantcv import plantcv as pcv
# Set global debug behavior to None (default), "print" (to file),
# or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "plot"
# Apply fill holes to a binary image
fill_image = pcv.fill_holes(bin_img=binary_img)
Binary image

Binary image with holes filled

Source Code: Here