CS4495/6495 Introduction to Computer Vision 3C-L3 Calibrating - - PowerPoint PPT Presentation

cs4495 6495
SMART_READER_LITE
LIVE PREVIEW

CS4495/6495 Introduction to Computer Vision 3C-L3 Calibrating - - PowerPoint PPT Presentation

CS4495/6495 Introduction to Computer Vision 3C-L3 Calibrating cameras Finally (last time): Camera parameters Projection equation the cumulative effect of all parameters: ' 1 0 0 0 f s x c R I


slide-1
SLIDE 1

3C-L3 Calibrating cameras

CS4495/6495 Introduction to Computer Vision

slide-2
SLIDE 2

3 1 3 1 3 3 3 3 1 3 1 3

' 1 ' 1 1 1 1 1

c x x x x c x x

f s x af y                                     

R I T M

projection intrinsics rotation translation

Finally (last time): Camera parameters

  • Projection equation – the cumulative effect of all parameters:

(3x4)

slide-3
SLIDE 3

* * * * * * * * * * * * 1 X sx Y sy Z s                                  

x M X

Finally (last time): Camera parameters

  • Projection equation – the cumulative effect of all parameters:
slide-4
SLIDE 4

Calibration

  • How to determine M?
slide-5
SLIDE 5

Calibration using known points

Place a known object in the scene

  • identify correspondence between image and scene
  • compute mapping from scene to image
slide-6
SLIDE 6

Resectioning

Estimating the camera matrix from known 3D points Projective Camera Matrix:

 

11 12 13 14 21 22 23 24 31 32 33 34

* * 1 p K R t P M P X w u m m m m Y w v m m m m Z w m m m m                                   

slide-7
SLIDE 7

Direct linear calibration - homogeneous

One pair of equations for each point

00 01 02 03 20 21 22 23 10 11 12 13 20 21 22 23 i i i i i i i i i i i i i i

u m v m X m Y m Z m m X m Y m Z m m X m Y m Z m X m Y m Z m              

00 01 02 03 10 11 12 13 20 21 22 23

* * 1 1

i i i i i i i

X u w m m m m Y v w v m m m m Z w m m m m u                                    

slide-8
SLIDE 8

Direct linear calibration - homogeneous

One pair of equations for each point

00 01 02 03 20 21 22 23 10 11 12 13 20 21 22 23 i i i i i i i i i i i i i i

u m v m X m Y m Z m m X m Y m Z m m X m Y m Z m X m Y m Z m              

20 21 22 23 00 01 02 03 20 21 22 23 10 11 12 13

( ) ( )

i i i i i i i i i i i i i i

u v m X m Y m Z m m X m Y m Z m m X m Y m Z m m X m Y m Z m              

slide-9
SLIDE 9

Direct linear calibration - homogeneous

One pair of equations for each point

20 21 22 23 00 01 02 03 20 21 22 23 10 11 12 13

( ) ( )

i i i i i i i i i i i i i i

u v m X m Y m Z m m X m Y m Z m m X m Y m Z m m X m Y m Z m              

00 10 02 03 10 11 12 13 20 21 22 23

m m m m m m m m m m m m

                         

slide-10
SLIDE 10

Direct linear calibration - homogeneous

  • This is a homogenous set of equations.
  • When over constrained, defines a least squares

problem – minimize

  • Since m is only defined up to scale, solve for unit

vector m*

  • Solution: m* = eigenvector of ATA with smallest

eigenvalue

  • Works with 6 or more points

Am

slide-11
SLIDE 11

Direct linear calibration - homogeneous

A m

2n × 12 12 2n

00 10 02 03 10 11 12 13 20 21 22 23

m m m m m m m m m m m m

                         

slide-12
SLIDE 12

The SVD (singular value decomposition) trick…

  • Find the m that minimizes 𝐵m subject to m =1.
  • Let 𝐵 = 𝑉𝐸𝑊𝑈 (singular value decomposition, D

diagonal, U and V orthogonal)

  • Therefor minimizing 𝑉𝐸𝑊𝑈m
  • But, 𝑉𝐸𝑊𝑈m = 𝐸𝑊𝑈m and m = 𝑊𝑈m
  • Thus minimize 𝐸𝑊𝑈m subject to 𝑊𝑈m = 𝟐
slide-13
SLIDE 13

The SVD (singular value decomposition) trick…

  • Thus minimize 𝐸𝑊𝑈m subject to 𝑊𝑈m = 𝟐
  • Let y = 𝑊𝑈m Now minimize 𝐸y subject

to y = 1.

  • But D is diagonal, with decreasing values.

