CV Lecture 4
CV Lecture 4
CSC-455
Muhammad Najam Dar
Today’s Lecture
Image Enhancement
Histogram Equalization
Image filtering
Image Enhancement
Image Enhancement
Image Enhancement
Process an image so that the result is more suitable than the original image for a
specific application
Point/Pixel operations
Output value at specific coordinates
(x,y) is dependent only on the input
value at (x,y)
Local operations
The output value at (x,y) is dependent
on the input values in the
neighborhood of (x,y)
Global operations
The output value at (x,y) is dependent
on all the values in the input image
Point Processing Example: Thresholding
s T (r)
a.r
Point Processing Example: Negative Images
s c log(1
r) a narrow range of low input grey level values
The log transformation maps
into a wider range of output values
The inverse log transformation performs the opposite transformation
Logarithmic Transformations
Properties
For lower amplitudes of
input image the range of
gray levels is expanded
For higher amplitudes
of input image the range
of gray levels is
compressed
Logarithmic Transformations
Application
This transformation is suitable for the case when
the dynamic range of a processed image far
exceeds the capability of the display device (e.g.
display of the Fourier spectrum of an image)
Also called “dynamic-range compression / expansion”
Logarithmic Transformations
s c r
Map a narrow range
of dark input values
into a wider range of
output values or vice
versa
Varying γ gives a
whole
family of curves
Power Law Transformations
For < Expands values of dark pixels, compress
1: values of brighter pixels
For > 1: Compresses values of dark
expand pixels,
If =1 & values of brighter pixels
c=1: Identity transformation (s =
r)
A variety of devices (image capture, printing, display)
respond to a power law and need to be
according
corrected
Power Law Transformations: Gamma Correction
Power Law
Transformations
Contrast Enhancement
0.
8
0.
7
0.
6
0.
5
0.
4 0 0.2 0.4 0.6 1
0.8
0.
3 Old Intensities
0.
2
Power Law
Transformations
Contrast Enhancement
γ = 0.4
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
Power Law
Transformations
Contrast Enhancement
γ = 0.3
1
0.9
Transformed Intensities
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.2 0.4 0.6 0.8 1
Original Intensities
Power Law
Transformations
Contrast Enhancement
Result of
Power law
Result of transformation
Power law c = 1, = 5.0
transformation (high contrast,
c = 1, = 4.0 some regions are
(suitable too dark)
)
Histogram of a Grayscale Image
Black marks
pixels with
intensity g
Plot of histogram:
number of pixels with intensity g
Histogram of a Color Image
Histogram: Example
Dark image
Components of
histogram are
concentrated on
the low side
of the gray
scale
Bright image
Components of
histogram are
concentrated on
the high side
of the gray
scale
Contrast Stretching
after
c .
Histogram Equalization: Example
An 8x8 image
Histogram Equalization: Example
Fill in the following table/histogram
cdf (r )
s round (255. )
M
N
s round (255. 46 /
64 )
s 183
183
Original Image
Histogram Equalization: Example
Histogram Equalization: Example
Equalized Histogram
Dark image
Bright image
Equalized Histogram
Histogram Equalization: Example
Equalized Histogram
Low contrast
High Contrast
Equalized Histogram
IMAGE ENHANCEMENT IN THE
SPATIAL DOMAIN
Poorly illuminated CCTV image and the result of histogram
equalisation.
Common Distance Definitions
D4 distance D8 distance
(city-block distance) (checkboard distance)
4 3 2 3 4 2 2 2 2 2
3 2 1 2 3 2 1 1 1 2
2 1 0 1 2 2 1 0 1 2
3 2 1 2 3 2 1 1 1 2
4 3 2 3 4 2 2 2 2 2
Euclidean distance
(2-norm)
References
Some Slide material has been taken from Dr M. Usman Akram Computer Vision
Lectures
CSCI 1430: Introduction to Computer Vision by James Tompkin
Statistical Pattern Recognition: A Review – A.K Jain et al., PAMI (22) 2000
Pattern Recognition and Analysis Course – A.K. Jain, MSU
Pattern Classification” by Duda et al., John Wiley & Sons.
Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley,
2002
Machine Vision: Automated Visual Inspection and Robot Vision”, David Vernon,
Prentice Hall, 1991
www.eu.aibo.com/
Advances in Human Computer Interaction, Shane Pinder, InTech, Austria, October
2008
Computer Vision A modern Approach by Frosyth
http://www.cs.cmu.edu/~16385/s18/