answersLogoWhite

0

PSMF(x)

%% Implementation of Progressive Switching Median Filter

%% Base Paper : Zhou Wang and David Zhang, "Progressive Switching Median

%% Filter for the Removal of Impulse Noise from Highly Corrupted Images",

%% IEEE Trans. on Cir. and Sys., vol. 46, no. 1, Jan. 1999.

%% Function Y = PSMF(x)

%% input x = Image is corrupted by Salt & Pepper Noise

%%

%% Example: Y = PSMF(x);

%% Posted date : 16 - 10 - 2008

%% Modified date :

%%

%% Developed By : K.Kannan (kannan.keizer@gmail.com)

%% & Jeny Rajan (jenyrajan@gmail.com)

%% Medical Imaging Research Group (MIRG), NeST,

%% Trivandrum.

%% Progressive Switching Median Filter

function Y = PSMF(x)

x = double(x);

WF = 3; ND = 3;T = 40;a = 65;b = -50;

M = medfilt2(x,[3 3]);

N = abs(x - M);

N(N>T)=0;

N = N ~= 0;

N = double(N);

R = sum(N(:))/(size(x,1) * size(x,2));

if R <= 0.25

WD = 3;

else

WD = 5;

end

TD = a + (b * R);

z = IMPDET(x,ND,WD,TD);

Y = NF(x,z,WF);

%% Impulse Detection

function F1 = IMPDET(x,ND,WD,TD)

X = x;

M = medfilt2(X,[WD WD]);

D = abs(X - M);

F = zeros(size(x));

F(D>=TD)=1;

F1 = F;

X(F1==F)=X(F1==F);

X(F1~=F)=M(F1~=F);

for i = 1:ND-1

M = medfilt2(X,[WD WD]);

F1(abs(X - M)<TD)=F(abs(X - M)<TD);

F1((X - M)>=TD)=1;

X(F1==F)=X(F1==F);

X(F1~=F)=M(F1~=F);

F = F1;

end

return;

%% Noise Filtering

function Y = NF(x,f,WF)

g = f;

Y = x;

Y1 = Y;

g1 = g;

s = sum(g(:));

while s ~= 0

M = medfilt2(Y,[WF WF]);

Y1(g==1)=M(g==1);

g1(Y~=Y1)=0;

Y = Y1;

g = g1;

s1 = sum(g(:));

if s1 ~= s

s = s1;

else

s = 0;

end

end

return;

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is the sentence of switching?

Please stop switching gears so quickly. We'll soon arrive at the switching station. The cow chases flies away by switching her tail.


What is the median of 3893583?

The median is a measure of central tendency that typically applies to a set of numbers rather than a single number. Since 3893583 is a single number, it does not have a median. If you are looking for the median of a dataset that includes this number, please provide the full set of numbers for analysis.


Who is the cute guy in the new progressive insurance?

I dunno who he is, but he is super cute! Please someone find out!John Jenkinson plays the new character in the Progressive ads.


What is a better way to compare data mode median or range?

i don't know if you know it please help me


Who plays Flo the female spokesperson for progressive insurance?

Stephanie Courtney plays Flo on the Progressive Insurance commercials. For more information please refer to the related link.


When do you use median in real life situations?

One common use of the median is the so-called 'median lethal dose'. In quantifying how toxic a substance is the LD50 is the amount of the substance required to kill 50% of the population within a specified time period. Please see the link.


What is the 5 digit code for Progressive in Florida?

I'm sorry, but I can't provide specific codes, including insurance codes such as the 5-digit code for Progressive in Florida. For accurate information, please check directly with Progressive or consult their official website.


How do you get to the fuel filter?

You drive to the store? Please be more specific.


Where is the fuel filter on a 1987 Oldsmobile ninety eight?

Where is the fuel filter located on a 1987 98 Regency Oldsmobile? Please answer this asap. Joe ann Where is the fuel filter located on a 1987 98 Regency Oldsmobile? Please answer this asap. Joe ann


How do you find the median if there are two numbers left in the middle Please answer correct?

if there are to numbers left add the numbers together and divide by 2


How do you remove the oil filter adaptor on a 94 jeep Cherokee with a 4.0 engine?

What Oil filter adaptor?? Please elaborate. To remove the oil filter just unscrew it.


What candidate switched parties during the course of the progressive era?

You call me is number 854-9651 please thanks!!