Fill Segments

Propagate the labels of a segmented skeleton to fill the mask.

plantcv.morphology.fill_segments(mask, objects, stem_objects=None)

returns filled_img

Reference Image: mask, objects drawn as labels



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 = "print"

filled_img = pcv.morphology.fill_segments(mask=plant_mask, objects=obj)

# Access data stored out from fill_segments
segments_area = pcv.outputs.observations['segment_area']['value']

Filled Image


Source Code: Here