Measure Segment Angles¶
Measure angles of segments.
plantcv.morphology.segment_angle(segmented_img, objects)
returns labeled image
- Parameters:
- segmented_img - Segmented image (output either from plantcv.morphology.segment_skeleton or plantcv.morphology.segment_id), used for creating the labeled image.
- objects - Segment objects (output from either plantcv.morphology.segment_skeleton, or plantcv.morphology.segment_sort).
- Context:
- Calculates angles of segments (in degrees) by fitting a linear regression line to each segment. Users can pass only leaf objects (returned from plantcv.morphology.segment_sort) to only collect angles of leaves.
- Output data stored: Data ('segment_angle') automatically gets stored to the
Outputs
class when this function is ran. These data can always get accessed during a workflow (example below). For more detail about data output see Summary of Output Observations
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_angle(segmented_img=segmented_img, objects=obj)
# Access data stored out from segment_angle
segment_angles = pcv.outputs.observations['segment_angle']['value']
Labeled Image