geometric transformations and image warpinggerig/cs6640-f2014/materials/... · 101 image mosaicing...

101
1 Geometric Transformations and Image Warping Ross Whitaker modified by Guido Gerig SCI Institute, School of Computing University of Utah

Upload: others

Post on 26-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

1

Geometric Transformations

and Image Warping

Ross Whitaker

modified by Guido Gerig

SCI Institute, School of Computing

University of Utah

Page 2: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

3

Geom Trans: Distortion From

Optics

Barrel Distortion Pincushion Distortion

Page 3: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Radial Distortion

magnification/focal length different for different angles of inclination

Can be corrected! (if parameters are know)

pincushion

(tele-photo)

barrel

(wide-angle)

Page 4: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

5

Geom Trans: Distortion From

Optics

Page 5: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

6

Geom. Trans.: Brain

Template/Atlas

Brain Atlas with annotationsTBI Patient

(Traumatic Brain Insury)

Page 6: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

7

Geom. Trans.: Mosaicing

Page 7: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

9

Page 8: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

11

Domain Mappings

f g

f g

Page 9: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

12

No Inverse?

f g

f g

Not “one to

one”

Not “onto” -

doesn’t

cover f

Page 10: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

13

Page 11: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

14

Transformation Examples

• Linear

Page 12: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

15

Page 13: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

16

Page 14: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

17

Page 15: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

18

Page 16: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

19

Page 17: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

20

Transformation Examples

• Linear

Page 18: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

21

Transformation Examples

• Linear

• Trick: Add one dimension

𝐴 =1 0 𝑥00 1 𝑦00 0 1

Example: Translation

𝑥′ = 𝑥 + 𝑥0𝑦′ = 𝑦 + 𝑦01 = 1

Page 19: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

22

Transformation Examples

• Linear

• Homogeneous coordinates

Page 20: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

23

Page 21: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

24

Page 22: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

25

Special Cases of Linear

• Translation

• Rotation

• Rigid = rotation + translation

• Scaling

– Include forward and backward rotation for arbitary axis

• Skew

• Reflection

p, q < 1 : expand

Page 23: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

27

Page 24: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Cascading of Transformations

28

Excellent Introduction Materials (MIT):

http://groups.csail.mit.edu/graphics/classes/6.837/F01/Lecture07/

Demo:

http://groups.csail.mit.edu/graphics/classes/6.837/F01/Lecture07/Slide09.html

Page 25: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

29Link: http://groups.csail.mit.edu/graphics/classes/6.837/F01/Lecture07/Slide01.html

Page 26: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

30

Linear Transformations

• Also called “affine”

– 6 parameters

• Rigid -> 3 parameters

• Invertibility

– Invert matrix

• What does it mean if A is not invertible?

Page 27: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

31

Page 28: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

32

Page 29: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

33

Page 30: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

34

Page 31: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

35

Implementation – Two

Approaches1. Pixel filling – backward mapping

• T() takes you from coords in g() to coords in f()

• Need random access to pixels in f()

• Sample grid for g(), interpolate f() as needed

f g

Interpolate

from

nearby grid

points

Page 32: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

36

Interpolation: Binlinear

• Successive application of linear

interpolation along each axis

Source: WIkipedia

Page 33: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

37

Binlinear Interpolation

• Not linear in x, y

Page 34: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

38

Binlinear Interpolation

• Convenient form

– Normalize to unit grid [0,1]x[0,1]

• Bilinear is NONLINEAR in x and y !

Page 35: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

39

Implementation – Two

Approaches2. Splatting – forward mapping

• T-1() takes you from coords in f() to coords in g()

• You have f() on grid, but you need g() on grid

• Push grid samples onto g() grid and do

interpolation from unorganized data (kernel)

f g

Nearby points

are not

organized –

”scattered”

?

Page 36: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

40

Page 37: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

42

Shepard’s Method

Implementation• If points are dense enough

– Truncate kernel

– For each point in f()

• Form a small box around it in g() – beyond

which truncate

• Put weights and data onto grid in g()

– Accumulate contributions at grid g()

– Divide total data by total weights: B/A

g

Data and weights

accumulated here

Page 38: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

43

Page 39: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

44

