Measure Path Length of Segments

Measure the geodesic distance of segments.

plantcv.morphology.segment_path_length(segmented_img, objects, label="default")

returns labeled_image

Reference Image: segmented_img


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"

labeled_img = pcv.morphology.segment_path_length(segmented_img=segmented_img, 
                                                 objects=obj, label="default")

# Access data stored out from segment_path_length
path_lengths = pcv.outputs.observations['default']['segment_path_length']['value']

Labeled Image


Source Code: Here