-
Notifications
You must be signed in to change notification settings - Fork 0
/
noises in spaces.m
68 lines (61 loc) · 1.9 KB
/
noises in spaces.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
clear;
rgb=imread('cat.png');
hsv=rgb2hsv(rgb);
yiq=rgb2ntsc(rgb);
ycbcr=rgb2ycbcr(rgb);
%% rgb
gaussian= imnoise(rgb,'gaussian');
sp = imnoise(rgb,'salt & pepper',0.02);
poisson = imnoise(rgb,'poisson');
speckle = imnoise(rgb,'speckle');
%
subplot(1,4,1)
subimage(gaussian); title('RGB-Gaussian(var=0.01)');
subplot(1,4,2)
subimage(sp); title('RGB-Salt & Pepper(noise density=0.05)');
subplot(1,4,3)
subimage(poisson); title('RGB-Poisson');
subplot(1,4,4)
subimage(speckle); title('RGB-Speckle(mean=0, var=0.04)');
%% hsv
gaussianhsv= imnoise(hsv,'gaussian');
sphsv = imnoise(hsv,'salt & pepper',0.02);
poissonhsv = imnoise(hsv,'poisson');
specklehsv = imnoise(hsv,'speckle');
%
subplot(1,4,1)
subimage(gaussianhsv); title('HSV-Gaussian(var=0.01)');
subplot(1,4,2)
subimage(sphsv); title('HSV-Salt & Pepper(noise density=0.05)');
subplot(1,4,3)
subimage(poissonhsv); title('HSV-Poisson');
subplot(1,4,4)
subimage(specklehsv); title('HSV-Speckle(mean=0, var=0.04)');
%% YIQ
gaussianyiq= imnoise(yiq,'gaussian');
spyiq = imnoise(yiq,'salt & pepper',0.02);
poissonyiq = imnoise(yiq,'poisson');
speckleyiq = imnoise(yiq,'speckle');
%
subplot(1,4,1)
subimage(gaussianyiq); title('YIQ-Gaussian(var=0.01)');
subplot(1,4,2)
subimage(spyiq); title('YIQ-Salt & Pepper(noise density=0.05)');
subplot(1,4,3)
subimage(poissonyiq); title('YIQ-Poisson');
subplot(1,4,4)
subimage(speckleyiq); title('YIQ-Speckle(mean=0, var=0.04)');
%% ycbcr
gaussiany= imnoise(ycbcr,'gaussian');
spy = imnoise(ycbcr,'salt & pepper',0.02);
poissony = imnoise(ycbcr,'poisson');
speckley = imnoise(ycbcr,'speckle');
%
subplot(1,4,1)
subimage(gaussiany); title('YCbCr-Gaussian(var=0.01)');
subplot(1,4,2)
subimage(spy); title('YCbCr-Salt & Pepper(noise density=0.05)');
subplot(1,4,3)
subimage(poissony); title('YCbCr-Poisson');
subplot(1,4,4)
subimage(speckley); title('YCbCr-Speckle(mean=0, var=0.04)');