File Exchange

image thumbnail

Fast Non-Local Mean Image Denoising Implementation

version 1.1 (2.56 KB) by

This single m-file implemented a fast algorithm for non-local mean image denosing.



View License

The fast NLM method is based on integral images and is described in Darbon's paper. Generally speaking, this fast implementation is more than 10 times faster than the classic NLM method.

Comments and Ratings (5)

ram prabhakar


Geert (view profile)

I could be wrong, but I believe your code only compares the lower right part of each patch, including the central pixel, whereas my correction compares the entire patch (squared difference norm)


Geert (view profile)

I think that fragment of code should be replaced by:

Sd = integralImgSqDiff(PaddedV,dx,dy);

% Obtaine the Square difference for every pair of pixels
SqDist = Sd(PatchSizeHalf+WindowSizeHalf+1:Height+WindowSizeHalf+PatchSizeHalf,PatchSizeHalf+WindowSizeHalf+1:Width+WindowSizeHalf+PatchSizeHalf)... % lower right corner
+ Sd(-PatchSizeHalf+WindowSizeHalf:Height+WindowSizeHalf-PatchSizeHalf-1,-PatchSizeHalf+WindowSizeHalf:Width+WindowSizeHalf-PatchSizeHalf-1)... % index below upper left corner
- Sd(-PatchSizeHalf+WindowSizeHalf:Height+WindowSizeHalf-PatchSizeHalf-1,PatchSizeHalf+WindowSizeHalf+1:Width+WindowSizeHalf+PatchSizeHalf)... % upper right corner
- Sd(PatchSizeHalf+WindowSizeHalf+1:Height+WindowSizeHalf+PatchSizeHalf,-PatchSizeHalf+WindowSizeHalf:Width+WindowSizeHalf-PatchSizeHalf-1);


Geert (view profile)

are you sure this method is correct?
I believe there is a structural bug in the part
% Obtaine the Square difference for every pair of pixels
SqDist = Sd(PatchSizeHalf+1:end-PatchSizeHalf,PatchSizeHalf+1:end-PatchSizeHalf)+Sd(1:end-2*PatchSizeHalf,1:end-2*PatchSizeHalf)-Sd(1:end-2*PatchSizeHalf,PatchSizeHalf+1:end-PatchSizeHalf)-Sd(PatchSizeHalf+1:end-PatchSizeHalf,1:end-2*PatchSizeHalf);



Fixed one bug.

MATLAB Release
MATLAB 7.10 (R2010a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video