Unit-5
Image Enhancement in the Spatial Domain
It makes all the difference whether one sees darkness through the
light, or light through the shadows
David Lindsay
Section 3.1 to 3.4 in Text Book*
* Digital Image Processing by Gonzales
Image Enhancement in the Spatial Domain
Background
Some Basic Gray Level Transformations
Image Negatives
Log Transformations
Power-Law Transformations
Piecewise-Linear Transformation Functions
Histogram Processing
Enhancement Using Arithmetic/Logic Operations
http://ece756.wikispaces.com
Image Enhancement in the Spatial Domain
Background
Some Basic Gray Level Transformations
Histogram Processing
Histogram Equalization
Histogram Matching
Local Enhancement
Use of Histogram Statistics for Image Enhancement
Enhancement Using Arithmetic/Logic Operations
Image Subtraction
Image Averaging
http://ece756.wikispaces.com
Why perform image enhancement?
Process images to obtain results more suitable
than the original image for 'specific' apps
Specificity of applications implies no single
standard method of processing
Ex: Enhancing X-ray images and Hubble space
telescope images would not employ the same
methods!
http://ece756.wikispaces.com
Methods of Image enhancement
(1) Spatial Domain -> Image plane itself; Direct
manipulation of pixels
(2) Frequency Domain -> Based on Fourier
transform of images
http://ece756.wikispaces.com
General Theory of Image Enhancement
There is none!
Visual evaluation is higly subjective, and there
can be no general methods that can be
employed!
Ex: Between us, the perception certainly varies!
For machine perception, we could converge to
somewhat standard methods
Ex: Character recognition by machines
http://ece756.wikispaces.com
Spatial Domain?
It refers to the aggregate of pixels composing an
image
Spatial Domain methods are procedures
operating directly on these pixels
g(x,y)=T[ f(x,y) ]
where, f(x,y) & g(x,y) are the input and processed images respectively;
T is the Transform Operator on f, over a defined area (x,y)
http://ece756.wikispaces.com
Defining a neighborhood
http://ece756.wikispaces.com
Simplest form of T
When the neighborhood is of size 1x1
'g' depends only on the value of 'f' at (x,y) and T
becomes a Gray Level Transformation function
s=T(r)
r & s denote the gray levels of f(x,y) and g(x,y)
http://ece756.wikispaces.com
Contrast stretching as an example
* Thresholding function
* Point Processing
http://ece756.wikispaces.com
10
Basic Gray Level Transformations
Linear : Negative and Identity transforms
Logarithmic : Log and inverse log transforms
th
th
Power Law: n power and n root transforms
http://ece756.wikispaces.com
11
Basic Gray Level Transformations
http://ece756.wikispaces.com
12
Image Negatives
s=L1-r
For enhancing white or gray detail embedded in dark regions of an image
http://ece756.wikispaces.com
13
Log Transformations
s = c*log(1+r)
Maps a narrow range of low gray level values
into a wider range of output levels
Opposite is true of higher values of input levels
To accomplish spreading and compressing of
gray levels
Imp: It compresses the dynamic range of
images with large variations in pixel levels
Ex: Fourier spectra
http://ece756.wikispaces.com
14
Log Transformations
http://ece756.wikispaces.com
15
Power law Transformations
s = c*r
Maps a narrow range of low gray level values
into a wider range of output levels, when '' is
fractional
Opposite is true of higher values of input levels.
when '' is higher
The process used to correct the power-law
response phenomena is called GammaCorrection
Gamma correction is important when displaying
images on computer screen
http://ece756.wikispaces.com
16
Power law Transformations
http://ece756.wikispaces.com
17
Gamma Correction
http://ece756.wikispaces.com
18
Power law Transformations
http://ece756.wikispaces.com
19
Piecewise Linear Transformation Functions
A complementary approach to the previous
methods
These functions can be arbitrarily complex
Some important transformations are purely
piece-wise linear transforms
Disadv: Specification requires more user input
Ex: Contrast stretching transform
http://ece756.wikispaces.com
20
Contrast Stretching
Low-contrast images : Poor illumination, lack of
dynamic range in sensor, wrong setting of lens
aperture
Contrast Stretching: To increase the dynamic
range of the gray levels in the image
http://ece756.wikispaces.com
21
Contrast Stretching
http://ece756.wikispaces.com
22
Gray-level Slicing
Highlighting a specific range of Gray-levels:
1. Displaying high values in the range of interest and a low value for
all other values
2. Brightens the desired range of gray levels but preserves the
backgrounds and tonalities
http://ece756.wikispaces.com
23
Bit Plane Slicing
Contribution made to total image appearance by specific bits
Higher order bits contain the visually significant data, the
other bits contribute to more subtle details of the image
Useful for analyzing the relative importance played by each
bit plane
Aids in determining the adequacy of the number of bits used
to quantize each pixel
Also in image compression
http://ece756.wikispaces.com
24
Bit Plane Slicing
http://ece756.wikispaces.com
25