Determine Transformations

• All polynomials of (x,y)

• Any vector valued function with 2 inputs

• How to construct transformations?

– Define form or class of a transformation

– Choose parameters within that class

• Rigid - 3 parameters (T,R)

• Affine - 6 parameters

Page 40: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

45

Correspondences

• Also called “landmarks” or “fiducials”

Page 41: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

46

Page 42: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

47

Page 43: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

48

Transformations/Control Points

Strategy

1. Define a functional representation for

T with k parameters (B)

2. Define (pick) N correspondences

3. Find B so that

4. If overconstrained (K < 2N) then solve

Page 44: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

49

Page 45: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Example

50

Page 46: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Example ctd.

51

Page 47: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

52

Example: Quadratic

Transformation

Denote

Correspondences must match

Note: these equations are linear in the unkowns

Page 48: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

53

Write As Linear System

A – matrix that depends on the (unprimed)

correspondences and the transformation

x – unknown parameters of the

transformation

b – the primed correspondences

Page 49: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

54

Linear Algebra Background

Simple case: A is square (M=N) and invertible (det[A] not zero)

Numerics: Don’t find A inverse. Use Gaussian elimination or

some kind of decomposition of A

Page 50: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

55

Linear Systems – Other

Cases• M<N or M = N and the equations are

degenerate or singular

– System is underconstrained – lots of solutions

• Approach

– Impose some extra criterion on the solution

– Find the one solution that optimizes that criterion

– Regularizing the problem

Page 51: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

56

Linear Systems – Other

Cases

• M > N

– System is overconstrained

– No solution

• Approach

– Find solution that is best compromise

– Minimize squared error (least squares)

Page 52: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

57

Solving Least Squares

Systems

• Psuedoinverse (normal equations)

– Issue: often not well conditioned (nearly

singular)

• Alternative: singular value

decomposition SVD

Page 53: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

58

Singular Value Decomposition

Invert matrix A with SVD

Page 54: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

59

SVD for Singular Systems

• If a system is singular, some of the w’s will be zero

• Properties:

– Underconstrained: solution with shortest overall length

– Overconstrained: least squares solution

Page 55: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Landmark-free Image

Registration

• Use “image match” function between

source and transformed target image to

calculate transformation parameters.

• Common: SSD between target and

transformed source images:

60

𝛽𝑎𝑟𝑔𝑚𝑖𝑛

