CAMERA CALIBRATION
INEL 6088 Computer Vision
- Ch. 18 Davies 4th edition
- Ch. 12 Jain et. el.
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
3
4
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)
Xc = r11Xw + r12Y w + r13Zw + Tx Y c = r21Xw + r22Y w + r23Zw + Ty Xc = r31Xw + r32Y w + r33Zw + Tz
u and v in mm
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)
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
(1)Tsai, R. 1987. A versatile camera calibration technique for high-accuracy 3D machine vision metrology using
Move calibration to different positions
10 12 8
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
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.
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 =
ty r12 ty r13 ty tx ty r21 ty r22 ty r23 ty
kXW k
yi
kY W k
yi
kZW k
yi
k
−xi
kXW k
−xi
kY W k
−xi
kZW k
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
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
R3 = R1 × R2 where R3, R1 and R2 are vectors formed from the rows of R and × represents the vector product.
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
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
f tz