Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. Introduction
In this text we present an implementation of the algorithm for camera cali-
bration proposed by Zhengyou Zhang in ”A Flexible New Technique for Camera
Calibration”. Our implementation seeks to be as close as possible to the algorithm
described by Zhang. The technique proposed by Zhang only requires the camera to
observe a planar pattern shown at a few (at least two) different orientations. In the
camera’s model used we consider the intrinsic parameters, the extrinsic parameters
and the radial lens distortion. This method proposes an analytic solution to solve
these parameters and then create the best approximation using a minimization
method.
b= B11 B12 B22 B13 B23 B33
Pi0 Pi1 (Pi0 Pi1 + Pi3 Pi1 ) Pi3 Pi4 (Pi0 Pi7 + Pi6 Pi1 ) (Pi3 Pi7 + Pi6 Pi7 ) Pi6 Pi7
Gi =
Pi20 − Pi21 2(Pi0 Pi1 − Pi3 Pi1 ) Pi23 − Pi24 2(Pi0 Pi7 − Pi6 Pi1 ) 2(Pi3 Pi7 − Pi6 Pi7 ) Pi26 − Pi27
G1
G2
V =
..
.
Gk
• Solve the system Vb=0, where b is the variable
• From solution b build B
(4) From B estimate parameter of A’
• Solve these calculations and mount A’
0
α γ 0 u00
2
B12 + v00 (B12 B13 − B11 B23 )
(2) λ0 = B33 −
B11
r
0 λ0
(3) α =
B11
s
λ0 B11
(4) β0 = 2
B11 B22 − B12
−B12 α2 β
(5) γ0 =
λ0
γ 0 v0 B13 α02
(6) u00 = −
β0 λ0
γ 0 v0 B13 α02
(7) u00 = −
β0 λ0
• For obtain A : Solve
A = N −1 A0
α γ u0
A = 0 β v0
0 0 1
ZHANG’S CAMERA CALIBRATION:STEP BY STEP 3
K = [R t]
| | | t1
R = r1 r2 r3 , t = t2
| | | t3
1
(8) λr1 =
kA−1 h 1k
1
(9) λr2 =
kA−1 h 2k
λr 1 + λ r2
(10) λr 3 =
2
(13) r3 = r1 × r2
k1
k=
k2
d1
d2
d=
..
.
dn
• Mount matrix D and d
• solve the system Dk = d, where k is the variable.
• minimize error using Levenberg-Marquardt
3. Appendix 1
Computes the homography (H)
input: list of pairs of points, each pair is composed for a point M of the model and
a point m that is the projection of point M in the image
P0 P1 P2 −− h̄1 −−
H = P3 P4 P5 = −− h̄2 −− homography
P6 P7 P8 −− h̄3 −−
M̃1T 0T −u1 M̃1T
X1 Y1 W1 0 0 0 −u1 X1 −u1 Y1 −u1 W1
0T M̃1T −v1 M̃1T
0 0 0 X1 Y1 W1 −v1 X1 −v1 Y1 −v1 W1
M̃2T 0T −u2 M̃2T
X2 Y2 W2 0 0 0 −u2 X2 −u2 Y2 −u2 W2
0T M̃2T −v2 M̃2T 0 0 0 X2 Y2 W2 −v2 X2 −v2 Y2 −v2 W2
L= =
.. ..
.
.
M̃nT 0T −un M̃nT Xn Yn Wn 0 0 0 −un Xn −un Yn −un Wn
0T M̃nT −vn M̃nT 0 0 0 Xn Yn Wn −vn Xn −vn Yn −vn Wn
Xi
Xi Yi
M̃i = Yi ⇔ 0
Wi
Wi
P0
P1
T P2
h̄1 P3
T
x = h̄2
= P4
T P5
h̄3
P6
P7
P8
• mount the matrix L
• solve the system Lx = 0, where x is the variable.
• minimize error using Levenberg-Marquardt.
ZHANG’S CAMERA CALIBRATION:STEP BY STEP 5