{ } Raw JSON

bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / restoration / _denoise / estimate_sigma

function

skimage.restoration._denoise:estimate_sigma

source: /dev/scikit-image/src/skimage/restoration/_denoise.py :1048

Signature

def   estimate_sigma ( image average_sigmas = False * channel_axis = None )

Summary

Robust wavelet-based estimator of the (Gaussian) noise standard deviation.

Parameters

image : ndarray

Image for which to estimate the noise standard deviation.

average_sigmas : bool, optional

If true, average the channel estimates of sigma. Otherwise return a list of sigmas corresponding to each channel.

channel_axis : int or None, optional

If None, the image is assumed to be grayscale (single-channel). Otherwise, this parameter indicates which axis of the array corresponds to channels.

Returns

sigma : float or list

Estimated noise standard deviation(s). If multichannel is True and average_sigmas is False, a separate noise estimate for each channel is returned. Otherwise, the average of the individual channel estimates is returned.

Notes

This function assumes the noise follows a Gaussian distribution. The estimation algorithm is based on the median absolute deviation of the wavelet detail coefficients as described in section 4.2 of [1].

Examples

import skimage.data
from skimage import img_as_float
img = img_as_float(skimage.data.camera())
sigma = 0.1
rng = np.random.default_rng()
img = img + sigma * rng.standard_normal(img.shape)
sigma_hat = estimate_sigma(img, channel_axis=None)

Aliases

  • skimage.restoration.estimate_sigma