camera parameters and calibration - vision...

30
Camera Parameters and Calibration

Upload: others

Post on 27-Aug-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Camera Parameters andCalibration

Page 2: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Camera parameters

UVW

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

=

Transformationrepresenting intrinsic parameters

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

1 0 0 00 1 0 00 0 1 0

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

Transformationrepresentingextrinsic parameters

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

XYZT

Ê

Ë

Á Á Á Á Á

ˆ

¯

˜ ˜ ˜ ˜ ˜

• From last time….

Page 3: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Homogeneous Coordinates(Again)

Page 4: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Extrinsic Parameters:Characterizing Camera position

Chasles's theorem:Any motion of a solid body can be composedof a translation and a rotation.

Page 5: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

3D Rotation Matrices

Page 6: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

3D Rotation Matrices cont’dEuler’s Theorem: An arbitrary rotation can bedescribed by 3 rotation parameters

R = For example:

More Generally:

Most General:

Page 7: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Rodrigue’s FormulaTake any rotation axis a and angle q: What is the matrix?

withR = eAq

Page 8: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Rotations can be represented aspoints in space (with care)

Turn vector lengthinto angle, directioninto axis:

Useful for generatingrandom rotations,understandingangular errors,characterizingangular position, etc.

Problem: not uniqueNot commutative

Page 9: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Other Properties of rotations

NOT CommutativeR1*R2 ≠ R2*R1

Page 10: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Rotations

x'=x1

x2

x3

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

=

x1 y1 z1

x2 y2 z2

x3 y3 z3

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

100

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

To form a rotation matrix, you can plug in thecolumns of new coordinate points

For Example: The unit x-vectorgoes to x’:

Page 11: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Other Properties of RotationsInverse: R-1 = RT

rows, columns are othonormal

riT rj = 0 if i≠j, else ri

T ri = 1

Determinant:

det( R ) = 1

The effect of a coordinate rotation on a function:

x’ = R x

F( x’ ) = F( R-1 x )

Page 12: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Extrinsic Parametersp’ = R p + t

R = rotation matrix

t = translation vector

In Homogeneous coordinates,

p’ = R p + t =>

x 'y 'z'1

È

Î

Í Í Í Í

˘

˚

˙ ˙ ˙ ˙

=

r11 r12 r13 tx

r21 r22 r23 tyr31 r32 r33 tz

0 0 0 1

È

Î

Í Í Í Í

˘

˚

˙ ˙ ˙ ˙

xyz1

È

Î

Í Í Í Í

˘

˚

˙ ˙ ˙ ˙

Page 13: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Intrinsic Parameters

u* Suv * Sv

1

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

=

Su 0 00 Sv 00 0 1

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

uv1

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

Differential Scaling

u + u0

v + v0

1

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

=

1 0 u0

0 1 v0

0 0 1

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

uv1

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

Camera OriginOffset

Page 14: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

˙˙˙

˚

˘

ÍÍÍ

Î

È -

100

001

010

˙˙˙

˚

˘

ÍÍÍ

Î

È

100

020

002

˙˙˙

˚

˘

ÍÍÍ

Î

È0

10101001

• Rotation –90o

• Scaling *2

• Translation

˙˙˙

˚

˘

ÍÍÍ

Î

È

1yx

p =

House Points

2D Example

Page 15: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

The Whole (Linear)Transformation

UVW

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

=

- f ⋅ su 0 u0

0 - f ⋅ sv v0

0 0 1

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

100

010

001

000

È

Î

Í Í Í

˘

˚

˙ ˙ ˙

r11 r12 r13 tx

r21 r22 r23 ty

r31 r32 r33 tz

0 0 0 1

È

Î

Í Í Í Í

˘

˚

˙ ˙ ˙ ˙

xyzT

È

Î

Í Í Í Í

˘

˚

˙ ˙ ˙ ˙

UVW

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

=

Transformationrepresenting intrinsic parameters

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

1 0 0 00 1 0 00 0 1 0

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

Transformationrepresentingextrinsic parameters

Ê

Ë

Á Á Á

ˆ

¯

˜ ˜ ˜

XYZT

Ê

Ë

Á Á Á Á Á

ˆ

¯

˜ ˜ ˜ ˜ ˜

u =U/W

v =U/W

Final imagecoordinates

Page 16: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Non-linear distortions(not handled by our treatment)

Page 17: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Camera Calibration

• You need to know something beyond whatyou get out of the camera– Known World points (object)

• Traditional camera calibration• Linear and non-linear parameter estimation

– Known camera motion• Camera attached to robot• Execute several different motions

– Multiple Cameras

Page 18: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman
Page 19: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Classical Calibration

Page 20: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Camera Calibration

Take a known set of points.

Typically 3 orthogonalplanes.

Treat a point in the object asthe World origin

Points x1, x2, x3,

Project to y1,y2,y3

Page 21: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Calibration Patterns

Page 22: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Classical CalibrationPut the set of points knownobject points xi into a matrix

X = x1 L xn[ ]

And projected points ui intoa matrix

U = u1 L un[ ]

U = P XUX t = P (XX t )UX t (XX t )-1 = P (XX t )(XX t )-1

UX t (XX t )-1 = P

Odd derivation of the Least Squares solution:

Solve for the transformation matrix:

Next extract extrinsic and intrinsic parameters from P

Note this is onlyfor instructionalpurposes. It doesnot work as a realprocedure.

Page 23: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Real Calibration

• Real calibration procedures look quitedifferent– Weight points by correspondence quality– Nonlinear optimization– Linearizations– Non-linear distortions– Etc.

Page 24: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

CameraMotion

Page 25: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Calibration Example(Zhang, Microsoft)

8 Point matches manually pickedMotion algorithm used to calibrate camera

Page 26: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

ApplicationsImage based rendering: Light field -- Hanrahan (Stanford)

Page 27: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Virtualized Reality

Page 28: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Projector-based VRUNC Chapel Hill

Page 29: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Shader Lamps

Page 30: Camera Parameters and Calibration - Vision Labsvision.psych.umn.edu/users/schrater/schrater_lab/courses/... · 2003. 2. 1. · Shape recovery without calibration Fitzgibbons, Zisserman

Shape recovery without calibrationFitzgibbons, Zisserman

Fully automatic procedure: Converting the images to 3Dmodels is a black-box filter: Video in, VRML out.* We don't require that the motion be regular:the angle between views can vary, and it doesn't have to beknown. Recovery of the angle is automatic, and accuracy isabout 40 millidegrees standard deviation. In golfing terms,that's an even chance of a hole in one.* We don't use any calibration targets: featureson the objects themselves are used to determine where thecamera is, relative to the turntable. Aside from being easier,this means that there is no problem with the setup changingbetween calibration and acquisition, and that anyone canuse the software without special equipment.

For example, this dinosaur sequence was supplied to us bythe University of Hannover without any other information.(Actually, we do have the ground-truth angles so that wecan make the accuracy claims above, but of course these arenot used in the reconstruction).