Measure Euclidean Distance of Segments

Measure Euclidean distance of segments.

plantcv.morphology.segment_euclidean_length(segmented_img, objects, label=None)

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 = "plot"
# Optionally, set a sample label name
pcv.params.sample_label = "plant"

labeled_img = pcv.morphology.segment_euclidean_length(segmented_img=segmented_img, objects=obj)

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

Labeled Image


Source Code: Here