Lecture20 Calibration Cont, Stereo
Lecture20 Calibration Cont, Stereo
𝑀=
Estimating the projection matrix
World – Frame Transform
• Drop “w”
• N pairs (xi,yi) <-> (Xi,Yi,Zi)
Linear equations of m
• 2N equations, 11 independent variables
• N >=6 , SVD => m up to an unknown scale
Solving this Homogeneous System
• M linear equations of form 𝐴𝒙 = 0
• If we have a given solution 𝑥1, s.t. 𝐴𝑥1 = 0 then 𝑐 ∗ 𝑥1 is also a solution 𝐴(𝑐 ∗
𝑥1) = 0
• Need to add a constraint on 𝒙,
• Basically make 𝒙 a unit vector X T X = 1
• Can prove that the solution is the eigenvector corresponding to the single zero
eigenvalue of that matrix AT A
= 𝛾𝑀 to parameters (p134-135)
• From 𝑀
• You get 12 numbers once you have computed the projection matrix
• But you know that each of these numbers equals each of the
elements in these equations
• Now you use constraints on a rotation matrix (rows are all unit
length and are orthogonal) along with other constraints
• You apply these one at a time and can compute all of R, T and K
• You need some simple algebraic manipulation to accomplish this
• Remember to use the constraints on rows of R to simplify equations
= 𝛾𝑀 to parameters (p134-135)
From 𝑀
• Find scale |𝛾| by using unit vector 𝑅3𝑇
• Divide computed 𝑀 by |𝛾| to get new 𝑀 matrix
• Determine 𝑇𝑧 and sign of 𝛾 from 𝑚34 (i.e. 𝑞43 )
• If necessary change sign of every element in the new 𝑀 so that it
is true that every 𝑇𝑧 > 0
• Define 𝑞1 = (𝑚11 , 𝑚12 , 𝑚13 ), 𝑞2 = 𝑚21 , 𝑚22 , 𝑚23 and 𝑞3 =
(𝑚31 , 𝑚32 , 𝑚33 )
• Find (𝑂𝑥, 𝑂𝑦) by dot products of Rows 𝑜𝑥 = 𝑞1 . 𝑞3 , oy = 𝑞2 . 𝑞3 ,
using the orthogonal constraints of R
• Determine 𝑓𝑥 and 𝑓𝑦 from 𝑞1 . 𝑞1 and 𝑞2 . 𝑞2
B
Derive expression for Z as a function of 𝑥𝑙 , 𝑥𝑟 , 𝑓 and B
Here 𝑥𝑟 is projection on rightmost camera looking out from cameras
Stereo Derivations (camera coords)
+ - + -
B B
B B
1
B 𝑍∝
𝑑
Note that 𝑥𝑙 is always to left of 𝑥𝑟 so disparity d >= 0 in this case.
If increase in opposite direction swap 𝑥𝑟 and 𝑥𝑙 in d formula.
B
Stereo Derivations
The units of f, B, d, and Z need to be consistent for the equation Z=f.B/d to
work properly.
• f (focal length): Units can be in pixels or millimeters (mm), depending on
the coordinate system used. In stereo vision with digital images, it's
usually in pixels.
• B (baseline): This is a physical distance between the two camera centers.
Units are typically in millimeters (mm), centimeters (cm), or meters (m).
• d (disparity): This is the difference in pixel coordinates, so the unit is in
pixels.
• Z (depth): Since Z=f.B/d the units of Z will match the units of B (typically
mm, cm, or m), provided that f is in pixels and d is also in pixels.
Why 𝑥𝑟 – 𝑥𝑙 is always positive
Range Versus Disparity – z fixed for d
Range Versus Disparity – z fixed for d