ECE 472/572 - Digital Image Processing -...

9
1 ECE 472/572 - Digital Image Processing Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap Introduction Image format (vector vs. bitmap) IP vs. CV vs. CG HLIP vs. LLIP Image acquisition Perception Structure of human eye Brightness adaptation and Discrimination Image resolution Image enhancement Enhancement vs. restoration Spatial domain methods Point-based methods Log trans. vs. Power-law Contrast stretching vs. HE Gray-level vs. Bit plane slicing Image averaging (principle) Mask-based methods - spatial filter Smoothing vs. Sharpening filter Linear vs. Non-linear filter Smoothing (average vs. Gaussian vs. median) Sharpening (UM vs. 1st vs. 2nd derivatives) Frequency domain methods Understanding Fourier transform Implementation in the frequency domain Low-pass filters vs. high-pass filters vs. homomorphic filter Geometric correction Affine vs. Perspective transformation Homogeneous coordinates Inverse vs. forward transform Composite transformation General transformation Model distortion with polynomial Least square solution 3 Questions Affine transformation vs. Perspective transformation Forward transformation vs. Inverse transformation Composite transformation vs. Sequential transformation Homogeneous coordinate General geometric transformations

Transcript of ECE 472/572 - Digital Image Processing -...

Page 1: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

1

ECE 472/572 - Digital Image Processing

Lecture 6 – Geometric and Radiometric Transformation 09/27/11

2

Roadmap

¬  Introduction –  Image format (vector vs. bitmap) –  IP vs. CV vs. CG –  HLIP vs. LLIP –  Image acquisition

¬  Perception –  Structure of human eye –  Brightness adaptation and Discrimination –  Image resolution

¬  Image enhancement –  Enhancement vs. restoration –  Spatial domain methods

•  Point-based methods –  Log trans. vs. Power-law –  Contrast stretching vs. HE –  Gray-level vs. Bit plane slicing –  Image averaging (principle)

•  Mask-based methods - spatial filter –  Smoothing vs. Sharpening filter –  Linear vs. Non-linear filter –  Smoothing (average vs. Gaussian vs. median) –  Sharpening (UM vs. 1st vs. 2nd derivatives)

–  Frequency domain methods •  Understanding Fourier transform •  Implementation in the frequency domain •  Low-pass filters vs. high-pass filters vs. homomorphic filter

¬  Geometric correction –  Affine vs. Perspective

transformation •  Homogeneous coordinates •  Inverse vs. forward transform •  Composite transformation

–  General transformation •  Model distortion with polynomial •  Least square solution

3

Questions

¬ Affine transformation vs. Perspective transformation

¬ Forward transformation vs. Inverse transformation

¬ Composite transformation vs. Sequential transformation

¬ Homogeneous coordinate ¬ General geometric transformations

Page 2: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

2

4

Usage

¬ Image correction ¬ Color interpolation ¬ Forensic analysis ¬ Entertainment effect

http://w3.impa.br/~morph/ http://www.mpi-sb.mpg.de/resources/FAM/demos.html

5

Affine transformations

¬ Preserve lines and parallel lines ¬ Homogeneous coordinates ¬ General form

¬ Special matrices –  R: rotation, S: scaling, T: translation, H: shear

!!!

"

#

$$$

%

&

100232221

131211

aaaaaa

R =

cosθ −sinθ 0sinθ cosθ 00 0 1

$

%

& & &

'

(

) ) )

,S =

sx 0 00 sy 00 0 1

$

%

& & &

'

(

) ) )

,T =

1 0 tx0 1 ty0 0 1

$

%

& & &

'

(

) ) )

,H =

1 hx 0hy 1 00 0 1

$

%

& & &

'

(

) ) )

uv1

"

#

$ $ $

%

&

' ' '

=

a11 a12 a13a21 a22 a230 0 1

"

#

$ $ $

%

&

' ' '

xy1

"

#

$ $ $

%

&

' ' '

6

Page 3: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

3

7

Composite vs. Sequential transformation

Original Image (f(x,y))

R H T S

Transformed Image (g(u, v))

uv1

"

#

$ $ $

%

&

' ' '

= S ⋅T ⋅H ⋅ R ⋅xy1

"

#

$ $ $

%

&

' ' '

RHTSC ⋅⋅⋅=

8

Forward vs. Inverse transforms

uv1

"

#

$ $ $

%

&

' ' '

= C ⋅xy1

"

#

$ $ $

%

&

' ' '

Forward transform

C−1

uv1

#

$

% % %

&

'

