VNLM

VisionX V4
NAME

vnlm − Nonlocal means filter.

SYNOPSIS

vnlm if=<infile> [ig=] [im=] [sw=] [p=] [d=] [h=] [cn=] of=<ofile>

DESCRIPTION

vnlm is a 3D implementation of the nonlocal means (nlm) filter developed by Buades in [1]. This filtering method takes an estimate of the image noise for each patch, which will be provided in the noise image (ig), if specified or uses a constant noise level for the entire image. The mask provides a ROI so the entire image need not be filtered. Note that pixels outside of the mask will be used to filter the pixels on the edge of the mask, so the mask should only contain the pixels which are to be filtered.

The nlm algorithm selects a search window around a current pixel, xi. The pixels in the search window (sw) are decomposed into a series of patches with patch size p and displacement d. The similarity of each patch to the patch centered on the pixel xi is computed using the gaussian weighted euclidean distance between corresponding pixels in each patch to the pixel in the patch centered about xi. The smoothing parameter, h, controls the ratio of weights of similar and dissimilar patches. If h is high, then similar and dissimilar patches will receive almost equal weight. If h is low, then similar patches will receive much higher weight than the dissimilar patches. The mean is computed as the sum of weights times the intensity of the central pixels of the patches in the search window. The main equations are as below

First, we compute the weight of each patch. Note that ||.|| denotes a Gaussian weighted euclidean distance, as defined by

|| a - b || = sqrt( (1/G) * (a - b)^2 )
where G is the variance of the gaussian noise.

The weight of each patch is then computed as

wij=(1/Zi)*sum( e^-((|| u(xi+d) - u(xj+d) ||^2)/(h^2)) ) where u(.) is the pixel intensity, d is the displacement within the patch, xi is the current pixel, xj is the pixel at the center of a patch in the search window, and Zi is a normalizing factor computed as below.

Zi=sum(e^-((||u(j+d)-u(j+d)||^2/(h^2)))

The filtered pixel value at loaction xi is computed as

NLM(xi)= sum( wij*u(xj) )

In this implementation, an optional mask is used to specify the regions in which the image is to be filtered. In this way we can avoid unneccessary computation. Additionally, this implementatation includes a noise map, which allows for the filter to adapt to the local image noise if an estimate is provided.

[1] A.Buades, B.Coll, J. Morel. "A Review of Image Denoising Algorithms, with a New One", Multiscale Modeling and Simulation (SIAM), Vol. 4 (2), pp 490-530, 2005.

CONSTRAINT

The input and noise images must be of type short. The mask must be a byte image.

OPTIONS

if=

input image

of=

output filtered image

ig=<noise image>

If the cn= option is not specified then this input is an image that provides local estimations of noise for corresponding pixels in the input image. This image must be the same size as the input image and be a float.

im=

mask image - if provided, the non-zero regions of this image provide ROIs in which the image is filtered. This image must be the same size as the input image and also be a byte image.

sw=

x[,y[,z]]- define the search space around the current pixel. The default is 5,5,5. If only x and y are specified, then the default for z is 1.

p=

x[,y[,z]] - This parameter specifies patch size for similarity comparison. The default is 3,3,3. If only x and y are specified, then the default for z is 1. If an even patch size is specified ( eg. m x m x m, where m is even), then the central element is considered to be located at (m/2,m/2,m/2).

h=

- Is the smoothing parameter required by the NLM algorithm. It is a real number in the range (0,inf). The default is 10.

d=

x[,y[,z]] - specifies the amount of displacement between patches. The default is 1,1,1.

cn=

allows for the specification of a constant noise level throughout the image. When the cn parameter is specified the ig= parameter has no effect.

SEE ALSO

vsfas vinterp

AUTHOR

J. Padgett, A.P. Reeves