CAMERA CALIBRATION INEL 6088 Computer Vision Ch. 18 Davies 4 th - - PowerPoint PPT Presentation

camera calibration
SMART_READER_LITE
LIVE PREVIEW

CAMERA CALIBRATION INEL 6088 Computer Vision Ch. 18 Davies 4 th - - PowerPoint PPT Presentation

CAMERA CALIBRATION INEL 6088 Computer Vision Ch. 18 Davies 4 th edition Ch. 12 Jain et. el. REFERENCES Discussion of Tsais calibration method by Berthold Horn Original paper by Roger Tsai Chapter 18 (21) on textbook by Davies, 4


slide-1
SLIDE 1

CAMERA CALIBRATION

INEL 6088 Computer Vision

  • Ch. 18 Davies 4th edition
  • Ch. 12 Jain et. el.
slide-2
SLIDE 2

REFERENCES

  • Discussion of Tsai’s calibration method by Berthold Horn
  • Original paper by Roger Tsai
  • Chapter 18 (21) on textbook by Davies, 4th(3rd) edition.
  • Chapter 12 on textbook by Jain et. al.
slide-3
SLIDE 3

3

WHAT IS CAMERA CALIBRATION?

  • Finding the camera parameters that affects the image

acquisition process.

  • Extrinsic Parameters
  • Define the location of the Camera reference frame

(CRF) with respect to a known world reference frame (WRF).

  • Intrinsic Parameters
  • Link the pixel coordinates to the corresponding

coordinates in the CRF

slide-4
SLIDE 4

4

WHAT IS CAMERA CALIBRATION?

  • Extrinsic Parameters
  • Rotation or Orientation
  • Translation
  • Perspective

Xw Yw Zw xc yc zc Pc Pw X0 Y0 Z0 w0 r

slide-5
SLIDE 5

Xw Yw Zw Zc Xc Yc Pw Pc R, T Relation between camera and world coordinate frames.

slide-6
SLIDE 6

EXTRINSIC PARAMETERS

  • Identify the transformation between the unknown

camera and known world reference frames.

  • 3-D translation vector, T, that relate the origins of

the two frames

  • 3×3 rotation matrix, R
  • rthogonal matrix (RTR=RRT=I)

brings axes of the two frames into each other Pc = R (Pw − T) Pc = RPw − T

slide-7
SLIDE 7

rx =   1 cψ −sψ sψ cψ   ry =   cϕ sϕ 1 −sϕ cϕ   rz =   cθ −sθ sθ cθ 1   R =   r11 r12 r13 r21 r22 r23 r31 r32 r33   = rxryrz =   cθcϕ −sθcϕ sϕ cθsψsϕ + cψsθ −sψsϕsθ + cψcθ −sψcϕ −cψsϕcθ + sψsθ cψsϕsθ + sψcθ cψcϕ  

Shorthand notation: ca = cos(a), sb = sin(b)

slide-8
SLIDE 8

  Xc Y c Zc   = R   Xw Y w Zw   + T

W to C: Rotation followed by translation

Xc = r11Xw + r12Y w + r13Zw + Tx Y c = r21Xw + r22Y w + r23Zw + Ty Xc = r31Xw + r32Y w + r33Zw + Tz

slide-9
SLIDE 9

W to C: Translation followed by rotation

  Xc Y c Zc   = R   Xw − Tx Y w − Ty Zw − Tz  

Xc = r11(Xw − Tx) + r12Y w + r13Zw Y c = r21Xw + r22(Y w − Ty) + r23Zw Zc = r31Xw + r32Y w + r33(Zw − Tz)

slide-10
SLIDE 10
  • ox, oy = Position of image centre (Principal Point)
  • Focal length f
  • dx, dy = pixel dimensions
  • k1 = radial distortion coefficient

INTRINSIC PARAMETERS

slide-11
SLIDE 11

Image sensor sizes Industrial cameras

Assume: ½ inch sensor (0.64cm×0.48cm) sampled as a 640x480 pixel image dx = 0.01mm/pixel = dy τ1 = 1 = no radial distortion x = τ1 dx (c - u0) = 0.01(c - 320) y = -dy (r - v0) = -0.01(r - 240)

u and v in mm

slide-12
SLIDE 12

Perspective Camera Model

x = f X Z y = f Y Z

Perspective camera model

x = f X ¯ Z y = f Y ¯ Z

Weak-perspective camera model (difference in distance to scene points is small compared to average distance)

slide-13
SLIDE 13

Ignoring the lenses’ geometric distortions and assuming that the CCD array is made of a rectangular grid of photosensitive elements, where (ox, oy) represent the coordinates of the image center (the principal point), and (dx, dy) the effective pixel size (in millimeters) in the horizontal and vertical directions, respectively. Transformation between Camera and Image frame coordinates Transformation between World and sensor coordinates R1, R2 and R3 are 3-D vectors formed by the 1st, 2nd and 3rd rows of matrix R , respectively.

x = dx(c − ox) y = −dy(r − oy)

Pc = RPw + T x = sx(xim − ox) = −f RT

1 Pw + T

RT

3 Pw + T

y = −sy(yim − oy) = −f RT

2 Pw + T

RT

3 Pw + T

slide-14
SLIDE 14
  • P = [ XW, YW, ZW] : point in 3-D world coordinates
  • p = [ xi, yi ] : point in the real image plane
  • x axis : horizontal, points to the right
  • y axis : vertical, points upward
  • a = [ r, c] : row, column pixel coordinates on the pixel array
  • r axis : vertical, points downward
  • c axis : horizontal, points to the right

