SoNonLocalMeansFilterProcessing engine More...
#include <ImageViz/Engines/ImageFiltering/SmoothingAndDenoising/SoNonLocalMeansFilterProcessing.h>
Public Types | |
enum | KernelShape { CUBE = 0, BALL = 1 } |
Public Member Functions | |
SoNonLocalMeansFilterProcessing () | |
Public Attributes | |
SoSFEnum | computeMode |
SoSFImageDataAdapter | inImage |
SoSFEnum | kernelShape |
SoSFInt32 | kernelSize |
SoSFInt32 | patchSize |
SoSFFloat | similarity |
SoImageVizEngineOutput < SoSFImageDataAdapter, SoImageDataAdapter * > | outImage |
The SoNonLocalMeansFilterProcessing engine implements the non-local means algorithm for image denoising.
The algorithm computes a weighted mean of a large set of voxels (search windows) around the voxel to be denoised (target voxel). The voxel weight in the search window is a function of the similarity between this voxel and the target voxel. A voxel very similar to the target voxel will be assigned to a weight close to 1.0. A voxel very different from the target voxel will be assigned to a weight close to 0 and will have a small impact on the final denoised value.
The similarity between a voxel and the target voxel is based on the squared intensity differences between 2 patches of size patchSize centered on the current voxel and the target voxel.
Images are often corrupted by noise because of acquisition process. For an image defined on which is the image domain, the noise added by acquisition is assimilated to an additive white gaussian noise:
where
The denoised image is an estimation of as following:
with
where:
The algorithm looks for matches within the search window area around each voxel.
The naive implementation of previous equation has a complexity of that can be reduced to where N*M*Q is the dimension of the input image, P is the patchSize and S is the kernelSize.
computeMode | MODE_AUTO |
inImage | NULL |
kernelShape | BALL |
kernelSize | 6 |
patchSize | 3 |
similarity | 0.6f |
SoNonLocalMeansFilterProcessing::SoNonLocalMeansFilterProcessing | ( | ) |
Constructor.
Select the compute Mode (2D or 3D or AUTO) Use enum ComputeMode.
Default is MODE_AUTO
Input image.
Default value is NULL. Supported types include: grayscale binary label image.
The search window shape to apply.
The shape of the window search area can be use to improve the run time. Indeed, choosing a ball shape reduces of 50% the computation time (in 3D). Use enum KernelShape. Default is BALL
The search window size to apply.
SoImageVizEngineOutput<SoSFImageDataAdapter,SoImageDataAdapter*> SoNonLocalMeansFilterProcessing::outImage |
The output image.
Default value is NULL. Supported types include: grayscale binary label color image.
The patch box size to apply.
The weight of a voxel in the search windows is computed by comparing the neighborhood of this voxel with the neighborhood of the target voxel. The value represents the edge size of the neighborhood volume in number of voxels (neighborhood is a cube), and affects the quality of the result. If this value is either much smaller or much larger than fine structures in the data the algorithm shows little or no effect at all. This parameter has almost no effect on the computation time. Default value is 3.
The similarity is used to compute weight assigned to each voxel in the search window (see expression of ).
The squared similarity is proportional to the standard deviation of the assumed gaussian noise of the input image. As result, the larger the value, the more the resulting image will be smoothed. The similarity has no effect on the computation time. Default value is 0.6f.