Professional Documents
Culture Documents
com
Chapter 3
Image Enhancement
in the Spatial Domain
Background
Gray-level Transformation
Image Negatives
Log Transformations
s c log( 1 r )
where c : constant
r 0
Power-Law Transformation
s cr
where c, : positive constants
Power-Law Transformation
Example 1: Gamma Correction
0.4
Power-Law Transformation
Example 2: Gamma Correction
1 0.6
0.4 0.3
2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com
Power-Law Transformation
Example 3: Gamma Correction
1 3.0
4.0 5.0
7 6
5 4 3
2 1 0
Histogram Processing
Histogram Processing
Histogram Equalization
Histogram equalization:
To improve the contrast of an image
To transform an image in such a way that the transformed image has a
nearly uniform distribution of pixel values
Transformation:
Assume r has been normalized to the interval [0,1], with r = 0
representing black and r = 1 representing white
s T (r ) 0 r 1
The transformation function satisfies the following conditions:
T(r) is single-valued and monotonically increasing in the interval 0 r 1
0 T (r ) 1 for 0 r 1
Histogram Equalization
For example:
Histogram Equalization
Histogram Equalization
r
Given transformation function T(r), T (r ) 0 pr (w)dw
dr dT (r ) d r p (r )
dr 0
p ( w) dw
ds dr
r r
dr 1
ps ( s) pr (r ) pr (r ) 1 0 s 1
ds pr (r )
ps(s) now is a uniform probability density function.
T(r) depends on pr(r), but the resulting ps(s) always is uniform.
Histogram Equalization
In discrete version:
The probability of occurrence of gray level rk in an image is
nk
pr ( r ) k 0,1,2,..., L 1
n
n : the total number of pixels in the image
nk : the number of pixels that have gray level rk
L : the total number of possible gray levels in the image
The transformation function is
k k nj
sk T (rk ) pr (rj ) k 0,1,2,..., L 1
j 0 j 0 n
Histogram Equalization
Histogram Equalization
Histogram Equalization
Histogram Matching
Local Enhancement
AND
OR
2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com
Image Subtraction
Example 1
Image Subtraction
Example 2
Image Averaging
w(s, t ) f ( x s, y t )
g ( x, y ) s at b
a b
w(s, t )
s at b
Order-Statistic Filters
Order-statistic filters
Median filter: to reduce impulse noise (salt-and-
pepper noise)
2 f [ f ( x 1, y) f ( x 1, y) f ( x, y 1) f ( x, y 1)] 4 f ( x)
f mag (f ) G G 2 2 2
x y
x y
f G x G y
Roberts cross-gradient
operators
Sobel
operators
Combining Spatial
Enhancement Methods
Combining Spatial
Enhancement Methods