[

𝑖=1

𝑝𝑖𝑥𝑒𝑙𝑠

(𝐼′ 𝑥𝑖 − 𝑇(𝛽, 𝐼 𝑥𝑖 )2

Page 56: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Concept via Joint Histograms:

Intensity similarity btw transformed

imagesImages Aligned Translated by 0 to 20 pixels

Misalignment causes dispersion

Courtesy Lydia NG, SPIE 2006: Medical Image Analysis with ITK , February 11, 2006

Page 57: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Choices: Linear/NonlinearOriginal Rigid Elastic

rigid: ‘Mirit’

(F.Maes)

elastic: ‘Demons’

(J.P. Thirion)

Target

Subject 1

Subject 2

Page 58: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Example Nonlinear B-Spline warping

IRTK Software (Image Registration Toolkit,

Daniel Rueckert, Imperial College:

http://www.doc.ic.ac.uk/~dr/software/

Source image(Baseline DTI image)

Target image(T1w MRI)

Page 59: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

SPECIFYING “WARPS” VIA

SPARSE SET OF LANDMARKS

64

Page 60: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

65

Specifying Warps – Another Strategy

• Let the # DOFs in the warp equal the # of

control points (x1/2)

– Interpolate with some grid-based interpolation

• E.g. binlinear, splines

Page 61: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

66

Landmarks Not On Grid

• Landmark positions driven by application

• Interpolate transformation at unorganized

correspondences

– Scattered data interpolation

• How do we do scattered data interpolation?

– Idea: use kernels!

• Radial basis functions

– Radially symmetric functions of distance to

landmark

Page 62: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Concept

67

Page 63: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Concept

68

Warping a Neuro-Anatomy Atlas on 3D MRI Data with Radial Basis Functions

H.E. Bennink, J.M. Korbeeck, B.J. Janssen, B.M. ter Haar Romeny

Page 64: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Concept

69

Page 65: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

RBF Formulation

• Please see Gerig handouts for

formulation

70

Page 66: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

78

RBF Warp – Example

Page 67: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

79

What Kernel Should We Use

• Gaussian

– Variance is free parameter – controls

smoothness of warp

s2.5 s2.0 s1.5

From: Arad et al. 1994

Page 68: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

80

RBFs – Aligning Faces

Mona Lisa – Target Venus – Source Venus – Warped

Page 69: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Symmetry?

81

Image-based Talking Heads using Radial Basis

Functions James D. Edge and Steve Maddock

Page 70: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Symmetry?

What can we say about symmetry: A-

>B and B->A ?

82

Page 71: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Application

• Modeling of lip

motion in

speech with

few landmarks.

• Synthesis via

motion of

landmarks.

83

Page 72: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

85

Application: Image Morphing

• Combine shape and intensity with time

parameter t

– Just blending with amounts t produces “fade”

– Use control points with interpolation in t

– Use c1, c(t) landmarks to define T1, and c2,c(t)

landmarks to define T2

Page 73: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

86

Image Morphing

• Create from blend of two warped

images

T2

T1

I1 It I2

Page 74: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

87

Image Morphing

Page 75: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

88

Application: Image

Templates/Atlases

• Build image templates that capture statistics

of class of images

– Accounts for shape and intensity

– Mean and variability

• Purpose

– Establish common coordinate system (for

comparisons)

– Understand how a particular case compares to the

general population

Page 76: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

89

Templates – Formulation

• N landmarks over M different

subjects/samples

Images

Correspondences

Mean of correspondences

(template)

Transformations from mean to subjects Templated image

Page 77: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

90

Cars

Page 78: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

91

Car Landmarks and Warp

Page 79: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

92

Car Landmarks and Warp

Page 80: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

93

Car Mean

Page 81: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

94

Cars

Page 82: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

95

Cats

Page 83: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

96

Brains

Page 84: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

97

Brain Template

Page 85: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

APPLICATIONS

98

Page 86: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

99

Warping Application: Lens

Distortion

• Radial transformation – lenses are

generally circularly symmetric

– Optical center is known

– Model of transformation:

Page 87: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

100

Correspondences

• Take picture of known grid – crossings

• Measure set of landmark pairs →

Estimate transformation, correct images

Page 88: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

101

Image Mosaicing

• Piecing together images to create a larger mosaic

• Doing it the old fashioned way– Paper pictures and tape

– Things don’t line up

– Translation is not enough

• Need some kind of warp

• Constraints– Warping/matching two regions of two different

images only works when…

Page 89: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Applications

102

Page 90: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

Microscopy (Morane Eye Inst,

UofU, T. Tasdizen et al.)

103

Page 91: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

104

Page 92: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

105

Special Cases

• Nothing new in the scene is uncovered in one

view vs another

– No ray from the camera gets behind another

1) Pure rotations–arbitrary scene 2) Arbitrary views of planar surfaces

Page 93: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

106

3D Perspective and Projection

• Camera model

z

x

y

f

Image

coordinates

Page 94: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

107

Perspective Projection

Properties

• Lines to lines (linear)

• Conic sections to conic sections

• Convex shapes to convex shapes

• Foreshortening

Page 95: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

108

Image Homologies

• Images taken under cases 1,2 are

perspectively equivalent to within a

linear transformation

– Projective relationships – equivalence is

Page 96: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

109

Transforming Images To Make

MosaicsLinear transformation with matrix P

Perspective equivalence Multiply by denominator and reorganize terms

Linear system, solve for P

Page 97: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

110

Image Mosaicing

Page 98: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

111

4 Correspondences

Page 99: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

112

5 Correspondences

Page 100: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

113

6 Correspondences

Page 101: Geometric Transformations and Image Warpinggerig/CS6640-F2014/Materials/... · 101 Image Mosaicing • Piecing together images to create a larger mosaic • Doing it the old fashioned

114

Mosaicing Issues

• Need a canvas (adjust

coordinates/origin)

• Blending at edges of images (avoid

sharp transitions)

• Adjusting brightnesses

• Cascading transformations