skimage2.exposure.is_low_contrast#

skimage2.exposure.is_low_contrast(image, fraction_threshold=0.05, lower_percentile=1, upper_percentile=99, method='linear')[source]#

Determine if an image is low contrast.

Parameters:
imagearray-like

The image under test.

fraction_thresholdfloat, 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_percentilefloat, optional

Disregard values below this percentile when computing image contrast.

upper_percentilefloat, optional

Disregard values above this percentile when computing image contrast.

methodstr, optional

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

Returns:
outbool

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).

References

Examples

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