Fill

Identifies objects and fills objects that are less than specified size

fill(img, mask, size, device, debug=None)

returns device, filled image

from plantcv import plantcv as pcv

# Apply fill to a binary image that has had a median blur applied.
# Image mask is the same binary image with median blur.

device, binary_img = pcv.median_blur(img, 5, device, debug="print")
device, mask = pcv.median_blur(img, 5, device, debug="print")

device, fill_image = pcv.fill(binary_img, mask, 200, device, debug="print")

Binary image with median blur

Screenshot

Binary image with median blur and fill (200 pixels)

Screenshot