Digital Image Processing: Image Enhancement in Spatial Domain
Digital Image Processing: Image Enhancement in Spatial Domain
2
Image Enhancement
3
Basic Concepts
4
Basic Concepts
5
Basic Concepts
g(x,y) = T [f(x,y)]
Pixel/point operation:
Neighborhood of size 1x1: g depends only on f at (x,y)
T: a gray-level/intensity transformation/mapping function
Let r = f(x,y) s = g(x,y)
r and s represent gray levels of f and g at (x,y)
Then s = T(r)
Local operations:
g depends on the predefined number of neighbors of f at (x,y)
Implemented by using mask processing or filtering
Masks (filters, windows, kernels, templates) :
a small (e.g. 33) 2-D array, in which the values of the
coefficients determine the nature of the process
6
Common Pixel Operations
Image Negatives
Log Transformations
Power-Law
Transformations
7
Image Negatives
Reverses the gray level order
For L gray levels the transformation function is
s = T(r) = (L - 1) - r
8
Image Scaling
9
Log Transformations
Function of s = c Log(1+r)
10
Log Transformations
12
Power-Law Transformation
13
Power-Law Transformation
For < 1: Expands values of dark pixels,
compresses values of brighter pixels
For > 1: Compresses values of dark pixels,
expands values of brighter pixels
If =1 & c=1: Identity transformation (s = r)
Gamma () correction
The process used to correct the power-law response
phenomena
14
Power-Law Transformation
15
Gamma Correction
16
Power-Law Transformation: Example
17
Power-Law Transformation: Example
18
Piecewise-Linear Transformation
Contrast Stretching
Goal:
Increase the dynamic range of the gray levels for low
contrast images
19
Piecewise-Linear Transformation: Contrast Stretching
20
Contrast Stretching Example
21
Histograms
22
Example Histogram
23
Example Histogram
24
Histogram Examples
25
Contrast Stretching through Histogram
If rmax and rmin are the maximum and minimum gray level
of the input image and L is the total gray levels of output
image The transformation function for contrast stretching
will be
26