Spatial Image Enhancement
Spatial Image Enhancement
Spatial Image Enhancement
Sankalp Kallakuri
elsanky@gmail.com
Spatial Image Enhancement
. Images are usually represented as matrices
• g(x,y) = T[(x,y)]
• Point processing
s = T(r)
Light Light
Dark Dark
Dark light
Dark light
A simple transform
Light
Dark
Dark light
Digital negative
Grey level Transformations
• s = c log (1+r)
• s=cr
Power Law Results
2D Fourier transform
&
Unprocessed image
representation
2D Fourier Image after Log transform
Gamma Correction
i 0 j 0
sm s var
NM NM
Histogram
0 255
Histogram
Image histogram
Piecewise Linear Transformations
.Contrast stretching
.Thresholding
.Grey level slicing
.Bit plane slicing
Contrast Stretching
Piecewise linear
function
How did I get the stretch function?
R 80-130 R 80-160
R 80-190 R 80-220
Examples of Grey level slicing
Grey slice
original 88
R 80-130
dark light
0 r 1
b) 0 T (r ) 1 for 0 r 1
CDF is integral of PDF
ds dT (r )
We can prove that pr ( r ) (3)
dr dr
nk
pr (rk ) k 0,1,2....L 1
n
Setting up T(r) as the CDF
k
nk k 0,1,2....L 1
sk T (rk )
0 n
Histogram Equalization Results
Step 1: Equalization r
s T (r ) pr ( w)dw
0
Step 2: Define a variable z such that:
z
G ( z ) p z ( w)dw s
0
Step 3: Obtain mapping from r to z
z G 1 (s) G 1[T (r )]
Statistics from Histograms
L 1
un (r ) (ri m) n p(ri )
i 0
L 1
u2 (r ) (ri m) 2 p(ri )
i 0
Arithmetic and Logical Operations
• AND OR NOT
• ADD SUB
Masks
for
logical
operators
g ( x, y) f ( x, y) ( x, y)
If the noise is uncorrelated and has zero mean. An image
formed by averaging K noisy images could be created.
K
1
g ( x, y )
K
g ( x, y)
i 1
i
• Near the edges parts of the masks may lie beyond the image
boundary.
Examples
1 1 1 1 2 1
1/9 x 1 1 1 1/16 x 2 4 2
1 1 1 1 2 1
Smoothing Spatial Filters
m( s , t ) f ( x s , y t )
g ( x, y ) s at b
a b
m( s , t )
s at b
3 6 9 12
Home Work 2
4)Display the original image with the circular region darkened to black.
Lets call this image B.
5)Vertically flip image B and display it.Lets call this image C.
6) Digitally invert a circular region at center x,y = 3L/4,3L/4 and radius
25 for image C and display this image. Lets call this image D.
7) Transpose image D and display. This last image should be labeled
E.