Segment Curvature

Measure the curvature of segments.

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

returns labeled image

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"

labeled_img = pcv.morphology.segment_curvature(segmented_img=segmented_img, 
                                               objects=obj, label="all")
# Pass just leaf objects and hierarchies (output from pcv.morphology.segment_sort) 
labeled_img2 = pcv.morphology.segment_curvature(segmented_img=leaf_segmented,
                                                objects=leaf_obj, label="leaf")

# Access data stored out from segment_curvature
all_curvatures = pcv.outputs.observations['all']['segment_curvature']['value']
leaf_curvatures = pcv.outputs.observations['leaf']['segment_curvature']['value']

Labeled Image


Labeled Image (only leaves)


Source Code: Here