Ex 10
Ex 10
EXERCISE 10
15-16.11.2011
Reports should be submitted through online form on the following link:
http://www.cs.tut.fi/kurssit/SGN-3016/Reports/
1- Download the lena.jpg, which is 512x512 gray-level image.
Add the following noises to the image individually.
a) Gaussian noise: Use imnoise function to generate the noisy image.
b) Salt & pepper noise: Use imnoise function to generate the noisy image.
c) Rayleigh noise:
- Assume a uniform random number, w, in the interval (0,1). We wish to generate random numbers, z, with a Rayleigh CDF of the
form:
2
( ) /
1 for
( )
0 for
z a b
z
e z a
F z
z a
>
=
`
<
)
where b > 0. To find z we solve the equation
2
( ) /
1 = w
z = a + -bln(1-w)
z a b
e
- MATLAB: R = a + sqrt(-b*log((1-rand(M,N))
- Add the generated noise to the image to obtain the noisy image.
Select the noise parameters so that image quality deterioration is noticeable and the image quality approximately same in
each case.
Reconstruction of Noisy Images:
Create 3 3
a) Arithmetic mean filter:
# MATLAB: f = i m filte r (g , fs p e c ia l( 'a v e ra g e ', [m n ]) )
b) Geometric mean filter
# MATLAB: f = e x p ( im fi lte r ( l o g ( g ) , o n e s( m , n ) , ' r e p li c a te ' ) ) .^ ( 1 /( m *n ) )
! log(a*b*c) = log(a) + log(b) + log(c) + ...
c) Harmonic mean filter
# MATLAB: (m *n ) ./ i m fi lte r (1 ./ (g + e p s ) , o n e s ( m, n ) , 'r e p lic a te ') ;
# MATLAB : Use imagesc function to display the output images.
What filtering methods do you suggest for eliminating the specific noises created above? Describe the effects of
the filters on the each noisy image. Your report should contain the Matlab scripts, the resulting images and explanations.