Camera Calibration (Compute Camera Matrix P) Shao-Yi Chien - - PowerPoint PPT Presentation

camera calibration
SMART_READER_LITE
LIVE PREVIEW

Camera Calibration (Compute Camera Matrix P) Shao-Yi Chien - - PowerPoint PPT Presentation

Camera Calibration (Compute Camera Matrix P) Shao-Yi Chien Department of Electrical Engineering National Taiwan University Fall 2019 1 Outline Camera calibration [Slides credit: Marc Pollefeys] 2 Resectioning X P ? x i


slide-1
SLIDE 1

Camera Calibration (Compute Camera Matrix P)

簡韶逸 Shao-Yi Chien Department of Electrical Engineering National Taiwan University Fall 2019

1

slide-2
SLIDE 2

Outline

  • Camera calibration

2

[Slides credit: Marc Pollefeys]

slide-3
SLIDE 3

i i

x X 

? P

Resectioning

slide-4
SLIDE 4

i i

PX x 

 

i i PX

x

Ap 

Basic Equations

X

slide-5
SLIDE 5

Ap 

minimal solution Over-determined solution  5½ correspondences needed (say 6) P has 11 dof, 2 independent eq./points

n  6 points Ap

minimize subject to constraint

1 p  1 p ˆ 3 

3

p ˆ

 P

Basic Equations

  • r
slide-6
SLIDE 6

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

Degenerate Configurations

slide-7
SLIDE 7

Less obvious (i) Simple, as before (ii) Anisotropic scaling

3 2

Data Normalization

slide-8
SLIDE 8

Extend DLT to lines

i

l PT  

i i 1 TPX

l

(back-project line)

i i 2 TPX

l

(2 independent eq.)

Line Correspondences

slide-9
SLIDE 9

Geometric Error

slide-10
SLIDE 10

Gold Standard Algorithm

Objective 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:

i i

UX X ~ 

i i

Tx x ~ 

U P ~ T P

  • 1

~ ~ ~

slide-11
SLIDE 11

(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

Calibration Example

slide-12
SLIDE 12

Errors in the image and in the world

i i

X P x  

Errors in the World

slide-13
SLIDE 13

 

2

) x ˆ , x ( ˆ

i i i id

w

 

i i i i

y x w PX 1 , ˆ , ˆ ˆ 

P) depth(X; p ˆ ˆ

3

 

i

w ) X ˆ , X ( ~ ) x ˆ , x ( ˆ

i i i i i

fd d w then 1 p ˆ if therefore,

3 

Geometric Interpretation of Algebraic error

slide-14
SLIDE 14

note that in this case algebraic error = geometric error

Estimation of Affine Camera

Last row = (0, 0, 0, 1)

slide-15
SLIDE 15

Objective Given n≥4 2D to 2D point correspondences {Xi↔xi’}, determine the Maximum Likelyhood Estimation of P (remember P3T=(0,0,0,1)) Algorithm (i) Normalization: (ii) For each correspondence (iii) solution is (iv) Denormalization:

i i

UX X ~ 

i i

Tx x ~ 

U P ~ T P

  • 1

b p A

8 8

 b A p

8 8 

Gold Standard Algorithm

slide-16
SLIDE 16

Minimize geometric error impose constraint through parametrization Image only 9  2n, otherwise 3n+9  5n

Find best fit that satisfies

  • skew s is zero
  • pixels are square
  • principal point is known
  • complete camera matrix K is known

Minimize algebraic error assume map from param q  P=K[R|-RC], i.e. p=g(q) minimize ||Ag(q)||

Restricted Camera Estimation

slide-17
SLIDE 17

One only has to work with 12x12 matrix, not 2nx12

p A ~ Ap A p Ap

T T

 

Reduced Measurement Matrix

^

slide-18
SLIDE 18

Initialization

  • Use general DLT
  • Clamp values to desired values, e.g. s=0, x= y

Note: can sometimes cause big jump in error Alternative initialization

  • Use general DLT
  • Impose soft constraints
  • gradually increase weights

Restricted Camera Estimation

slide-19
SLIDE 19

Calibrated camera, position and orientation unkown  Pose estimation 6 dof  3 points minimal (4 solutions in general)

Exterior Orientation

slide-20
SLIDE 20
slide-21
SLIDE 21

ML residual error Example: n=197, =0.365, =0.37

Covariance Estimation

slide-22
SLIDE 22

short and long focal length

Radial Distortion

slide-23
SLIDE 23
slide-24
SLIDE 24

෤ 𝑦, ෤ 𝑧: non-distorted projection 𝑦𝑒, 𝑧𝑒: distorted projection

slide-25
SLIDE 25

Choice of the distortion function and center

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

Correction of Distortion

: interior parameters

slide-26
SLIDE 26

Correction of Distortion

After radial correction

slide-27
SLIDE 27

Another Method of Calibration

  • Notation
  • Homography between the model plane and its

image

29

Ref: Zhengyou Zhang, “Flexible camera calibration by viewing a plane from unknown orientations,” ICCV1999.

K

slide-28
SLIDE 28

Another Method of Calibration

  • Constraints on the intrinsic parameters

30

r1 and r2 are orthonormal 

slide-29
SLIDE 29

Another Method of Calibration

  • Close-form solution
  • Let

31

slide-30
SLIDE 30

Another Method of Calibration

  • Close-form solution
  • From the two constraints on the intrinsic parameters
  • V is a 2n x 6 matrix, if 𝑜 ≥ 3, we will have in general a

unique solution b defined up to a scale factor. Once b is estimated, we can compute the camera intrinsic matrix A.

32

slide-31
SLIDE 31

Calibration Procedure

33

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

slide-32
SLIDE 32

Calibration Procedure

34

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

slide-33
SLIDE 33

Calibration Procedure

35

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

slide-34
SLIDE 34

Calibration Procedure

36

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

  • If the location of the corners are not correct 

adjust radial distortion manually

slide-35
SLIDE 35

Calibration Procedure

37

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

slide-36
SLIDE 36

Calibration Procedure

38

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