Measure Euclidean Distance of Segments

Measure Euclidean distance of segments.

plantcv.morphology.segment_euclidean_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_euclidean_length(segmented_img=segmented_img, 
                                                      objects=obj, label="default")

# Access data stored out from segment_euclidean_length
euclidean_lengths = pcv.outputs.observations['default']['segment_eu_length']['value']

Labeled Image


Source Code: Here