Professional Documents
Culture Documents
Camera Calibration
Camera Calibration
Focal length Different scaling factors for row pixels and column pixels Skew factor Lens distortion (pin-cushion effect)
Motivation
Good calibration is important when we need to
Reconstruct a world model: Virtual L.A. project Interact with the world
Robot, hand-eye coordination
Image plane
Evaluation of position of a square for 2 focal lengths (red and blue projection geometry)
CCD/ CMOS
Principal planes
Image plane for equivalent pinhole camera is not camera image plane
f C
Center of Projection
Variety of Techniques
VERY large literature on the subject Work of Roger Tsai influential Linear algebra method described here
Can be used as initialization for iterative non linear methods.
Calibration Procedure
Calibration target: 2 planes at right angle with checkerboard patterns (Tsai grid)
We know positions of pattern corners only with respect to a coordinate system of the target We position camera in front of target and find images of corners We obtain equations that describe imaging and contain internal parameters of camera
As a side benefit, we find position and orientation of camera with respect to target (camera pose)
Central Projection
If world and image points are represented by homogeneous vectors, central projection is a linear transformation:
xs xi = f zs ys yi = f zs
u f v = 0 w 0
0 f 0
xs 0 0 ys 0 0 zs 1 0 1
y x
xi = u / w, yi = v / w
center of projection
C f
x xpix
x0
xs xi = f zs ys yi = f zs
u ' x 0 v' = 0 y w' 0 0 x0 y0 1 xs 0 ys 0 with zs 0 1
x pix y pix
xs + zs x0 = k x xi + x0 = f k x zs y s + z s y0 = k y yi + y0 = f k y zs
x pix = u ' / w'
then
x = f kx y = f ky
x and y focal lengths in pixels x0 and y0 coordinates of image center in pixels Added parameter s is skew parameter K is called calibration matrix. Five degrees of freedom. K is a 3x3 upper triangular matrix
Y (xs , ys , zs ) M (Xs , Ys , Z s ) O
CO = T translation vector J K CM = CO + OM xS i + y S j + zS k = Tx i + Ty j + Tz k + X S I + YS J + Z S K
Homogeneous Coordinates
xS Tx I.i J.i K.i X S y = T + I.j J.j K.j Y S y S z S Tz I.k J.k K.k Z S xS I.i y I.j S = z S I.k 1 0 Tx X S Ty YS J.k K.k Tz Z S 0 0 1 1 J.i J.j K.i K.j xS y S = R z S 0 T 3 1 X S T YS Z 1 S 1
CM = OM - OC
xS i + yS j + z S k = ( X S - X C ) I + (YS - YC ) J + ( Z S - Z C ) K
~ (T = -R C)
Homogeneous Coordinates 2
~ Here we use - R C instead of T
xS y S = R z S 0 T 3 1
XS ~ - R C YS 1 ZS 1
xS y S = R z S 0 T 3 1
XS ~ - R C YS 1 ZS 1
x = PX
Properties of Matrix P
Further simplification of P:
x = K [I 3 R | 0 3 ] T 0 3 ~ - R C X 1
[I 3
R | 0 3 ] T 0 3
~ x = K R I3 | -C X ~ P = K R I3 | - C
~ - R C ~ ~ = R - R C = R I3 | -C 1
] [
P has 11 degrees of freedom: ~ 5 from triangular calibration matrix K, 3 from R and 3 from C P is a fairly general 3 x 4 matrix left 3x3 submatrix KR is non-singular
Calibration
1. Estimate matrix P using scene points and their images 2. Estimate the interior parameters and the exterior parameters
~ P = K R I3 | - C
~ | -C
1 0 0 0 1 0 0 0 1
X c 0 X c Yc = 0 Yc Z c 0 Zc 1 0
Any non-singular square matrix M can be decomposed into the product of an uppertriangular matrix K and an orthogonal matrix R using the RQ factorization
Similar to QR factorization but order of 2 matrices is reversed
RQ Factorization of M
1 0 0 c' 0 s ' c' ' s' ' 0 R x = 0 c s , R y = 0 1 0 , R z = s ' ' c' ' 0 0 s c s ' 0 c' 0 0 1
M RxR yR z = K M = K R TRTRT = K R z y x
Computing Matrix P
Use corresponding image and scene points
3D points Xi in world coordinate system Images xi of Xi in image
Write xi = P Xi for all i Similar problem to finding projectivity matrix H (i.e. homography) in homework
Improved Computation of P
xi = P Xi involves homogeneous coordinates, thus xi and P Xi just have to be proportional: x i P Xi = 0 Let p1T, p2T, p3T be the 3 row vectors of P
v'i p T Xi w'i p T Xi 3 2 T T xi P X i = w'i p1 Xi u 'i p 3 Xi T u'i p T X i v'i p1 X i 2
T p 1 X i T P X i = p 2 X i p T X i 3
0T 4 w 'i X T i v 'i X T i
w'i X T i 0T 4 u 'i X T i
v 'i X T p 1 i T u'i X i p 2 = 0 0T p 3 4
p1 p2 is a 12 1 vector p3
So we get 2 independent equations in 11 unknowns (ignoring scale) With 6 point correspondences, we get enough equations to compute matrix P Ap=0
Solving A p = 0
Linear system A p = 0 When possible, have at least 5 times as many equations as unknowns (28 points) Minimize || A p || with the constraint || p || = 1
P is the unit singular vector of A corresponding to the smallest singular value (the last column of V, where A = U D V T is the SVD of A)
Radial Distortion
We have assumed that lines are imaged as lines Not quite true for real lenses
Significant error for cheap optics and for short focal lengths
Scene
Image
Corrected image
Minimize f ( 1 , 2 ) = ( x'i xci ) 2 + ( y 'i yci ) 2 i using lines known to be straight (x,y) is radial projection of (x,y) on straight line
References
Multiple View Geometry in Computer Vision, R. Hartley and A. Zisserman, Cambridge University Press, 2000, pp. 138-183 Three-Dimensional Computer Vision: A Geometric Approach, O. Faugeras, MIT Press, 1996, pp. 33-68 A Versatile Camera Calibration Technique for 3D Machine Vision, R. Y. Tsai, IEEE J. Robotics & Automation, RA-3, No. 4, August 1987, pp. 323-344