Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Today’s Agenda

• Mathematical tools in digital image processing


• Intensity Transformation
Mathematic Tools

Array/matrix operations
Linear/nonlinear operations

Linearity:
Arithmetic Operations – single pixel operations
• Image averaging, image subtraction, image multiplication
Set and logic operations
Spatial operations
• Single pixel operations and neighborhood operations
Image transformation
Probabilistic methods
Set Operations Based on Intensities

Complement – negative image


𝑨𝒄 = 𝒙, 𝒚, 𝑲 − 𝒛 𝒙, 𝒚, 𝒛 ∈ 𝑨
Thresholding
𝑨 ∪ 𝑩 = 𝒙, 𝒚, max 𝒛𝒂 , 𝒛𝒃 𝒙, 𝒚, 𝒛𝒂 ∈ 𝑨, 𝒙, 𝒚, 𝒛𝒃 ∈ 𝑩
Logic Operations for Binary Image

Foreground/background
• Binary image: 0/1
• Fuzzy set: [0,1]

Logic operations will be used a lot in


morphological image processing
Spatial Operations
Perform directly on the pixels of the given image
• Intensity transformation – change the intensity
• Single pixel operations s=T(z)
• Neighborhood operations
• Geometric spatial transformations – change the
coordinates
Single pixel operations

• Determined by
• Transformation function T
• Input intensity value
• Not depend on other pixels and position
Neighborhood Operations

Image smoothing
g ( x, y ) =
1
 f ( r, c)
mn ( r ,c )S xy

Other examples:
•Interpolation
•Image filtering
Geometric Spatial Transformations – Rubber
Sheet Transformation

( x, y ) = T {(v, w)}

Affine transform:

 x  v  t11 t12 0  v 
 y  = T  w = t 0  w
     21 t 22
 1   1  t31 t32 1  1 
Inverse mapping
v  x
 w = T −1  y 
   
 1   1 
Geometric Spatial Transformations

Nearest neighbor Bilinear Bicubic

Note: a neighborhood operation, i.e., interpolation, is


required following geometric transformation
Image Registration

Compensate the geometric


change in:
• view angle
• distance
• orientation
• sensor resolution
• object motion
Four major steps:
• Feature detection
• Feature matching
• Transformation model
• Resampling
Image Registration

Coordinates in the moving image 𝒗, 𝒘


Coordinates in the template image 𝒙, 𝒚
x = c1v + c2 w + c3vw + c4
y = c5v + c6 w + c7 vw + c8

• Known: coordinates of the points 𝒙, 𝒚 and 𝒗, 𝒘


• Unknown: 𝒄𝟏 to 𝒄𝟖
4 tie points -> 8 equations
Vector and Matrix Operations

 z1 
 
z =  z2 
z 
 3

D( z, a) = z − a = ( z1 − a1 )2 + ( z2 − a2 )2 + ... + ( zn − an )2

Geometric transformations use vector and matrix


operations
Spatial-Frequency Domain Transformation

Forward
transformation
kernel
M −1 N −1 u = 0,1,..., M − 1
T (u, v ) =  f ( x, y )r ( x, y , u, v ),
x =0 y =0 v = 0,1,..., N − 1
M −1 N −1 x = 0,1,..., M − 1
f ( x, y ) =  T (u, v ) s( x, y , u, v )
u =0 v =0 y = 0,1,..., N − 1
Inverse
transformation
kernel
Fourier Transforms and Filtering
Fourier Transform

Separable kernel : r ( x, y , u, v ) = r1 ( x, u ) r2 ( y , v )
Symmtric kernel : r ( x, y , u, v ) = r1 ( x, u ) r1 ( y , v )

− j 2 ( ux / M + vy / N )
r ( x , y , u, v ) = e
1 j 2 ( ux / M + vy / N )
s ( x , y , u, v ) = e
MN
Probability Methods

𝑧𝑘 is the kth intensity value


𝑛𝑘 is the number of pixels having the intensity value 𝑧𝑘
Probability of an intensity value

L −1
nk
p( zk ) =
MN
,  p( z
k =1
k ) =1
Probability Methods

L −1 L −1
m =  z k p ( z k ),  =  ( z k − m) 2 p ( z k )
2
What do they mean?
k =1 k =1
L −1
 n ( z ) =  ( z k − m) n p ( z k ) nth moment of z
k =1

Std=14.3 Std=31.6 Std=49.2


Stochastic Image-Sequence Processing

Using probability and random-process tools


Each pixel is a random event → each image frame is a random
event, related to time
Probability plays a central role in modern image processing
and computer vision
Summary

In this course, we will discuss all the concepts in details.


Now,

Intensity Transformation and Spatial Filtering

Reading: Chapter 3.
Spatial Domain

g(x,y)=T [f(x,y)]
→ spatial filter
1x1 Neighborhood → Intensity Transformation
→ Image Enhancement
Contrast stretch

Soft thresholding (logistic function) Hard thresholding (step function)


Some Basic Intensity Transformation
Functions

• Thresholding – Logistic function


• Log transformation
• Power-law (Gamma correction)
• Piecewise-linear transformation
• Histogram processing
Some Basic Intensity Transformation
Functions

Image Negative: s=L-1-r


Basic Intensity Transformation Functions
Log function:

Stretch low intensity levels


Compress high intensity levels
Power functions Inverse log function:

Stretch high intensity levels


Compress low intensity levels
Log Transformations: s=c log(1+r)
Power-Law (Gamma) Transformations


s = cr
• More versatile than log
transformation
• Performed by a lookup
table
Power-Law (Gamma) Transformations

Monitors have an intensity-


to-voltage response with a
power function
Image Enhancement Using Gamma Correction
Power-Law (Gamma) Transformations for
Contrast Manipulation

Washed-out appearance caused


by a small gamma value
Power-Law (Gamma) Transformations for
Contrast Manipulation

Washed-out appearance
was reduced by a large
gamma value
Piecewise-Linear Transformation Functions:
Contrast Stretching
Piecewise-Linear Transformation Functions:
Intensity-Level Slicing
An Example of Intensity-Level Slicing
Piecewise-Linear Transformation Functions:
Bit-Plane Slicing
An Example
Use for Image Compression

original

Less bit planes are sufficient to obtain an acceptable details, while


require half of the storage
Histogram Processing

Histogram

h(rk ) = nk
Normalized histogram

p (rk ) = nk / MN
255

 p(r ) = 1
k =0
k

You might also like