( ( (

=

xy1

#

$

% % %

&

'

( ( (

Inverse transform

9

Examples - Shear

hy = 0.2 hx = 0.2 hx = hy = 0.2

Page 4: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

4

10

Examples – Translation + Rotation

theta = PI/4 theta = PI/4 tx = -140, ty = 60

11

Perspective transformation

¬ Preserve parallel lines only when they are parallel to the projection plane. Otherwise, lines converge to a vanishing point

¬ General form

a11 a12 a13a21 a22 a23a31 a32 1

"

#

$ $ $

%

&

' ' '

" u " v " w

#

$

% % %

&

'

( ( (

=

a11 a12 a13a21 a22 a23a31 a32 1

#

$

% % %

&

'

( ( (

xy1

#

$

% % %

&

'

( ( (

,u =" u " w ,v =

" v " w

0,0 3231 ≠≠ aa

12

Determine the coefficients

8 unknowns, 4-point least squares

" u " v " w

#

$

% % %

&

'

( ( (

=

a11 a12 a13a21 a22 a23a31 a32 1

#

$

% % %

&

'

( ( (

xy1

#

$

% % %

&

'

( ( (

,u =" u " w ,v =

" v " w

(0,0) (0,255)

(255,0) (255,255)

(0,0) (0,255)

(255,0)

(511,511)

Page 5: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

5

13

Example - PT

14

General approaches

¬ Find tiepoints ¬ Spatial transformation

9/27/11 15

x-ray sensitive scintillator

fiber optics

CCD array 1242 x 1152

misalignment greater than 50 micron

Example – CCD butting

Page 6: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

6

9/27/11 16

Sources of distortions

¬ defects in the production of fiber-optic tapers

¬ imperfect compression and cutting ¬ different light transfer efficiency across the

whole surface

9/27/11 17

),(),( yxvuP =

),(),( yxvuT =

approximation

interpolation

),( yx ),( vu

control point

map exactly

map close

Geometric correction

18

Spatial transformation

¬ Bilinear equation

¬ n-th degree polynomial

¬ Use information from tiepoints to solve coefficients –  Exact solution –  Least square solution

ˆ x = r u,v( ) = a1u + a2v + a3uv + a4

ˆ y = s u,v( ) = b1u + b2v + b3uv + b4

ˆ x iˆ y i

"

# $ %

& ' =

Px (ui,vi)Py (ui,vi)"

# $

%

& ' =

akrsuirvi

s

bkrsuirvi

s

"

# $

%

& '

r+s= k∑

k= 0

d

∑−

=

−+−=1

0

22, ])ˆ()ˆ[(minm

iiiiiba yyxxε

Page 7: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

7

19

How is it applied?

¬  Step 1: Choose a set of tie points –  (xi,yi): coordinates of tie points in

the original (or distorted) image –  (ui,vi): coordinates of tie points in

the corrected image ¬  Step 2: Decide on which degree of

polynomial to use to model the inverse of the distortion, e.g.,

¬  Step 3: Solve the coefficients of the polynomial using least-squares approach

¬  Step 4: Use the derived polynomial model to correct the entire original image

X = x0 x1 x24[ ]T

Y = y0 y1 y24[ ]T

ˆ x = r u,v( ) = a1u + a2v + a3uv + a4

ˆ y = s u,v( ) = b1u + b2v + b3uv + b4

W =

u0 v0 u0v0 1u1 v1 u1v1 1 u24 v24 u24v24 1

"

#

$ $ $ $

%

&

' ' ' '

A = a1 a2 a3 a4[ ]T

B = b1 b2 b3 b4[ ]T

A =W −1X,B =W −1YW −1 = (W TW )−1W T

For each (u,v) in the corrected image, find the corresponding (x,y) in the original image and use its intensity as the intensity at (u,v).

20

Example – Geometric correction

¬ Geometric correction of images from butted CCD arrays

21

Example - Color correction

Tiepoints are colors (R, G, B), instead of spatial coordinates

Page 8: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

8

22

Example - Image warping

23

Image warping

¬ Two-pass mesh warping by Douglas Smythe

¬ Reference: G. Wolberg, Digital Image Warping, 1990

24

Example 1

From Joey Howell and Cory McKay, ECE472, Fall 2000

Page 9: ECE 472/572 - Digital Image Processing - UTKweb.eecs.utk.edu/~hqi/ece472-572/lecture06_geocorr.pdf · Lecture 6 – Geometric and Radiometric Transformation 09/27/11 2 Roadmap ! Introduction

9

25

Example 2

From Adam Miller, Truman Bonds, Randal Waldrop, ECE472, Fall 2000