Create a Skeleton

Skeletonizing takes a mask and reduces it to a 1 pixel wide representation while retaining the structure.


returns Binary skeleton (1 pixel wide representation)

  • Parameters:
    • mask - Binary mask
  • Context:
    • Reduces binary objects to 1 pixel wide representations (skeleton)

Reference 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"

skeleton = pcv.morphology.skeletonize(mask=plant_mask)


Source Code: Here