4.33333

4.3 | 12 ratings Rate this file 85 Downloads (last 30 days) File Size: 2.22 KB File ID: #13176
image thumbnail

Non-Local Means Filter

by Jose Vicente Manjon-Herrera

 

29 Nov 2006 (Updated 01 Aug 2008)

Non-Local Means Filter for image denoising

| Watch this File

File Information
Description

Implementation of the Non-Local Means Filter proposed by Buades et al. for robust image denoising.

typical usage:

fima=nlmeans(ima,5,2,sigma);

being sigma the noise standard deviation

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (22)
02 Dec 2006 James Chan

cool

12 Dec 2006 Jose Manjon

There is a small bug in the code, please
chage:
 
k=max(abs(i),abs(j));

for

k=max([abs(i),abs(j),1]);

enjoy the filter

Jose Manjon

13 Jan 2007 Peter L

It is really slow. You need to vectorize it.

16 Jul 2007 Jose Manjon

The original code was not optimized to easily understand the filter caracteristics. Now, I have already vectorized it to speed up the filter. New version is much faster but if you plan to use it rutinarily I suggest you to mex it.

13 Aug 2007 victor diaz  
28 Nov 2007 Reza Farrahi Moghaddam

Good Work,

Only, please change the word "radio" to "size" (in the definitions of "t" and "f")

Thanks

14 Jul 2008 Roger Ting

How to set the sigma for the algorithm.I chose 10*noisesigma, the result is very bad.

31 Jul 2008 Jose Manjon

You have to use sigma, not 10*sigma

being signa the image noise standard deviation

Jose

31 Jul 2008 Kevin Verghese

d = sum(sum(kernel.*(W1-W2).*(W1-W2)));
This line throws an error.
"Error using ==> times
Integers can only be combined with integers of the same class, or scalar doubles."
How do we rectify that?

01 Sep 2008 Bi Yiming

i think it should be
 fima=NLmeansfilter(rima,5,2,sigma);
not fima=NLmeansfilter(ima,5,2,sigma);
in demo.m

22 Sep 2008 Jose Manjon

You are right Bi Yiming.

Sorry about that.

Jose

17 Apr 2009 cristina

I have a little error here [m n]=size(input); in NLmeansfilter.m:

> NLmeansfilter
??? Input argument 'input' is undefined.

Error in ==> C:\Documents and Settings\Iulia\Desktop\matlab\NLmeansfilter.m
On line 19 ==> [m n]=size(input);

I need help...Thanks!

17 Apr 2009 cristina

I must define input,f,t,h...I'm not sure that I know how!
Can you help me please?I'm a beginer in matlab...thank you!

05 Aug 2009 Vijay

Performance of the algorithm will depend on the sigma estimation in noisy image. How to estimate good sigma?

15 Oct 2009 Haoheng Zheng

Good, but few notation...

24 Nov 2009 Abhishek Bansal

how to calculate sigma, h and f? I am confused. I am a student, need urgent help. u can also email me at abhishek85bansal@gmail.com

24 Nov 2009 Victor Lee

Hi Jose, you've mention of the bug earlier on but I can't seem to find it. Is it rectified and updated?

08 Dec 2009 Tai Fei

Hi, Jose, I have 2 questions on the kernel.
1). Is it gaussian kernel which is mentioned in the paper of Buades. As far as i know, the one in your code is not gaussian.
2). why you take these two steps ?
average = average + wmax*input2(i1,j1);
        sweight = sweight + wmax;

I cannot find any ground in the original paper, but it does make my algorithm oscillate less. could you give me some idea, why you make them ?

08 Oct 2010 Royi Avital

Hello.
You mention to have the "Original" version which is slower yet easier to understand,
Where can I find it?
Thanks.

09 Oct 2010 priyanka reddy

i have the same doubt what crisitna asked. can you help me. can u send me the modified codings

05 Dec 2010 Tadonam

Is this line right?

fima=NLmeansfilter(ima,5,2,sigma);

I think it has to change like below

fima=NLmeansfilter(rima,5,2,sigma);

10 Jul 2011 Zhang Xuande

cool!!

Please login to add a comment or rating.
Updates
27 Apr 2007

I have vectorized it to speed up the filter

01 Aug 2008

I have added a small demo to show clearer how to use the filter

Tag Activity for this File
Tag Applied By Date/Time
filtering Jose Vicente Manjon-Herrera 22 Oct 2008 08:50:48
denoising Jose Vicente Manjon-Herrera 22 Oct 2008 08:50:48
nonlocal Jose Vicente Manjon-Herrera 22 Oct 2008 08:50:48
means Jose Vicente Manjon-Herrera 22 Oct 2008 08:50:48
filter Jose Vicente Manjon-Herrera 22 Oct 2008 08:50:48
image Jose Vicente Manjon-Herrera 22 Oct 2008 08:50:48

Contact us at files@mathworks.com