Mean Adaptive Threshold

Creates a binary image from a grayscale image using the mean adaptive thresholding method.

plantcv.threshold.mean(gray_img, max_value, object_type="light")

returns thresholded/binary image

Grayscale image (green-magenta channel)

Screenshot

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"

# Create binary image from a gray image based 
threshold_mean = pcv.threshold.mean(gray_img, 255, 'dark')

Auto-Thresholded image (mean)

Screenshot