File Exchange

## SNN filter

version 1.0.0.0 (983 Bytes) by
Symmetric nearest neighbor edge-preserving filter.

Updated 02 Aug 2005

This function implements the symmetric nearest neighbor filter, a 2D nonlinear filter that reduces noise in an image while at the same time preserving edge content. A code example follows:

I = rgb2gray(RGB);
J = imnoise(I,'gaussian',0,0.005);
Y = snn(J,5,true);

### Cite As

Arthur Barnes (2020). SNN filter (https://www.mathworks.com/matlabcentral/fileexchange/8174-snn-filter), MATLAB Central File Exchange. Retrieved .

D.Regan

I got artifact on left & top of the image sides. I think that there should be problem with padding..Dear Barnes or else to help?

D.Regan

kindly update this to color images..

Vitaliano Lama

jalvarof

It also seems a good idea to unpad the result matrix Y. This can be done at the end of the file with something like:

dragon

Error in ==> snn at 66
Y(i,j) = mean([NNnearest X(i,j)]);

solution :
replace X with Xpad ,the size of X is smaller than Xpad.

Cem

line 66 - Y(i,j) = mean([NNnearest X(i,j)]); => Y(i,j) = mean([NNnearest Xpad(i,j)]);

Anand Muglikar

nice but can u give me starting basic codes or link to them for IP using MATLAB? I will be grateful to u...

AOA.how are you, i have seen your SSN filter but cannot understand it, plz help me,if you have any other noise reduction filter then help me

jim grande

Hi,

I have the following problem with your program, trying the suggested example. I'm looking forward to hearing from you soon.

Best regards,

Jim

??? Attempted to access X(3,1201); index out of bounds because size(X)=[1500,1200].

Error in ==> snn at 66
Y(i,j) = mean([NNnearest X(i,j)]);

##### MATLAB Release Compatibility
Created with R14SP2
Compatible with any release
##### Platform Compatibility
Windows macOS Linux