Measure Tangent Angles of Segments

Measure tangent angles of segments as a way to quantify leaf behavior.

plantcv.morphology.segment_tangent_angle(segmented_img, objects, size, label=None)

returns labeled image

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

# Adjust line thickness with the global line thickness parameter (default = 5)
pcv.params.line_thickness = 3 

labeled_img = pcv.morphology.segment_tangent_angle(segmented_img=leaves_segment, 

# Access data stored out from segment_tangent_angle
leaf_tangent_angles = pcv.outputs.observations['plant']['segment_tangent_angle']['value']

Labeled Image


Source Code: Here