denoise-bilateral

denoise_bilateral

skimage.restoration.denoise_bilateral(image, win_size=None, sigma_color=None, sigma_spatial=1, bins=10000, mode='constant', cval=0, multichannel=True, sigma_range=None) [source]

Denoise image using bilateral filter.

This is an edge-preserving and noise reducing denoising filter. It averages pixels based on their spatial closeness and radiometric similarity.

Spatial closeness is measured by the gaussian function of the euclidian distance between two pixels and a certain standard deviation (sigma_spatial).

Radiometric similarity is measured by the gaussian function of the euclidian distance between two color values and a certain standard deviation (sigma_color).

Parameters:

image : ndarray, shape (M, N[, 3])

Input image, 2D grayscale or RGB.

win_size : int

Window size for filtering. If win_size is not specified, it is calculated as max(5, 2*ceil(3*sigma_spatial)+1)

sigma_color : float

Standard deviation for grayvalue/color distance (radiometric similarity). A larger value results in averaging of pixels with larger radiometric differences. Note, that the image will be converted using the img_as_float function and thus the standard deviation is in respect to the range [0, 1]. If the value is None the standard deviation of the image will be used.

sigma_spatial : float

Standard deviation for range distance. A larger value results in averaging of pixels with larger spatial differences.

bins : int

Number of discrete values for gaussian weights of color filtering. A larger value results in improved accuracy.

mode : {‘constant’, ‘edge’, ‘symmetric’, ‘reflect’, ‘wrap’}

How to handle values outside the image borders. See numpy.pad for detail.

cval : string

Used in conjunction with mode ‘constant’, the value outside the image boundaries.

multichannel : bool

Whether the last axis of the image is to be interpreted as multiple channels or another spatial dimension.

Returns:

denoised : ndarray

Denoised image.

References

[R324] http://users.soe.ucsc.edu/~manduchi/Papers/ICCV98.pdf

Examples

>>> from skimage import data, img_as_float
>>> astro = img_as_float(data.astronaut())
>>> astro = astro[220:300, 220:320]
>>> noisy = astro + 0.6 * astro.std() * np.random.random(astro.shape)
>>> noisy = np.clip(noisy, 0, 1)
>>> denoised = denoise_bilateral(noisy, sigma_color=0.05, sigma_spatial=15)
doc_scikit_image
2017-01-12 17:20:44
Comments
Leave a Comment

Please login to continue.