single-view metrology many slides from s. seitz, d. hoiem magritte, personal values, 1952

34
Single-view metrology Many slides from S. Seitz, D. Hoi Magritte, Personal Values, 1952

Upload: grace-hart

Post on 19-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Single-view metrology

Many slides from S. Seitz, D. Hoiem

Magritte, Personal Values, 1952

Review: Camera projection matrix

111 3333231

2232221

1131211

Z

Y

X

trrr

trrr

trrr

y

x

yy

xx

PXx

intrinsic parameters

extrinsic parameters

world coordinate system

camera coordinate

system

Camera parameters

• Intrinsic parameters• Principal point coordinates• Focal length• Pixel magnification factors• Skew (non-rectangular pixels)• Radial distortion

111yy

xx

y

x

y

x

pf

pf

m

m

K

tRKP

Camera parameters

• Intrinsic parameters• Principal point coordinates• Focal length• Pixel magnification factors• Skew (non-rectangular pixels)• Radial distortion

• Extrinsic parameters• Rotation and translation relative to world coordinate system

tRKP

Camera calibration

1****

****

****

1Z

Y

X

y

x

XtRKx

Source: D. Hoiem

Camera calibration

• Given n points with known 3D coordinates Xi and known image projections xi, estimate the camera parameters

? P

Xi

xi

ii PXx

Camera calibration: Linear method

0PXx ii0

XP

XP

XP

1 3

2

1

iT

iT

iT

i

i

y

x

0

P

P

P

0XX

X0X

XX0

3

2

1

Tii

Tii

Tii

Ti

Tii

Ti

xy

x

y

Two linearly independent equations

Camera calibration: Linear method

• P has 11 degrees of freedom• One 2D/3D correspondence gives us two linearly

independent equations• Homogeneous least squares: find p minimizing ||Ap||2

• Solution given by eigenvector of ATA with smallest eigenvalue• 6 correspondences needed for a minimal solution

0pA0

P

P

P

X0X

XX0

X0X

XX0

3

2

1111

111

Tnn

TTn

Tnn

Tn

T

TTT

TTT

x

y

x

y

Camera calibration

• What if world coordinates of reference 3D points are not known?

• We can use scene features such as vanishing points

Vanishing point

Vanishing line

Vanishing point

Vertical vanishing point

(at infinity)

Slide from Efros, Photo from Criminisi

Recall: Vanishing points

image plane

line in the scene

vanishing point v

• All lines having the same direction share the same vanishing point

cameracenter

Computing vanishing points

• X∞ is a point at infinity, v is its projection: v = PX∞

• The vanishing point depends only on line direction

• All lines having direction D intersect at X∞

v

X0

133

22

11

tDX

tDX

tDX

tX

t

DtX

DtX

DtX

/1

/

/

/

33

22

11

03

2

1

D

D

D

X

Xt

Calibration from vanishing points

• Let us align the world coordinate system with three orthogonal vanishing directions in the scene:

v1

v3.

v2

Calibration from vanishing points

• p1 = P(1,0,0,0)T – the vanishing point in the x direction

• Similarly, p2 and p3 are the vanishing points in the y and z directions

• p4 = P(0,0,0,1)T – projection of the origin of the world coordinate system

• Problem: we can only know the four columns up to independent scale factors, additional constraints needed to solve for them

4321 ppppP

****

****

****

Calibration from vanishing points

• Let us align the world coordinate system with three orthogonal vanishing directions in the scene:

• Each pair of vanishing points gives us a constraint on the focal length and principal point

1

0

0

,

0

1

0

,

0

0

1

321 eee ii

i KRee

tRKv

0|

0,1 j

Tii

Ti eevKRe

011 j

TTij

TTTi vKKvvKRRKv

Calibration from vanishing points

Can solve for focal length, principal pointCannot recover focal length, principal point is the third vanishing point

Rotation from vanishing points

Thus,

Get λ by using the constraint ||ri||2=1.

ii

i KRee

tRKv

0|

1321111

0

0

1

][ rrrrRevK

.1ii rvK

Calibration from vanishing points: Summary• Solve for K (focal length, principal point) using three

orthogonal vanishing points• Get rotation directly from vanishing points once

calibration matrix is known

• Advantages• No need for calibration chart, 2D-3D correspondences• Could be completely automatic

• Disadvantages• Only applies to certain kinds of scenes• Inaccuracies in computation of vanishing points• Problems due to infinite vanishing points

Making measurements from a single image

http://en.wikipedia.org/wiki/Ames_room

Recall: Measuring height

1

2

3

4

55.3

2.8

3.3Camera height

O

Measuring height without a ruler

ground plane

Compute Z from image measurements• Need more than vanishing points to do this

Z

The cross-ratio• A projective invariant: quantity that does not change

under projective transformations (including perspective projection)

The cross-ratio• A projective invariant: quantity that does not change

under projective transformations (including perspective projection)• What are invariants for other types of transformations

(similarity, affine)?

• The cross-ratio of four points:

P1

P2

P3

P4

1423

2413

PPPP

PPPP

vZ

r

t

b

tvbr

rvbt

Z

Z

image cross ratio

Measuring height

B (bottom of object)

T (top of object)

R (reference point)

ground plane

HC

TBR

RBT

scene cross ratio

R

H

R

H

R

Measuring height without a ruler

RH

vz

r

b

t

R

H

Z

Z

tvbr

rvbt

image cross ratio

H

b0

t0

vvx vy

vanishing line (horizon)

2D lines in homogeneous coordinates

• Line equation: ax + by + c = 0

• Line passing through two points:

• Intersection of two lines:• What is the intersection of two parallel lines?

1

, where0 y

x

c

b

aT xlxl

21 xxl

21 llx

RH

vz

r

b

t

R

H

Z

Z

tvbr

rvbt

image cross ratio

H

b0

t0

vvx vy

vanishing line (horizon)

1 2 3 4

1

2

3

4

Measurements on planes

Approach: unwarp then measure

What kind of warp is this?

Image rectification

To unwarp (rectify) an image• solve for homography H given p and p′– how many points are necessary to solve for H?

pp′

Image rectification: example

Piero della Francesca, Flagellation, ca. 1455

Application: 3D modeling from a single image

J. Vermeer, Music Lesson, 1662

http://research.microsoft.com/en-us/um/people/antcrim/ACriminisi_3D_Museum.wmv

A. Criminisi, M. Kemp, and A. Zisserman, Bringing Pictorial Space to Life: computer techniques for the analysis of paintings, Proc. Computers and the History of Art, 2002

Application: 3D modeling from a single image

D. Hoiem, A.A. Efros, and M. Hebert, "Automatic Photo Pop-up", SIGGRAPH 2005.

http://www.cs.illinois.edu/homes/dhoiem/projects/popup/popup_movie_450_250.mp4

Application: Image editing

Inserting synthetic objects into images: http://vimeo.com/28962540

K. Karsch and V. Hedau and D. Forsyth and D. Hoiem, “Rendering Synthetic Objects into Legacy Photographs,” SIGGRAPH Asia 2011

Application: Object recognition

D. Hoiem, A.A. Efros, and M. Hebert, "Putting Objects in Perspective", CVPR 2006