Triangle Auto Threshold

Creates a binary image from a gray image using adaptive thresholding.

triangle_auto_threshold(device, img, maxvalue, object_type, xstep=1, debug=None)

returns device, thresholded image

Grayscale image (green-magenta channel)

Screenshot

from plantcv import plantcv as pcv

# Create binary image from a gray image based
device, thresholded= pcv.triangle_auto_threshold(device,img, 255,'light', xstep=10, debug="print")

Triangle Auto-Thresholded image (xstep=10)

Screenshot Screenshot

from plantcv import plantcv as pcv

# Create binary image from a gray image based 
device, thresholded= pcv.triangle_auto_threshold(device,img, 255,'light', xstep=1, debug="print")

Triangle Auto-Thresholded image (xstep=1)

Screenshot Screenshot