5.0 | 1 rating Rate this file 40 Downloads (last 30 days) File Size: 2.56 KB File ID: #38200 Version: 1.1
image thumbnail

Fast Non-Local Mean Image Denoising Implementation


Yue Wu (view profile)


17 Sep 2012 (Updated )

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

| Watch this File

File Information

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.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
22 Dec 2014 Geert

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)

Comment only
22 Dec 2014 Geert

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);

Comment only
22 Dec 2014 Geert

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);

Comment only
04 Jul 2013 Vikram Venkatraghavan  
18 Sep 2012 1.1

Fixed one bug.

Contact us