You are on page 1of 72

Image Processing Basics

Reference: ‘Digital Image Processing’, 2nd Edition, by


Rafael Gonzalez. Prentice Hall
Problem Domains
Processing Components
Human Eye Structure
Cones and Rods
Image Formation
Visual Example
Simultaneously Constrast
Light/Electromagnetic Spectrum
Image Acquisition
Image Acquisition With Sensor
Array
Sampling and Quantization
Digital Image
Coordination For Computation
Mathematic Representation
 f (0,0) f (0,1)  f (0, N − 1) 
 f (1,0) f (1,1)  f (1, N − 1) 
f ( x, y ) = 
     
 
 f ( M − 1,0) f ( M − 1,1)  f ( M − 1, N − 1)

 a0 , 0 a0,1  a0, N −1


 a a1,1   
A=
1, 0 
     
 
aM −1, 0 aM −1,1  aM −1, N −1 
Resolutions
Zoomed Images
Quantization Levels
Quantization Levels
Aliasing/Moire
Interpolation
Spatial Domain Technique
Spatial Domain Operator
g ( x, y ) = T [ f ( x, y )] s = T (r )
Log Transformation
Result
Result
Result
Result
Contrast Stretching
Grey-Level Slicing
Histogram
• rk: Gray Level
• nk: Number of pixels h(rk ) = nk
with gray level rk
• N: Total number of
pixels p (rk ) = nk / N
Example
Histogram Equalization
• T(r) is single-valued and monotonically
increasing in the interval 0 ≤ r ≤ 1.
• 0 ≤ T(r) ≤ 1, for 0 ≤ r ≤ 1.
Histogram Equalization
• Mapping of each pixel with level rk into a
corresponding pixel with level sk
nk
pr (rk ) = , k = 0,1,2,..., L − 1
N
k
sk = T (rk ) = ∑ pr (rj ), k = 0,1,2,..., L − 1
j =0
Result
Segmentation
Result
Spatial Filtering
• Also called a filter mask.

a b
g ( x, y ) = ∑ ∑ w(s, t ) f ( x + s, y + t )
s = − at = − b
Mask Filtering
Smoothing Filter
∑ ∑
a b
w( s, t ) f ( x + s, y + t )
g ( x, y ) = s =− a t =−b

∑ ∑ w(s, t )
a b
s =− a t =−b
Results
Application
Median Filter
a
g ( x, y ) = Middle(  f ( x + s , y + t ))
s ,t = − a
Finding High Frequency

∂ f
2
= f ( x + 1) + f ( x − 1) − 2 f ( x)
∂x 2

∂ f ∂ f 2 2
∇ f = 2 + 2
2

∂x ∂y
Mask Filters
Sharpening Filter

 f ( x, y ) − ∇ 2 f ( x, y ) , negative center
g ( x, y ) = 
 f ( x , y ) + ∇ 2
f ( x, y ) , positive center
Results
Other Results
Gradient Method
• Use of First Derivative (Sobel Operator)
Result
Hybrid Methods
Frequency Domain
Discrete Fourier Transform (DFT)
M −1 N −1
1
F (u , v) =
MN
∑∑ f ( x, y)e
x =0 y =0
− j 2π ( ux / M + vy / N )

M −1 N −1
f ( x, y ) = ∑∑ F (u , v)e j 2π ( ux / M + vy / N )

u =0 v =0
1-D Example
2-D Examples
2-D Examples
Frequency Domain Filtering
Procedures
1. Compute DFT, F(u,v)
2. Filter With a function, H(u,v)
3. Compute Inverse DFT
4. Obtain the real part in step (4)
Results
Results
Results
Low Pass Filter
Example
Results
Sharpening Filter
Different Filters
Ideal Filters
Butterworth Types
Gaussian Types
Hybrid Method
Convolution (Filtering)
H (u )G (u ) ↔ h(t ) * g (t )
H (u ) * G (u ) ↔ h(t ) g (t )

h(t ) * g (t ) = ∫ h(τ ) g (t − τ )dτ



h( n) * g ( n) = ∑ h(m) g (n − m)
m = −∞
M −1
1
Correlation h(n)  g (n) =
MN

k =0
f * ( n) g ( n + k )
Fast Fourier Transform
M −1 M −1
1 1
F (u ) =
M

x =0
f ( x)e − j 2π (ux / M ) =
M

x =0
f ( x)WMux

1 1 M / 2−1 1 M / 2 −1
F (u ) = [ ∑
2 M / 2 x =0
f ( 2 x )W ux
M /2 +
M /2
WM ∑
u

x =0
f ( 2 x + 1)W ux
M /2]

Turning M-point DFT into 2 M/2-point DFT

You might also like