This is a development version (0.26.1rc0.dev0) and may be unstable.Go to latest (0.26.1rc0.dev0+git20260530.b607368ff)
{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0 / skimage / filters / thresholding / threshold_mean

function

skimage.filters.thresholding:threshold_mean

source: /_skimage2/filters/thresholding.py:883

Signature

def threshold_mean(image)

Summary

Return threshold value based on the mean of grayscale values.

Parameters

image : (M, N[, ...]) ndarray

Grayscale input image.

Returns

threshold : float

Upper threshold value. All pixels with an intensity higher than this value are assumed to be foreground.

Examples

from skimage.data import camera
image = camera()
thresh = threshold_mean(image)
binary = image > thresh
✓

Aliases

  • skimage.filters.threshold_mean