25
Camera Model & Camera Calibration Slides are from Marc Pollefeys @ETH

Camera Model & Camera Calibration Slides are from Marc Pollefeys @ETH

Embed Size (px)

Citation preview

Camera Model &

Camera Calibration

Slides are from Marc Pollefeys @ETH

TT ZfYZfXZYX )/,/(),,(

101

0

0

1

Z

Y

X

f

f

Z

fY

fX

Z

Y

X

Pinhole camera model

Pinhole camera model

101

0

0

Z

Y

X

f

f

Z

fY

fX

101

01

01

1Z

Y

X

f

f

Z

fY

fX

PXx

0|I)1,,(diagP ff

Principal point offset

Tyx

T pZfYpZfXZYX )/,/(),,(

principal pointT

yx pp ),(

101

0

0

1

Z

Y

X

pf

pf

Z

ZpfY

ZpfX

Z

Y

X

y

x

x

x

Principal point offset

101

0

0

Z

Y

X

pf

pf

Z

ZpfY

ZpfX

y

x

x

x

camX0|IKx

1y

x

pf

pf

K calibration matrix

Camera rotation and translation

C~

-X~

RX~

cam

X10

RCR

1

10

C~

RRXcam

Z

Y

X

camX0|IKx XC~

|IKRx

t|RKP C~

Rt PXx

CCD camera

1yx

xx

p

p

K

11y

x

x

x

pf

pf

m

m

K

Finite projective camera

1yx

xx

p

ps

K

1yx

xx

p

p

K

C~

|IKRP

non-singular

11 dof (5+3+3)

decompose P in K,R,C?

4p|MP 41pMC

~ MRK, RQ

{finite cameras}={P4x3 | det M≠0}

If rank P=3, but rank M<3, then cam at infinity

Camera matrix decomposition

Finding the camera center

0PC (use SVD to find null-space)

432 p,p,pdetX 431 p,p,pdetY

421 p,p,pdetZ 321 p,p,pdetTFinding the camera orientation and internal parameters

KRM (use RQ decomposition ~QR)

Q R=( )-1= -1 -1QR

(if only QR, invert)

Cameras at infinity

00

dP

Camera center at infinity

0Mdet

Affine and non-affine cameras

Definition: affine camera has P3T=(0,0,0,1)

Affine cameras

Camera calibration

ii xX ? P

Resectioning

Basic equations

ii PXx

ii PXx

0Ap

Basic equations

0Ap

minimal solution

Over-determined solution

5½ correspondences needed (say 6)

P has 11 dof, 2 independent eq./points

n 6 points

Ap

1p

1p̂3 3p̂P

minimize subject to constraint

Degenerate configurations

More complicate than 2D case

(i) Camera and points on a twisted cubic

(ii) Points lie on plane or single line passing through projection center

Less obvious

(i) Simple, as before

(ii) Anisotropic scaling

Data normalization

32

Geometric error

Gold Standard algorithmObjective

Given n≥6 2D to 2D point correspondences {Xi↔xi’}, determine the Maximum Likelyhood Estimation of P

Algorithm(i) Linear solution:

(a) Normalization: (b) DLT:

(ii) Minimization of geometric error: using the linear estimate as a starting point minimize the geometric error:

(iii) Denormalization:

ii UXX~ ii Txx~

UP~

TP -1

~ ~~

Calibration example

(i) Canny edge detection(ii) Straight line fitting to the detected edges(iii) Intersecting the lines to obtain the images corners

typically precision <1/10 (HZ rule of thumb: 5n constraints for n unknowns

Errors in the world

Errors in the image and in the world

ii XPx

iX

short and long focal length

Radial distortion

Correction of distortion

Choice of the distortion function and center

Computing the parameters of the distortion function(i) Minimize with additional unknowns(ii) Straighten lines(iii) …