DIP Image Denoising
DIP Image Denoising
Image restoration
Image denoising
Image deblurring
Image enhancement
Spatial domain
Frequency domain
Image interpolation
Theme: bad-looking images good-looking images
1
Image Denoising
Introduction
Impulse noise removal
Median filtering
Additive white Gaussian noise removal
2D convolution and DFT
Periodic noise removal
Band-rejection and Notch filter
2
Introduction
Where does noise come from?
Sensor (e.g., thermal or electrical
interference)
Environmental conditions (rain, snow etc.)
Why do we want to denoise?
Visually unpleasant
Bad for compression
Bad for analysis
3
Noisy Image Examples
4
Noise Modeling
Simplified assumptions
Noise is independent of signal
Noise types
Independent of spatial location
Impulse noise
Additive white Gaussian noise
Spatially dependent
Periodic noise
5
Noise Removal Techniques
Linear filtering
Nonlinear filtering
Recall
Linear system
6
Image Denoising
Introduction
Impulse noise removal
Median filtering
Additive white Gaussian noise removal
2D convolution and DFT
Periodic noise removal
Band-rejection and Notch filter
7
Impulse Noise (salt-pepper
Noise)
Definition
Note: in some applications, noisy pixels are not simply black or white,
which makes the impulse noise removal problem more difficult
8
Numerical Example
P=0.1
128 128 128 128 128 128 128 128 128 128 128 128 255 0 128 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 128 128 0 128 128 128 128 0
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 0 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128
128 128 128 128 128 128 128 128 128 128 0 128 128 128 128 255 128 128 128 128
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 255
128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 128 255 128 128
X Y
Noise level p=0.1 means that approximately 10% of pixels are contaminated by
salt or pepper noise (highlighted by red color)
9
MATLAB Command
>Y = IMNOISE(X,'salt & pepper',p)
Notes:
10
Impulse Noise Removal Problem
filtering denoised ^
X
algorithm image
^
Can we make the denoised image X as close
Noisy image Y
to the noise-free image X as possible?
11
Median Operator
Given a sequence of numbers {y1,…,yN}
Mean: average of N numbers
Min: minimum of N numbers
Max: maximum of N numbers
Median: half-way of N numbers
Example y [50,0,52,255,54,55,56]
sorted [0,50,52,54,55,56,255]
y
median( y ) 54
12
1D Median Filtering
y(n)
… …
W=2T+1
13
Numerical Example
T=1:
y [50,0,52,255,54,55,56]
Boundary y [50,50,0,52,255,54,55,56,56]
Padding
ˆ
x [50,50,52,54,54,55,55]
14
2D Median Filtering
x(m,n)
W: (2T+1)-by-(2T+1) window
xˆ (m, n) median[ y (m T , n T ),..., y (m T , n T ),...,
y (m, n),..., y (m T , n T ),..., y (m T , n T )]
MATLAB command: x=medfilt2(y,[2*T+1,2*T+1]);
15
Numerical Example
225 225 225 226 226 226 226 226 0 225 225 226 226 226 226 226
225 225 255 226 226 226 225 226 225 225 226 226 226 226 226 226
226 226 225 226 0 226 226 255 225 226 226 226 226 226 226 226
255 226 225 0 226 226 226 226 226 226 225 225 226 226 226 226
225 255 0 225 226 226 226 255 225 225 225 225 226 226 226 226
255 225 224 226 226 0 225 226 225 225 225 226 226 226 226 226
226 225 225 226 255 226 226 228 225 225 225 226 226 226 226 226
226 226 225 226 226 226 226 226 226 226 226 226 226 226 226 226
^
Y X
16
Image Example
P=0.1
denoised ^
Noisy image Y X
image
3-by-3 window
17
Image Example (Con’t)
noisy
clean
(p=0.2)
20
Median Filtering with Noise Detection
Noisy image Y
Median filtering
x=medfilt2(y,[2*T+1,2*T+1]);
Noise detection
C=(y==0)|(y==255);
21
Image Example
noisy
clean
(p=0.2)
w/o with
noise noise
detection detection
22