Traditional Culture Encyclopedia - Traditional customs - Matlab image denoising
Matlab image denoising
g = im read(' E:\ 1 . jpg '); % Read in the specific location of the image,
V=imnoise(g,' salt & pepper', 0.1);
Subplots (2, 2,1);
Image display (g)
Title ("original image");
Subplots (2, 2, 2);
Imshow (5)
Title ("Noise Image");
[h, w]= size (v);
n = 9;
f = double(v);
a=ones(n,n);
y = f;
For i= 1:h-n+ 1
For j= 1:w-n+ 1
a=f(i:i+(n- 1),j:j+(n- 1));
s = sum(sum(a));
y(i+(n- 1)/2,j+(n- 1)/2)= s/(n * n);
end
end
Subplots (2, 2, 3);
imshow(uint8(y))
Title ('average filter noise reduction');
x = f;
For i= 1:h-n+ 1
For j= 1:w-n+ 1
c=f(i:i+(n- 1),j:j+(n- 1));
e=c( 1,);
For u=2:n
e=[e,c(u,)];
end
Mm = median (e);
x (i+(n- 1)/2,j+(n- 1)/2)= mm;
end
end
Subplots (2, 2, 4);
imshow(uint8(x))
Title ("median filtering noise reduction");
- Previous article:How to get rid of long spots on the face
- Next article:Talking about the importance and necessity of landscaping maintenance management?
- Related articles
- Where is the wholesale falcon slingshot cheap?
- How did ancient people get appendicitis?
- What is the scope of application of carton packaging
- Beginning to learn calligraphy, but seek to level, this is the ancient method of learning calligraphy, why today's people always listen to it?
- Analysis on the high realm of sales
- What are the oldest buildings in the UK? List of the oldest buildings in the UK
- What English food do people eat at Christmas?
- Method for make spring cake
- Shangshu is also called book or book classics.
- In the setting of the movie Huang Fei-hong, Huang Fei-hong used what boxing