Image Enhancement: (C) 2002-2012 by Yu Hen Hu
Image Enhancement: (C) 2002-2012 by Yu Hen Hu
Image Enhancement: (C) 2002-2012 by Yu Hen Hu
• Resizing, cropping
• Contrasts enhancement: sharpening & softening
• Edge enhancement
• Brightness adjustment, equalization
• Color adjustment, gamma correction
• Noise reduction/unwanted object removal
• Geometric adjustment, lens error correction
• Special enhancement techniques:
– Red eye removal
– Hand motion compensation, motion blur reduction
• s = T(r) = L-1-r
• Similar to photo
negatives.
• Suitable for
enhancing white or
gray details in dark
background.
• Data-dependent pixel-
based image enhancement
method.
• Histogram = PDF of image
pixels.
– Assumption: each image
pixel is drawn from the
same PDF independently
(i.i.d.)
– Several effects of
histograms are shown at the
right side.
• A gray-level transformation
method that forces the
transformed gray level to
spread over the entire
intensity range.
– Fully automatic,
– Data dependent,
– (usually) Contrast enhanced
• Usually, the discrete-valued
histogram equalization
algorithm does not yield exact
uniform distribution of r
histogram.
• In practice, one may prefer
s = T (r ) = ∫ p (w)dw
r
⇒ ps ( s ) = 1, 0 ≤ s ≤ 1.
L −1 r
⇒ s= ∑
N w=0
nw = ( L − 1) ⋅ cdf ( r )
( r ) FS=
In this case, one has FR= ( s ) T=
(r ) g (s)
r
Thus, T ( r )= s= g ( FR ( r ) )= g ∫ pR ( w)dw
−1 −1
w=0
Assuming g −1 ( ) exists over [ 0 1].
• Indirect approach:
– First equalize the
histogram using
transform s = T(r).
– Equalize the desired
histogram v = G(z).
– Set v = s to obtain the
composite transform
z = G −1 (T (r ))
Fig. 3.19
I J
g (m, n) = ∑ ∑ w(i, j ) f (m − i, n − j )
i =− I j =− J
• 2D FIR filtering
– Mask filtering:
convolution of the image
with a 2D mask
– Applications to image
enhancement: • Data-dependent
• Smoothing: low pass nonlinear filters
• Sharpening: high pass – Local histogram
– Order statistic filters
• Medium filter
(c) 2002-
2006 by Yu
Smoothing Linear Filters
I J
∑ ∑ w(i, j ) f (m − i, n − j )
i =− I j =− J
g (m, n) = I J
∑ ∑ w(i, j )
i =− I j =− J
(c) 2002-
2006 by Yu
Sharpening Linear Filters
∂ 2 f ( x, y ) ∂ 2 f ( x, y )
∇ f ( x, y ) =
2
+
∂x 2 ∂y 2
= f ( x + 1, y ) + f ( x − 1, y ) + f ( x, y + 1) + f ( x, y − 1) − 4 f ( x, y )
– A≥1
• Derivative filter:
– Use derivatives to approximate
high pass filters. Usually 2nd
derivatives are preferred. The
most common one is the
Laplacian operator.
(c) 2002-
2006 by Yu
Laplacian Filter for Image Enhancement
(c) 2002-
2006 by Yu
Gradient filters
Sobel operator
(c) 2002-
2006 by Yu
Local Statistic Filters
(c) 2002-
2006 by Yu
Image Enhancement:
Frequency Domain Processing
Image and Its Fourier Spectrum
Basic Steps
1. Multiply pixel f(x,y) of the
input image by (-1)x+y.
2. Compute F(u,v), using DFT
3. G(u,v)=F(u,v)H(u,v)
4. g1(x,y)=F-1{G(u,v)}
5. g(x,y) = g1(x,y)*(-1)x+y
0 u = v = 0
H (u , v) =
1 otherwise.
• The frequency response
H(u,v) has a notch at
origin (u = v = 0).
• Effect: reduce mean
value.
• After post-processing
where gray level is
scaled, the mean value
of the displayed image
is no longer 0.
h( x) = 2π ⋅ σ ⋅ Ae − 2π σ x
2 2 2
(D(u , v) )2
H (u , v) = exp −
2σ 2
D(u,v): distance from the origin
of Fourier transform
1
H (u , v) =
1 + [D(u , v) / Do ]
2n
0 if D(u , v) ≤ Do
H (u , v) =
1 otherwise.
• Ideal HPF
– Do = 15, 30, 80
• Butterworth HPF
– n = 2,
– Do = 15, 30, 80
• Gaussian HPF
– Do = 15, 30, 80