Digital Image Processing
Image Enhancement
21/11/15
Duong Anh Duc - Digital Image Processing
1
Image Enhancement
To process an image so that output is “visually better”
than the input, for a specific application.
Enhancement is therefore, very much dependent on
the particular problem/image at hand.
Enhancement can be done in either:
– Spatial domain: operate on the original image
g(m,n) = T[f(m,n)]
– Frequency domain: operate on the DFT of the original image
G(u,v) = T[F(u,v)],
where
F(u,v) = F[f(m,n)], and G(u,v) = F [g(m,n)],
21/11/15
Duong Anh Duc - Digital Image Processing
2
Image Enhancement Techniques
Point Operations
•
•
•
•
•
•
•
Image Negative
Contrast
Stretching
Compression of
dynamic range
Graylevel slicing
Image
Subtraction
Image Averaging
Histogram
operations
21/11/15
Mask Operations
•
•
•
•
•
Smoothing
operations
Median Filtering
Sharpening
operations
Derivative
operations
Histogram
operations
Transform Operations
Coloring Operations
•
•
•
•
•
•
•
Low pass
Filtering
Hi pass Filtering
Band pass
Filtering
Homomorphic
Filtering
Histogram
operations
Duong Anh Duc - Digital Image Processing
False Coloring
Full color
Processing
3
Point Operations
Output pixel value g(m, n) at pixel (m, n) depends only on the input
pixel value at f(m, n) at (m, n) (and not on the neighboring pixel
values).
We normally write s = T(r), where s is the output pixel value and r is the
input pixel value.
T is any increasing function that maps [0,1] into [0,1].
21/11/15
Duong Anh Duc - Digital Image Processing
4
Image Negative
T(r) = s = L-1-r, L: max grayvalue
21/11/15
Duong Anh Duc - Digital Image Processing
5
Negative Image
21/11/15
Duong Anh Duc - Digital Image Processing
6
Contrast Stretching
Increase the dynamic range of grayvalues in the input image.
Suppose you are interested in stretching the input intensity values in the
interval [r1, r2]:
Note that (r1- r2) < (s1- s2). The grayvalues in the range [r1, r2] is stretched into
the range [s1, s2].
21/11/15
Duong Anh Duc - Digital Image Processing
7
Contrast Stretching
Special cases:
– Thresholding or
binarization
r1 = r2 , s1 = 0 and s2 = 1
– Useful when we are
only interested in the
shape of the objects
and on on their actual
grayvalues.
21/11/15
Duong Anh Duc - Digital Image Processing
8
Contrast Stretching
21/11/15
Duong Anh Duc - Digital Image Processing
9
Contrast Stretching
Special cases (cont.):
– Gamma correction:
S1 = 0, S2 = 1 and
0, r
g
T r
21/11/15
r1
r r1
, r1 r
r2 r1
1, r r2
r2
Duong Anh Duc - Digital Image Processing
10
Contrast Stretching
Gamma correction
21/11/15
Duong Anh Duc - Digital Image Processing
11
Compression of Dynamic
Range
When the dynamic range of the input
grayvalues is large compared to that of
the display, we need to “compress” the
grayvalue range --- example: Fourier
transform magnitude.
Typically we use a log scale.
s = T(r) = c log(1+ r )
21/11/15
Duong Anh Duc - Digital Image Processing
12
Compression of Dynamic
Range
Saturn Image
Mag. Spectrum
Mag. Spectrum
in log scale
21/11/15
Duong Anh Duc - Digital Image Processing
13
Compression of Dynamic
Range
Graylevel Slicing: Highlight a specific
range of grayvalues.
21/11/15
Duong Anh Duc - Digital Image Processing
14
Compression of Dynamic
Range
Example:
Highlighted Image (no background)
Original Image
Highlighted Image (with background)
21/11/15
Duong Anh Duc - Digital Image Processing
15
Compression of Dynamic
Range
Bitplane Slicing: Display the different
bits as individual binary images.
21/11/15
Duong Anh Duc - Digital Image Processing
16
Compression of Dynamic
Range
21/11/15
Duong Anh Duc - Digital Image Processing
17
Image Subtraction
In this case, the difference between two
“similar” images is computed to highlight
or enhance the differences between
them:
g(m,n) = f1(m,n)-f2(m,n)
It has applications in image segmentation
and enhancement
21/11/15
Duong Anh Duc - Digital Image Processing
18
Example: Mask mode radiography
f1(m, n): Image before dye injection
f2(m, n): Image after dye injection
21/11/15
g(m, n): Image after dye injection,
followed by subtraction
Duong Anh Duc - Digital Image Processing
19
Image Averaging for noise
reduction
Noise is any random (unpredictable)
phenomenon that contaminates an image.
Noise is inherent in most practical systems:
– Image acquisition
– Image transmission
– Image recording
Noise is typically modeled as an additive process:
g(m,n) = f(m,n) + (m,n)
Noisy
Image
21/11/15
Noise-free
Image
Duong Anh Duc - Digital Image Processing
Noise
20
Image Averaging for noise
reduction
The noise h (m, n) at each pixel (m, n) is modeled
as a random variable.
Usually, h (m, n) has zero-mean and the noise values
at different pixels are uncorrelated.
Suppose we have M observations {gi(m, n)}, i=1, 2, …,
M, we can (partially) mitigate the effect of noise by
“averaging”
g m, n
21/11/15
1
M
M
g i m, n
i 1
Duong Anh Duc - Digital Image Processing
21
Image Averaging for noise
reduction
In this case, we can show that:
E g m, n
Var g m, n
f m, n
1
Var
M
m, n
Therefore, as the number of observations
increases (M
), the effect of noise
tends to zero.
21/11/15
Duong Anh Duc - Digital Image Processing
22
Image Averaging Example
Noise-free Image
21/11/15
Noisy Image
Noise Variance = 0.05
Duong Anh Duc - Digital Image Processing
23
Image Averaging Example
M =2
21/11/15
M =5
Duong Anh Duc - Digital Image Processing
24
Image Averaging Example
M =10
21/11/15
Duong Anh Duc - Digital Image Processing
M =25
25