Epi Polar Geom
Epi Polar Geom
Epi Polar Geom
Epipolar Line: If we know the left image point p~ L , then the corre-
sponding scene point X ~ p is constrained to be on a ray through this
image point. The position of X~ p on this ray is unknown. However, the
image of this whole ray is a line in the right image, namely the epipolar
line e(~p L ).
R
Epipolar p e(pL)
Lines
L
e(q )
R
Right Epipole q
Notice the epipolar line e(~p L ) depends on the position of the point in
the left image. For example, another image point ~q L generally gives
rise to a different epipolar line e(~q L ).
Epipole: All the epipolar lines in the right image pass through a single
point (possibly at infinity) called the right epipole. This point is given
by the intersection of the line containing the two nodal points d~ L and
d~ R with the right image plane (see figures above and on p.1). (Notice
that the line containing the two nodal points must be in all the epipolar
planes, and hence its image must be on all the epipolar lines.)
Clearly we can swap the labels “left” and “right” in the above analysis,
it does not matter which image we start with.
• For example, for each point in one image we could limit the search
for a corresponding point in the second image to just the epipolar
line (instead of naively searching the whole second image).
The origins of the left and right camera coordinate frames are at their
nodal points, and their z-axes are aligned with the two optical axes.
Therefore, as discussed in the image formation notes, given a 3D point
~ L in the left camera’s coordinates, the left image of this point is at
X c
pL1,c
L
f ~L
p~c = L Xc = p2,c
L L
. (1)
X3,c
fL
Here, f L is the distance between the image plane and the nodal point
for the left camera.
A similar expression holds for the location of the right image point.
However, before applying this expression, the 3D point X ~ L must be
c
transformed from the left to the right camera’s coordinates. We do this
via the world coordinate frame X ~ w.
The external calibration parameters for the left camera provide the 3D
rigid coordinate transformation from world coordinates to the left cam-
era’s coordinates (see the image formation notes)
~ L = M L [X
X ~ T , 1]T , (2)
c ex w
L
with Mex a 3 × 4 matrix of the form
L
Mex = RL −RLd~Lw . (3)
Let p~wL and p~wR be the left and right image points (written in world
coordinates) for some given 3D point X ~ w . Then the epipolar constraint
states that these two image points and the two nodal points d~wL , d~wR are
all coplanar. This constraint can be written as
h i
~ L T ~ L ~ R R ~
(~pw − dw ) (dw − dw ) × (~pw − dw ) = 0,
L R
(4)
Also, we use (2) and (3) to write p~wL − d~wL in terms of the left camera’s
coordinates as p~ L − d~ L = (RL )T p~ L . Using the analogous expression
w w c
for the right image point, we find that (4) can be rewritten as
From (6) it follows that the E-matrix has rank 2, with two equal non-
zero singular values and one singular value at 0.
Given a point p~cL in the left image, the epipolar constraint (5) states that
the corresponding point ~pcR in the right image must be on the line
where ~a = E T p~cL.
~aT ~ecR = (~pcL)T E~ecR = α(~pcL)T RL [d~wL −d~wR]× (RR )T RR (d~wL −d~wR) = 0,
Given a point p~cR in the right image, analogous expressions give the
epipolar line in the left image and the left epipole.
L
The internal calibration matrix Min provides the transformation from
camera coordinates to homogeneous pixel coordinates (see the image
formation notes),
~x L = Min
L L
p~c . (7)
For example, a camera with rectangular pixels of size 1/sx by 1/sy ,
with nodal distance f , and piercing point (ox, oy ) (i.e., the intersection
of the optical axis with the image plane provided in pixel coordinates)
has the internal calibration matrix
sx 0 ox/f
Min = 0 sy oy /f
.
(8)
0 0 1/f
We can use (7) to rewrite the epipolar constraint in terms of pixel coor-
dinates.
By using (7) we can rewrite the epipolar constraint (5) in terms of ho-
mogeneous pixel coordinates in the left and right images as
Similar to the E-matrix, the F-matrix has rank 2, but the two nonzero
singular values need not be equal. The over-all scale of the F-matrix
does not effect the epipolar constraint (9). So there are 7 remaining
degrees of freedom in F .
The right (left) null vector of F gives the homogeneous pixel coordi-
nates for the right (left, resp.) epipole.
More explicitly, for example, the epipolar constraint (9) states that,
given a point ~x L in the left image, the corresponding point ~x R in the
right image must be on the epipolar line
where ~a = F T ~x L .
2503: Epipolar Geometry Page: 10
Estimating the Fundamental Matrix
Given corresponding image points {(~xkL, ~xkR )}K
k=1 we wish to estimate
the F-matrix.
~xkµ = m
~ kµ + ~nkµ , (11)
~ kµ is the true position of the point and ~nkµ is the mean zero
where m
noise. Then the (maximum likelihood) problem is to find F ∈ <3×3
~ kµ for k = 1, . . . , K and µ = L, R, such that the following
along with m
objective function is minimized:
X X
K
O ≡ ~ kµ )T (Σµk)† (~xkµ − m
(~xkµ − m ~ kµ ) (12)
µ∈{L,R} k=1
~ Lk)T F m
(m ~Rk = 0, k = 1, . . . , K, (13)
rank(F) = 2 (14)
where !
~n 1 T L
= F ~xk . (16)
c ||(I2 ~0)F T ~xkL||2
The normalization in (16) simply ensures ~n is the unit normal to the
epipolar line e(~xkL). Therefore
is the perpendicular distance between ~xkR and the epipolar line e(~xkL).
1 XK
[M µ~xkµ − (0, 0, 1)T ]2∗ = (σ12, σ22, 0)T , (22)
K
k=1
where σ12 + σ22 = 2. Here [...]2∗ denotes the square of each element.
Rescale the image points using ~rkµ = M µ~xkµ for k = 1, . . . , K and
µ = L, R.
F = (M L )T F̂ M R (24)
This algorithm has been found to provide reasonable estimates for the
F -matrix given correspondence data with small amounts of noise (see
Hartley and Zisserman, Multiple View Geometry in Computer Vision,
Camb. Univ. Press., 2000).
Loop T times:
2. Use the renormalized algorithm to solve for F using only the eight
selected pairs of points.
3. Compute perpendicular errors d(~xkR , e(~xkL )) and d(~xkL, e(~xkR )), see
(16) and (17) for 1 ≤ k ≤ K.
4. Identify inliers
5. If the number of inliers |In| is the largest seen so far, remember the
current estimate of F and the inlier set In.
End loop.
6. Solve for F using all pairs with k ∈ In (i.e., all inliers). Re-solve for
the inlier set In as done in steps 3 and 4 above.
Can iterate step 6 until the set of inliers In does not change.
2503: Epipolar Geometry Page: 16
RANSAC: How Many Trials?
Suppose our data set consists of a fraction p inliers, and 1 − p outliers.
P0 = 1 − (1 − pd)T
Given an estimate for the fraction of inliers p in the data set, we could
then choose T such that P0 > 0.95, say. That is,
For example, for 70% inliers and d = 8, we require T > 50. Alter-
natively, if we only have 50% inliers, the same formula states that T
should be chosen to be at least 766.
Here have choosen random colours to circle image features. The same
colour is then used for the corresponding point in the other image, and
also for the epipolar lines generated from these two points.
Note:
1. By construction, each point lies close to the epipolar line generated
by its corresponding point in the other image.
2. A visual sanity check can be obtained by sampling other points on
one epipolar line, and checking that they also appear somewhere
along the corresponding epipolar line. This must be the case since,
when the F-matrix is correct, both epipolar lines correspond to the
intersection of the scene with the epipolar plane. (Compare the
current fit with the result of a poor fit shown on p.19.)
3. The intersection of the epipolar lines corresponds to the epipole in
each image. The nodal point of the second camera is on the line (in
world coordinates) containing the nodal point of the first camera
and the epipole in the first image.
2503: Epipolar Geometry Page: 18
Poorly Fitted F-Matrix
The same local image features were used as in the previous example,
and RANSAC was used to fit the F -matrix (but with only 10 trials).
The solution it found is displayed below:
Note:
1. The feature points are still near the corresponding epipolar lines.
Here 82% of the data points are within 4 pixels of the correspond-
ing epipolar line. In contrast, the solution on the previous page
achieved 94%.
2. However, the visual sanity check fails. This is most apparent for
(proposed) epipolar planes which intersect the scene over a large
range of depths. For example, consider the (proposed) epipolar
planes which cut across the tower at the top of the image and at
least one of the buildings in front.