CALIBRATION METHOD BY TSAI(1)

(1)Tsai, R. 1987. A versatile camera calibration technique for high-accuracy 3D machine vision metrology using

  • ff-the-shelf cameras and lenses. IEEE Trans. Robotics and Automation, v3(4).
slide-15
SLIDE 15

Move calibration to different positions

slide-16
SLIDE 16

10 12 8

Calibration pattern: 7 corners + 3 side-centered points

XW ZW YW

world reference frame xC yC zC virtual image plane camera reference frame

XW YW ZW 10 10 8 8 8 12 12 10 12 10 8 12 5 4 12 5 8 6 10 4 6

World coordinates (cm) Example setup (see tsai.sci) xi yi 10 9 8 7 6 5 4 3 2 1

slide-17
SLIDE 17

1 6 5 4 3 2 7 8 9 10 Image points are identified by number. Black lines indicate the transparent box “edges”. Face middle-points are indicated by the slotted lines to help in visualising the results. Result of the rotation 20◦,180◦ and 10◦ around x, y and z axes, plus translation and projection.

slide-18
SLIDE 18

The sensor coordinates (xi, yi) for the kth world point at (XW

k , Y W k , ZW k ) is

xi

k

= dx(ck − ox) = −f RT

1 P + tx

RT

3 P + tz

= −f r11XW

k + r12Y W k

+ r13ZW

k + tx

r31XW

k + r32Y W k

+ r33ZW

k + tz

yi

k

= −dy(rk − oy) = −f RT

2 P + ty

RT

3 P + tz

= −f r21XW

k + r22Y W k

+ r23ZW

k + ty

r31XW

k + r32Y W k

+ r33ZW

k + tz

xi

k

yi

k

= r11XW

k + r12Y W k

+ r13ZW

k + tx

r21XW

k + r22Y W k

+ r23ZW

k + ty

Cross-multiplying, xi

k(r21XW k + r22Y W k

+ r23ZW

k + ty) = yi k(r11XW k + r12Y W k

+ r13ZW

k + tx)

r21 ty xi

kXW k + r22

ty xi

kY W k

+ r23 ty xi

kZW k + xi k = r11

ty yi

kXW k + r12

ty yi

kY W k

+ r13 ty yi

kZW k + tx

ty yi

k

xi

k = r11

ty yi

kXW k + r12

ty yi

kY W k

+ r13 ty yi

kZW k + tx

ty yi

k − r21

ty xi

kXW k − r22

ty xi

kY W k

− r23 ty xi

kZW k

xi

k =

  • r11

ty r12 ty r13 ty tx ty r21 ty r22 ty r23 ty

  • yi

kXW k

yi

kY W k

yi

kZW k

yi

k

−xi

kXW k

−xi

kY W k

−xi

kZW k

slide-19
SLIDE 19

This equation, applied to N points, yields a matrix equation in terms of a row vector of image x coordinates x, a 7-element row vector containing the parameters, and a N-column, 7-row matrix M x = cM Since in general M is not square (more than 7 data points) c = xMt(MMt)−1 where the −1 exponent represents matrix inversion, and c = h

r11 ty r12 ty r13 ty tx ty r21 ty r22 ty r23 ty

i Since the R matrix is orthogonal, r2

11 + r2 12 + r2 13 = 1. This from the first 3

elements of c, c2

1 + c2 2 + c2 3 = r2 11 + r2 12 + r2 13

t2

y

= 1/t2

y

ty = ± 1 p c2

1 + c2 2 + c2 3

slide-20
SLIDE 20

r11 = c1ty; r12 = c2ty; r13 = c3ty tx = c4ty; r21 = c5ty; r22 = c6ty; r23 = c7ty To determine the sign of ty, observe that since the reference pattern must be in front of the camera, for a point p, xi

p and r11XW p + r12Y W p

+ r13ZW

p + tx

(which determines the sign of xc, the point’s horizontal coordinate in the camera reference frame) must have opposite signs. Thus if xi

p(r11XW p + r12Y W p

+ r13ZW

p + tx) > 0

the signs of first two rows of R and the first two components of T must be changed. To find the remaining rotation parameters, observe that since the 3 axes are

  • rthogonal and the rotation matrix rotates the original unit vectors,

R3 = R1 × R2 where R3, R1 and R2 are vectors formed from the rows of R and × represents the vector product.

slide-21
SLIDE 21

To find f and tz, go back to the equation for xi for an arbitrary point k xi

k = −f r11XW k + r12Y W k

+ r13ZW

k + tx

r31XW

k + r32Y W k

+ r33ZW

k + tz

rearrange the equation xi

k(r31XW k + r32Y W k

+ r33ZW

k + tz) = −f(r11XW k + r12Y W k

+ r13ZW

k + tx)

f(r11XW

k + r12Y W k

+ r13ZW

k + tx) + xi ktz = −xi k(r31XW k + r32Y W k

+ r33ZW

k )

and express it in vectorial form ⇥ r11XW

k + r12Y W k

+ r13ZW

k + tx,

xi

k

⇤  f tz

  • = −xi

k(r31XW k + r32Y W k

+ r33ZW

k )

Using the N points yields a matrix equation that can be solved for f and tz. A  f tz

  • = b

f tz

  • = (AtA)−1At b