{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / exposure / exposure / is_low_contrast

function

skimage.exposure.exposure:is_low_contrast

source: /dev/scikit-image/src/skimage/exposure/exposure.py :784

Signature

def   is_low_contrast ( image fraction_threshold = 0.05 lower_percentile = 1 upper_percentile = 99 method = linear )

Summary

Determine if an image is low contrast.

Parameters

image : array-like

The image under test.

fraction_threshold : float, optional

The low contrast fraction threshold. An image is considered low- contrast when its range of brightness spans less than this fraction of its data type's full range. [1]

lower_percentile : float, optional

Disregard values below this percentile when computing image contrast.

upper_percentile : float, optional

Disregard values above this percentile when computing image contrast.

method : str, optional

The contrast determination method. Right now the only available option is "linear".

Returns

out : bool

True when the image is determined to be low contrast.

Notes

For boolean images, this function returns False only if all values are the same (the method, threshold, and percentile arguments are ignored).

Examples

image = np.linspace(0, 0.04, 100)
is_low_contrast(image)
image[-1] = 1
is_low_contrast(image)
is_low_contrast(image, upper_percentile=100)

Aliases

  • skimage.exposure.is_low_contrast