So 𝐸y minimum is when y = 0,0,0 … , 0,1 𝑈

  • Since y = 𝑊𝑈m , m = 𝑊𝐳 since V orthogonal
  • Thus m = 𝑊𝐳 is the last column in V.
slide-14
SLIDE 14

The SVD (singular value decomposition) trick…

  • Thus m = 𝑊𝐳 is the last column in V.
  • And, the singular values of A are square roots of

the eigenvalues of ATA and the columns of V are the eigenvectors. (Show this? Nah…)

  • Recap: Given Am=0, find the eigenvector of ATA

with smallest eigenvalue, that’s m.

slide-15
SLIDE 15

Direct linear calibration - inhomogeneous

  • Another approach: 1 in lower r.h. corner for 11

d.o.f

00 01 02 03 10 11 12 13 20 21 22

1 1 1 X u m m m m Y v m m m m Z m m m                                

slide-16
SLIDE 16

Direct linear calibration - inhomogeneous

Dangerous if m23 is really (near) zero!

slide-17
SLIDE 17

Direct linear calibration (transformation)

Advantages:

  • Very simple to formulate and solve. Can be

done, say, on a problem set

  • These methods are referred to as “algebraic

error” minimization.

slide-18
SLIDE 18

Direct linear calibration (transformation)

Disadvantages:

  • Doesn’t directly tell you the camera parameters

(more in a bit)

  • Approximate: e.g. doesn’t model radial distortion
  • Hard to impose constraints (e.g., known focal

length)

  • Mostly: Doesn’t minimize the right error function
slide-19
SLIDE 19

Direct linear calibration (transformation)

For these reasons, prefer nonlinear methods:

  • Define error function E between projected 3D points

and image positions: E is nonlinear function of intrinsics, extrinsics, and radial distortion

  • Minimize E using nonlinear optimization techniques

e.g., variants of Newton’s method (e.g., Levenberg Marquart)

slide-20
SLIDE 20

Geometric Error

minimize ( ) ˆ ,

i i i

E x x d   

min ( , )

i i i

x d 

M

M X

Predicted Image locations

Xi xi

M

slide-21
SLIDE 21

“Gold Standard” algorithm (Hartley and Zisserman)

Objective Given n≥6 3D to 2D point correspondences {𝑌𝑗 ↔ 𝑦𝑗’}, determine the “Maximum Likelihood Estimation” of M

slide-22
SLIDE 22

“Gold Standard” algorithm (Hartley and Zisserman)

Algorithm (i) Linear solution: (a)(Optional) Normalization: (b) Direct Linear Transformation minimization (ii) Minimize geometric error: using the linear estimate as a starting point minimize the geometric error:

i i

 X UX

i i

x = Tx

min ( , )

i i i

d

M

X x M

slide-23
SLIDE 23

“Gold Standard” algorithm (Hartley and Zisserman)

(iii) Denormalization:

  • 1

M = T U M

slide-24
SLIDE 24

Finding the 3D Camera Center from M

  • M encodes all the parameters. So we should

be able to find things like the camera center from M.

  • Two ways: pure way and easy way
slide-25
SLIDE 25

Finding the 3D Camera Center from M

  • Slight change in notation. Let:

M is(3x4) – b is last column of M

  • The center C is the null-space camera of

projection matrix. So if find C such that: that will be the center. Really…

M C = 0

 

| M Q b 

slide-26
SLIDE 26

Finding the 3D Camera Center from M

  • Proof: Let X be somewhere between any point P and C

λ (1 λ)    X P C

slide-27
SLIDE 27

Finding the 3D Camera Center from M

  • Proof: Let X be somewhere between any point P and C
  • And the projection:

λ (1 λ)    X P C

λ (1 λ)     x M X M P M C

slide-28
SLIDE 28

Finding the 3D Camera Center from M

  • Proof: Let X be somewhere between any point P and C
  • And the projection:
  • For any P, all points on PC ray project on image of P, therefore

MC must be zero. So the camera center has to be in the null space.

λ (1 λ)    X P C

λ (1 λ)     x M X M P M C

slide-29
SLIDE 29

Finding the 3D Camera Center from M

  • Now the easy way. A formula! If M =[Q|b]

then:

1

1

        Q b C

slide-30
SLIDE 30

Alternative: multi-plane calibration

Images courtesy Jean-Yves Bouguet, Intel Corp.

slide-31
SLIDE 31

Alternative: multi-plane calibration

Advantages

  • Only requires a plane
  • Don’t have to know positions/orientations
  • Good code available online!
  • OpenCV library
  • Matlab version by Jean-Yves Bouget:

http://www.vision.caltech.edu/bouguetj/calib_doc/index.html

  • Zhengyou Zhang’s web site:

http://research.microsoft.com/~zhang/Calib/