scico.denoiser#

Interfaces to standard denoisers.

Functions

bm3d(x, sigma[, is_rgb, profile])

An interface to the BM3D denoiser [16].

bm4d(x, sigma[, profile])

An interface to the BM4D denoiser [36].

Classes

DnCNN([variant])

Flax implementation of the DnCNN denoiser.

scico.denoiser.bm3d(x, sigma, is_rgb=False, profile='np')[source]#

An interface to the BM3D denoiser [16].

BM3D denoising is performed using the code released with [35]. Since this package is an interface to compiled C code, JAX features such as automatic differentiation and support for GPU devices are not available.

Parameters:
  • x (Array) – Input image. Expected to be a 2D array (gray-scale denoising) or 3D array (color denoising). Higher-dimensional arrays are tolerated only if the additional dimensions are singletons. For color denoising, the color channel is assumed to be in the last non-singleton dimension.

  • sigma (float) – Noise parameter.

  • is_rgb (bool) – Flag indicating use of BM3D with a color transform. Default: False.

  • profile (Union[Any, str]) – Parameter configuration for BM3D.

Returns:

Denoised output.

scico.denoiser.bm4d(x, sigma, profile='np')[source]#

An interface to the BM4D denoiser [36].

BM4D denoising is performed using the code released by the authors of [36]. Since this package is an interface to compiled C code, JAX features such as automatic differentiation and support for GPU devices are not available.

Parameters:
  • x (Array) – Input image. Expected to be a 3D array. Higher-dimensional arrays are tolerated only if the additional dimensions are singletons.

  • sigma (float) – Noise parameter.

  • profile (Union[Any, str]) – Parameter configuration for BM4D.

Returns:

Denoised output.

class scico.denoiser.DnCNN(variant='6M')[source]#

Bases: FlaxMap

Flax implementation of the DnCNN denoiser.

Inheritance diagram of DnCNN

A flax implementation of the DnCNN denoiser [58]. Note that DnCNNNet represents an untrained form of the generic DnCNN CNN structure, while this class represents a trained form with six or seventeen layers.

The standard DnCNN as proposed in [58] does not have a noise level input. This implementation of DnCNN also supports a custom variant that includes a noise standard deviation input, sigma, which is included in the network as an additional channel consisting of a constant array with value sigma. This network was trained with image data on the range [0, 1], and with noise standard deviations ranging from 0.0 to 0.2. It is worth noting that DRUNet [57], another recent approach to including a noise level input in a CNN denoiser, is based on a substantially different network architecture.

Note that all DnCNN models are trained for single-channel image input. Multi-channel input is supported via independent denoising of each channel. Input images are expected to have pixel values in the range [0, 1].

Parameters:

variant (str) – Identify the DnCNN model to be used. Options are ‘6L’, ‘6M’ (default), ‘6H’, ‘6N’, ‘17L’, ‘17M’, ‘17H’, and ‘17N’, where the integer indicates the number of layers in the network, and the postfix indicates the training noise standard deviation (with respect to data in the range [0, 1]): L (low) = 0.06, M (mid) = 0.10, H (high) = 0.20, or N indicating that a noise standard deviation input, sigma, is available.

__call__(x, sigma=None)[source]#

Apply DnCNN denoiser.

Parameters:
  • x (Array) – Input array.

  • sigma (Optional[float]) – Noise standard deviation (for variants 6N and 17N).

Return type:

Array

Returns:

Denoised output.