28
Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring 2017 Slides modified from Marc Pollefeys, UNC Chapel Hill, Comp256, Other slides and illustrations from J. Ponce, addendum to course book, and Trevor Darrell, Berkeley, C280 Computer Vision Course.

Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Geometric Camera Calibration Chapter 2

Guido GerigCS 6643 Spring 2017

Slides modified from Marc Pollefeys, UNC Chapel Hill, Comp256, Other slides and illustrations from J. Ponce, addendum to course book, and Trevor Darrell, Berkeley, C280 Computer Vision Course.

Page 2: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Equation: World coordinates to image pixels

=

1.........

1

1 3

2

1

zW

yW

xW

T

T

T

ppp

mmm

zvu

pMz

p W 1=

PmPmv

PmPmu

⋅⋅

=

⋅⋅

=

3

2

3

1

pixel coordinatesworld coordinates

Conversion back from homogeneous coordinates leads to:

W. Freeman

Page 3: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Calibration target

http://www.kinetic.bc.ca/CompVision/opti-CAL.html

Find the position, ui and vi, in pixels, of each calibration object feature point.

Page 4: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Camera calibration

0)(0)(

32

31

=⋅−=⋅−

ii

ii

PmvmPmum

So for each feature point, i, we have:

PmPmv

PmPmu

⋅⋅

=

⋅⋅

=

3

2

3

1From before, we had these equations relating image positions,u,v, to points at 3-d positions P (in homogeneous coordinates):

W. Freeman

Page 5: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Camera calibration

0)(0)(

32

31

=⋅−=⋅−

ii

ii

PmvmPmum

Stack all these measurements of i=1…n points

into a big matrix:

=

−−

−−

00

00

00

00

3

2

1111

111

mmm

PvPPuP

PvPPuP

Tnn

Tn

T

Tnn

TTn

TTT

TTT

W. Freeman

Page 6: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

=

−−

−−

00

00

00

00

3

2

1111

111

mmm

PvPPuP

PvPPuP

Tnn

Tn

T

Tnn

TTn

TTT

TTT

=

−−−−−−−−

−−−−−−−−

00

00

1000000001

1000000001

34

33

32

31

24

23

22

21

14

13

12

11

1111111111

1111111111

mmmmmmmmmmmm

vPvPvPvPPPuPuPuPuPPP

vPvPvPvPPPuPuPuPuPPP

nnznnynnxnnznynx

nnznnynnxnnznynx

zyxzyx

zyxzyx

Showing all the elements:

In vector form:Camera

calibration

W. Freeman

Page 7: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

We want to solve for the unit vector m (the stacked one) that minimizes

2Qm

=

−−−−−−−−

−−−−−−−−

00

00

1000000001

1000000001

34

33

32

31

24

23

22

21

14

13

12

11

1111111111

1111111111

mmmmmmmmmmmm

vPvPvPvPPPuPuPuPuPPP

vPvPvPvPPPuPuPuPuPPP

nnznnynnxnnznynx

nnznnynnxnnznynx

zyxzyx

zyxzyx

Q m = 0

The eigenvector assoc. to the minimum eigenvalue of the matrix QTQ gives us that because it is the unit vector x that minimizes xT QTQ x.

Camera calibration

W. Freeman

Page 8: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Calibration Problem

Page 9: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Analytical Photogrammetry

Non-Linear Least-Squares Methods

• Newton• Gauss-Newton• Levenberg-Marquardt

Iterative, quadratically convergent in favorable situations

Page 10: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Homogeneous Linear Systems

A

A

x

x 0

0=

=

Square system:

• unique solution: 0

• unless Det(A)=0

Rectangular system ??

• 0 is always a solution

Minimize |Ax| under the constraint |x| =12

2

Page 11: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

How do you solve overconstrained homogeneous linear equations ??

The solution is e .1

remember: EIG(UTU)=SVD(U), i.e. solution is Vn

Page 12: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Matlab Solution

Example:60 point pairs

Page 13: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Degenerate Point Configurations

Are there other solutions besides M ??

• Coplanar points: (λ,µ,ν )=(Π,0,0) or (0,Π,0) or (0,0,Π )

• Points lying on the intersection curve of two quadricsurfaces = straight line + twisted cubic

Does not happen for 6 or more random points!

Page 14: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Once you have the M matrix, can recover the intrinsic and extrinsic parameters.

Camera calibration

W. Freeman

Estimation of the Intrinsic and Extrinsic Parameters, see pdf slides S.M. Abdallah.

Page 15: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Once M is known, you still got to recover the intrinsic andextrinsic parameters !!!

This is a decomposition problem, not an estimationproblem.

• Intrinsic parameters

• Extrinsic parameters

ρ

Presenter
Presentation Notes
Rho times b3 represents tz, -> sign of rho can be chosen based on plausibility
Page 16: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring
Page 17: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Orthogonality of r3 and r2

ρ is known -> calculate v0 via dot product of a2 and a3

Page 18: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Slide Samer M Abdallah, Beirut

Page 19: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Slide Samer M Abdallah, Beirut

Page 20: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Typical Result

Camera was roughly 72 cm up from thefloor, and 136 cm back from the pattern.

There is considerable rotation around the y axis (up) but the rotation around x and z was kept to a minimum.

Sensor:

Page 21: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Degenerate Point Configurations

Are there other solutions besides M ??

• Coplanar points: (λ,µ,ν )=(Π,0,0) or (0,Π,0) or (0,0,Π )

• Points lying on the intersection curve of two quadricsurfaces = straight line + twisted cubic

Does not happen for 6 or more random points!

Page 22: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Other Slides following Forsyth&Ponce

Just for additional information on previous slides

Page 23: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Linear Systems

A

A

x

x b

b=

=

Square system:

• unique solution

• Gaussian elimination

Rectangular system ??

• underconstrained:infinity of solutions

Minimize |Ax-b|2

• overconstrained:no solution

Page 24: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

How do you solve overconstrained linear equations ??

Page 25: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Homogeneous Linear Systems

A

A

x

x 0

0=

=

Square system:

• unique solution: 0

• unless Det(A)=0

Rectangular system ??

• 0 is always a solution

Minimize |Ax| under the constraint |x| =12

2

Page 26: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

How do you solve overconstrained homogeneous linear equations ??

The solution is e .1

remember: EIG(UTU)=SVD(U), i.e. solution is Vn

Page 27: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Linear Camera Calibration

Page 28: Geometric Camera Calibration Chapter 2engineering.nyu.edu/~gerig/CS-GY-6643-S2017/Materials/CS... · 2017-02-06 · Geometric Camera Calibration Chapter 2 Guido Gerig CS 6643 Spring

Useful Links

Demo calibration (some links broken):• http://mitpress.mit.edu/e-

journals/Videre/001/articles/Zhang/CalibEnv/CalibEnv.html

Bouget camera calibration SW:• http://www.vision.caltech.edu/bouguetj/

calib_doc/CVonline: Monocular Camera calibration:• http://homepages.inf.ed.ac.uk/cgi/rbf/C

VONLINE/entries.pl?TAG250