69
Basics of Epipolar Geometry Hellmuth Stachel [email protected] http://www.geometrie.tuwien.ac.at/stachel Seminar at the Institute of Mathematics and Physics Faculty of Mechanical Engineering, May 26, 2014, STU Bratislava

Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Basics of Epipolar Geometry

Hellmuth Stachel

[email protected] — http://www.geometrie.tuwien.ac.at/stachel

Seminar at the Institute of Mathematics and Physics

Faculty of Mechanical Engineering, May 26, 2014, STU Bratislava

Page 2: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Table of contents

1. Linear images of the 3-space

2. Geometry of two images (epipolar geometry)

3. Numerical reconstruction from two images

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 1/55

Page 3: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

1. Linear images of the 3-space

The central projection produces a linear image =“central perspective”

. . . according to A. Durer’s woodcarving (1512-1525)(in ‘Underweysung der Messung mit dem Zirckel und Richtscheyt’)

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 3/55

Page 4: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

1. Linear images of the 3-space

A panorama is a nonlinear image — but can be generated from a perspective bya planar transformation according to the unfolding of a right cylinder.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 4/55

Page 5: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

1. Linear images of the 3-space

Hh

→ Hh

(x, y) 7→ (xp, yp) with xp = r arctanx

d, yp =

ry√d2 + x2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 5/55

Page 6: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central projection

The central projection (according to A. Durer)

can be generalized by a central axonometry.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 6/55

Page 7: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central axonometric principle

in space E3:

O

E1

E2

E3

U1

U2

U3

cartesian basis O;E1, E2, E3

and points at infinity U1, U2, U3

U c1

U c2

U c3

Ec1

Ec2

Ec3

Oc

in the image plane E2:

Given: central axonometric reference systemOc;Ec

1, Ec2, E

c3;U

c1 , U

c2 , U

c3

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 7/55

Page 8: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central axonometric principle

Theorem (Szabo, H.S., Vogel1994): A central axonometric referencesystem defines a central projection

⇐⇒(e1

f1

)2

:

(e2

f2

)2

:

(e3

f3

)2

=

= tanα1 : tanα2 : tanα3 .

Theorem: Each central axonometryis affine to a central projection.

U c1 U c

2

U c3

Ec1 Ec

2

Ec3α1 α2

α3

Oc

e1

f1

e2

f2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 8/55

Page 9: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Photo versus linear image

Photo (= central perspective) or photo of a photo (= linear image) ?

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 9/55

Page 10: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Definition of a linear image

There is a unique collinear transformation

κ : E3 → E

2 mit O 7→ Oc, Ei 7→ Eci , Ui 7→ U c

i , i = 1, 2, 3.

Any two-dimensional image of E3 under a collinear transformation is called linear.

=⇒{

collinear points have collinear or coincident imagescross-ratios of any four collinear points are preserved.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 10/55

Page 11: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Definition of a linear image

There is a unique collinear transformation

κ : E3 → E

2 mit O 7→ Oc, Ei 7→ Eci , Ui 7→ U c

i , i = 1, 2, 3.

Any two-dimensional image of E3 under a collinear transformation is called linear.

=⇒{

collinear points have collinear or coincident imagescross-ratios of any four collinear points are preserved.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 10/55

Page 12: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central projection in coordinates

Notation:

Z . . . center

H . . . principal point

d . . . focal length

x1, x2, x3 . . .camera frame

x′1, x

′2 . . . imagecoordinate frame

image plane

vanishing planeΠΠ

v

x1

x2

x3

X

Z H

d

Xc

x′1

x′2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 11/55

Page 13: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central projection in coordinates

(x′1

x′2

)

=d

x3

(x1

x2

)

, or homogeneous

ξ′

0

ξ′

1

ξ′

2

=

0 0 0 10 d 0 00 0 d 0

ξ0...

ξ3

.

Transformation from the camera frame (x1, x2, x3) into arbitrary world coordinates(x1, x2, x3) and translation from the particular image frame (x′

1, x′2) into arbitrary

(x′1, x

′2) gives in homogeneous form

ξ′0ξ′1ξ′2

=

1 0 0h′1 d f1 0

h′2 0 d f2

0 0 0 10 1 0 00 0 1 0

1 0 0 0o1...

o3

R

︸ ︷︷ ︸

matrix A

ξ0...ξ3

.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 12/55

Page 14: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central projection in coordinates

(x′1

x′2

)

=d

x3

(x1

x2

)

, or homogeneous

ξ′

0

ξ′

1

ξ′

2

=

0 0 0 10 d 0 00 0 d 0

ξ0...

ξ3

.

Transformation from the camera frame (x1, x2, x3) into arbitrary world coordinates(x1, x2, x3) and translation from the particular image frame (x′

1, x′2) into arbitrary

(x′1, x

′2) gives in homogeneous form

ξ′0ξ′1ξ′2

=

1 0 0h′1 d f1 0

h′2 0 d f2

0 0 0 10 1 0 00 0 1 0

1 0 0 0o1...

o3

R

︸ ︷︷ ︸

matrix A

ξ0...ξ3

.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 12/55

Page 15: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central projection in coordinates

Left hand matrix: (h′1, h

′2) are image coordinates of the principal point H, (f1, f2)

are possible scaling factors, and d is the focal length.

These parameters are called the intrinsic calibration parameters.

Right hand matrix: R is an orthogonal matrix.

The position of the camera frame with respect to the world coordinates defines theextrinsic calibration parameters.

Photos with known interior calibration parameters are called calibrated images,others (like central axonometries) are uncalibrated.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 13/55

Page 16: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Central projection in coordinates

Left hand matrix: (h′1, h

′2) are image coordinates of the principal point H, (f1, f2)

are possible scaling factors, and d is the focal length.

These parameters are called the intrinsic calibration parameters.

Right hand matrix: R is an orthogonal matrix.

The position of the camera frame with respect to the world coordinates defines theextrinsic calibration parameters.

Photos with known interior calibration parameters are called calibrated images,others (like central axonometries) are uncalibrated.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 13/55

Page 17: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

How to check theinterior calibrationparameters of anycamera ?

The center Z lies atthe intersection of thethree spheres drawnover the segmentsU c1U

c2 , . . .

Note: Zooming and(automatic) focussingchanges the focaldistance d !

U c1Uc1Uc1Uc1Uc1Uc1U c1U c1U c1U c1U c1U c1Uc1Uc1Uc1Uc1U c1

U c2Uc2Uc2Uc2Uc2Uc2U c2U c2U c2U c2U c2U c2Uc2Uc2Uc2Uc2U c2

U c3Uc3Uc3Uc3Uc3Uc3U c3U c3U c3U c3U c3U c3Uc3Uc3Uc3Uc3U c3

H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′H=Z ′

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 14/55

Page 18: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Positive and negative central pespective

DGDGDGimage plane

vanishing plane

negative plane

ΠΠ Πv

x1

x2

x3

X

Z

H

H

dd

Xc

Xc

x′1

x′2

x′1

x′2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 15/55

Page 19: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

unknown interior calibration parameters

ZZZZZZZZZZZZZZZZZ

collinear

bundle tr

ansformation

planeplane

ZZZZZZZZZZZZZZZZZ

the bundles Z and Zof the rays of sight arecollinear (neitheraffine nor similar!)

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 16/55

Page 20: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

2. Geometry of two images

Given: Two linear images or two photographs showing the same object.

Wanted: Dimensions of the depicted 3D-object.

Π

Historical ‘Stadtbahn’ station Karlsplatz in Vienna (Otto Wagner, 1897)

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 17/55

Page 21: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

2. Geometry of two images

The geometry of two images is a classical subject of Descriptive Geometry.Its results have become standard (Finsterwalder, Kruppa, Krames,Wunderlich, Hohenberg, Tschupik, Brauner, Havlicek, H.S., . . . ).

Photogrammetry (Remote sensing) deals with the practical usage of these results.

Why now ? Advantages of digital images:

• less distorsion, because no paper prints are needed,

• exact boundary is available, and

• precise coordinate measurements are possible using standard software.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 18/55

Page 22: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

2. Geometry of two images

The geometry of two images is a classical subject of Descriptive Geometry.Its results have become standard (Finsterwalder, Kruppa, Krames,Wunderlich, Hohenberg, Tschupik, Brauner, Havlicek, H.S., . . . ).

Photogrammetry (Remote sensing) deals with the practical usage of these results.

Why now ? Advantages of digital images:

• less distorsion, because no paper prints are needed,

• exact boundary is available, and

• precise coordinate measurements are possible using standard software.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 18/55

Page 23: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Computer Vision

Why now ?

The geometry of two images is important for Computer Vision, a topic with themain goal to endow a computer with a sense of vision.

Basic problems:

• Which information can be extracted from digital images ?

• How to preprocess and represent this information ?

Sensor-guided robots, automatic vehicle control, ‘Big Brother’, . . .

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 19/55

Page 24: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Computer Vision

Why now ?

The geometry of two images is important for Computer Vision, a topic with themain goal to endow a computer with a sense of vision.

Basic problems:

• Which information can be extracted from digital images ?

• How to preprocess and represent this information ?

Sensor-guided robots, automatic vehicle control, ‘Big Brother’, . . .

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 19/55

Page 25: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Computer Vision

Recent textbooks:

Yi Ma, St. Soatto, J. Kosecka, S.S.Sastry: An Invitation to 3-D Vision.Springer-Verlag, New York 2004

R. Hartley, A. Zisserman:Multiple View Geometry in ComputerVision. Cambridge University Press 2000

Fortunately the authors in the cited bookrefer to some of these standard results(Krames, Kruppa, Wunderlich)

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 20/55

Page 26: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Computer Vision

Recent textbooks:

Yi Ma, St. Soatto, J. Kosecka, S.S.Sastry: An Invitation to 3-D Vision.Springer-Verlag, New York 2004

R. Hartley, A. Zisserman:Multiple View Geometry in ComputerVision. Cambridge University Press 2000

Fortunately the authors in the cited bookrefer to some of these standard results(Krames, Kruppa, Wunderlich)

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 21/55

Page 27: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Geometry of two images (epipolar geometry)

viewing situation(two different centers Z1 6= Z2)

two central projections togetherwith two collinear transformations

result in two images

Z ′′1 = 2nd image of the 1st center

Z ′2 = 1st image of the 2nd center

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

zzzzzzzzzzzzzzzzz

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1

X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXX

δXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2

π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1

π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2

γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2

X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′

X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′

l′l′l′l′l′l′l′l′l′l′l′l′l′l′l′l′l′

l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′

Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2

Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 22/55

Page 28: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Geometry of two images (epipolar geometry)

Notations:

line z = Z1Z2 . . . baseline,

Z ′2, Z

′′1 . . . epipoles

(German: Kernpunkte),

δX . . . epipolar plane (it is twiceprojecting),

l′, l′′ . . . pair of epipolar lines(German: Kernstrahlen, Ordner)

(X ′,X ′′) . . . corresponding views.

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

zzzzzzzzzzzzzzzzz

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1

X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXX

δXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2

π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1

π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2

γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ1γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2γ2

X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′X ′

X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′X ′′

l′l′l′l′l′l′l′l′l′l′l′l′l′l′l′l′l′

l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′l′′

Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2Z′2

Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1Z′′1

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 23/55

Page 29: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint

Theorem (synthetic version): For any two linear images of a scene, there is aprojectivity between two line pencils

Z ′2(δ

′X) ∧− Z ′′

1 (δ′′X)

such that the points X ′,X ′′ are corresponding ⇐⇒ they are located on(corresponding=) epipolar lines.

Theorem (analytic version): Using homogeneous coordinates for both images,there is a bilinear form β of rank 2 such that two points X ′ = x

′R = (ξ′0 : ξ

′1 : ξ

′2)

and X ′′ = x′′R = (ξ′′0 : ξ′′1 : ξ′′2 ) are corresponding

⇐⇒ β(x′,x′′) =2∑

i,j=0

bij ξ′i ξ

′′j = (ξ′0 ξ′1 ξ′2) ·

(bij

ξ′′0ξ′′1ξ′′2

= x′T ·B · x′′ = 0 .

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 24/55

Page 30: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint

Theorem (synthetic version): For any two linear images of a scene, there is aprojectivity between two line pencils

Z ′2(δ

′X) ∧− Z ′′

1 (δ′′X)

such that the points X ′,X ′′ are corresponding ⇐⇒ they are located on(corresponding=) epipolar lines.

Theorem (analytic version): Using homogeneous coordinates for both images,there is a bilinear form β of rank 2 such that two points X ′ = x

′R = (ξ′0 : ξ

′1 : ξ

′2)

and X ′′ = x′′R = (ξ′′0 : ξ′′1 : ξ′′2 ) are corresponding

⇐⇒ β(x′,x′′) =2∑

i,j=0

bij ξ′i ξ

′′j = (ξ′0 ξ′1 ξ′2) ·

(bij

ξ′′0ξ′′1ξ′′2

= x′T ·B · x′′ = 0 .

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 24/55

Page 31: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint

Proof (analytic version): Using homogeneous line coordinates, the projectivitybetween the line pencils can be expressed as

β : (u′1λ1 + u

′2λ2)R 7→ (u′′

1λ1 + u′′2λ2)R for all (λ1, λ2) ∈ R

2 \ {(0, 0)}.x′ and x

′′ are corresponding ⇐⇒ there is a nontrivial pair (λ1, λ2) such that

(u′1λ1 + u

′2λ2)· x′ = 0

(u′′1λ1 + u

′′2λ2)· x′′ = 0 .

These two linear homogeneous equations in the unknowns (λ1, λ2) have a nontrivialsolution ⇐⇒ the determinant vanishes, i.e.,

β(x′,x′′) := (u′1 ·x′)(u′′

2 ·x′′)− (u′2·x′)(u′′

1 ·x′′) =∑2

i,j=0 bij ξ′i ξ

′′j = 0.

There are singular points of this correspondance: Z ′2 corresponds to all X ′′, and

vice versa all points X ′ correspond to Z ′′1 =⇒ rk(bij) = 2 .

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 25/55

Page 32: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint

β(x′,x′′) =

2∑

i,j=0

bij ξ′i ξ

′′j = (ξ′0 ξ′1 ξ′2) ·

(bij

ξ′′0ξ′′1ξ′′2

= x′T ·B · x′′ = 0 .

The epipoles solve systems of homogeneous linear equations with the coefficientmatrices B and B

⊤:

Z ′2 = (ξ′0 : ξ

′1 : ξ

′2) corresponds to all X ′′ ⇐⇒ ∑2

i=0 bij ξ′i = 0 for j = 0, 1, 2 .

Z ′′1 = (ξ′′0 : ξ′′1 : ξ′′2 ) corresponds to all X ′ ⇐⇒ ∑2

j=0 bij ξ′′j = 0 for i = 0, 1, 2.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 26/55

Page 33: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint in the calibrated case

Theorem: In the calibrated casethe essential matrix B = (bij) is theproduct of a skew symmetric matrixand an orthogonal one, i.e.,

B = S ·R .

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1z′z′z′z′

z′

z′

z′

z′

z′z′z′z′z′z′z′z′z′

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2x

′x′

x′

x′

x′

x′

x′

x′

x′x′x′x′x′x′x′x′

x′

x′′

x′′

x′′

x′′

x′′

x′′

x′′

x′′

x′′

x′′x′′x′′x′′x′′x′′x′′

x′′

Proof: We use both camera frames and the homogeneous coordinates

x′ =

−−−→Z1X

′, x′′ =

−−−→Z2X

′′.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 27/55

Page 34: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint in the calibrated case

For transforming the coordinates from the second camera frame into the first one,there is an orthogonal matrix R such that

x′′1 = z

′ +R · x′′ with R⊤ = R

−1 and z′ = (z′1, z

′2, z

′3)

⊤ =−−−→Z1Z2.

The points X1, X2, Z1,Z2 are coplanar ⇐⇒ the tripleproduct of the vectors x′, z′ andx′′1 = Z1X2 vanishes, i.e.,

det(x′, z′,x′′1) = x

′ · (z′×x′′1) = 0 .

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1z′z′z′z′

z′

z′

z′

z′

z′

z′z′z′z′z′z′z′z′

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2x

′x′

x′

x′

x′

x′

x′

x′

x′

x′x′x′x′x′x′x′

x′

x′′

x′′

x′′

x′′

x′′

x′′

x′′

x′′

x′′x′′x′′x′′x′′x′′x′′x′′

x′′

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 28/55

Page 35: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint in the calibrated case

For transforming the coordinates from the second camera frame into the first one,there is an orthogonal matrix R such that

x′′1 = z

′ +R · x′′ with R⊤ = R

−1 and z′ = (z′1, z

′2, z

′3)

⊤ =−−−→Z1Z2.

The points X1, X2, Z1, Z2

are coplanar ⇐⇒ the tripleproduct of the vectors x′, z′ andx′′1 = Z1X2 vanishes, i.e.,

det(x′, z′,x′′1) = x

′ · (z′×x′′1) = 0 .

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1z′z′z′z′

z′

z′

z′

z′

z′

z′z′z′z′z′z′z′z′

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2x

′x′

x′

x′

x′

x′

x′

x′

x′

x′x′x′x′x′x′x′

x′

x′′

x′′

x′′

x′′

x′′

x′′

x′′

x′′

x′′x′′x′′x′′x′′x′′x′′x′′

x′′

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 28/55

Page 36: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint in the calibrated case

We replace the vector product (z′×x′′1) by

z′×(z′ +R·x′′) = z

′×(R·x′′) = S·R·x′′ with S =

0 −z′3 z′

2

z′3 0 −z′

1

−z′2 z′

1 0

.

Matrix S is skew symmetric and R is orthogonal.

Hence, the coplanarity of x′, x′′ and z′ is equivalent to

0 = x′ · (z′×x

′′1) = x

′T · S ·R︸ ︷︷ ︸B

·x′′, hence B = S ·R .

The decomposition of the fundamental matrix B into these two factors defines therelative position of the second camera frame against the first one !

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 29/55

Page 37: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Epipolar constraint in the calibrated case

We replace the vector product (z′×x′′1) by

z′×(z′ +R·x′′) = z

′×(R·x′′) = S·R·x′′ with S =

0 −z′3 z′

2

z′3 0 −z′

1

−z′2 z′

1 0

.

Matrix S is skew symmetric and R is orthogonal.

Hence, the coplanarity of x′, x′′ and z′ is equivalent to

0 = x′ · (z′×x

′′1) = x

′T · S ·R︸ ︷︷ ︸B

·x′′, hence B = S ·R .

The decomposition of the fundamental matrix B into these two factors defines therelative position of the second camera frame against the first one !

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 29/55

Page 38: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Singular value decomposition (SVD)

LinAlg

LinAlg

a0a1

a2 xA

α(a0)

α(a1)

α(a2)

α(x)

A′

U·D·V⊤

A−→α

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 30/55

Page 39: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Singular value decomposition (SVD)

LinAlg

LinAlg

a0a1

a2 xA

α(a0)

α(a1)

α(a2)

α(x)

A′

U·D·V⊤

A−→α

rotation ↓ V⊤ rotation ↑ U

LinAlgLinAlg

D−→

scaling

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 30/55

Page 40: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Singular value decomposition (SVD)

Theorem: [Singular value decomposition]

Any matrix A ∈ M(m,n;R) can be decomposed into a product

A = U·D·V⊤ with orthogonal U,V and D = diag(σ1, . . . , σp)

with D ∈ M(m,n;R), σi ≥ 0, and p = min{m,n}.The positive entries in the main diagonal of D are called singular values of A.

The squares of the singular values are the non-zero eigenvalues of A⊤·A.

m

n

= m

m

·n

·

n

n

A = U⊤ · D · V

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 31/55

Page 41: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Singular value decomposition (SVD)

Theorem: [Singular value decomposition]

Any matrix A ∈ M(m,n;R) can be decomposed into a product

A = U·D·V⊤ with orthogonal U,V and D = diag(σ1, . . . , σp)

with D ∈ M(m,n;R), σi ≥ 0, and p = min{m,n}.The positive entries in the main diagonal of D are called singular values of A.

The singular values of A can be seen as non-vanishing principal distortion factorsof the affine transformation represented by A, i.e., the semiaxes of the affine imageof the unit sphere.

E.g., the singular values of an orthogonal projection are (1, 1) as the unit sphere ismapped onto a unit disk.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 32/55

Page 42: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Singular values of the essential matrix

Theorem: In the calibrated casethe essential matrix B has two equalsingular values σ := σ1 = σ2.

Proof: We have B = S ·R withorthogonal R. The vector

S·x = z′×x

is orthogonal zu the orthogonal viewxn, where

‖z′×x‖ = | sinϕ| ‖x‖ ‖z′‖ =

= ‖xn‖ ‖z′‖ = σ ‖xn‖.

z′

x

xn

z′×x

ϕ

Π ⊥ z′

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 33/55

Page 43: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

What means ‘reconstruction’

Given: Two either calibratedor uncalibrated images.

π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1π′1 π′′

2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2π′′2

X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1X ′1 X ′′

1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1X ′′1

X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2X ′2

X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2X ′′2

Wanted: ‘viewing situation’,i.e., determine

• the relative position of thetwo camera frames, and

• for each pair (X ′, X ′′) ofimages the location of theorginal space point X .

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

zzzzzzzzzzzzzzzzz

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 34/55

Page 44: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

First fundamental theorem

Theorem 1:From two uncalibrated images with given projectivity between epipolar lines thedepicted object can be reconstructed up to a collinear transformation.

Sketch of the proof:The two images can be placedin space such that pairs ofepipolar lines are intersecting.Then for arbitrary Z1, Z2 on thebaseline z = Z2

1Z12 there is a

reconstructed 3D object.

Any other choice of theviewing situation gives a collineartransform of the 3D object.

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

zzzzzzzzzzzzzzzzz

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 35/55

Page 45: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Second fundamental theorem

Theorem 2 (S. Finsterwalder, 1899):From two calibrated images with given projectivity between epipolar lines thedepicted object can be reconstructed up to a similarity.

Sketch of the proof:Now in the two bundles of raysthe pencils of epipolar planesδX are congruent, and they canbe made coincident by a rigidmotion. Then relative to the firstbundle Z1 for any Z2 ∈ z thereis a reconstructed 3D object.

Any other choice of Z2 gives asimilar 3D object.

π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1π1

π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2π2

Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2Z2 Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1Z1

Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21Z21

Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12Z12

zzzzzzzzzzzzzzzzz

X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X1X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2X2

XXXXXXXXXXXXXXXXXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδXδX

l1l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2l2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 36/55

Page 46: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Aerial photographs

Historical remarks:

• High strategic importance of‘aerial photogrammetry’, alreadyfrom World War I on.

• Mechanical devices (‘stereocomparators’) were developed forthe reconstruction from a pair ofphotos.

• Now, in the time of GPS, theexterior calibration parametersare always available with ratherhigh precision available. Hencenumerical methods are preferred.

Orthophoto, a geometrically correctedaerial photograph (cadastral boundaries)

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 37/55

Page 47: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

3. Numerical reconstruction from two images

Problem of Projectivity:

Given: 7 pairs of corresponding points (X ′1,X

′′1 ), . . . , (X

′7, X

′′7 ).

Wanted: A pair of points (S′, S′′) (= epipoles) such that there is a projectivity

S′([S′X ′1], . . . , [S

′X ′7]) ∧− S′′([S′X ′′

1 ], . . . , [S′′X ′′

7 ]).

X ′1 X ′

2

X ′3X ′

4

X ′5

X ′6

X ′7

X ′′1

X ′′2

X ′′3

X ′′4

X ′′5

X ′′6

X ′′7π′

π′′

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 38/55

Page 48: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Determination of epipoles — geometric meaning

Problem of Projectivity:

Given: 7 pairs of corresponding points (X ′1,X

′′1 ), . . . , (X

′7, X

′′7 ).

Wanted: A pair of points (S′, S′′) (= epipoles) such that there is a projectivity

S′([S′X ′1], . . . , [S

′X ′7]) ∧− S′′([S′X ′′

1 ], . . . , [S′′X ′′

7 ]).

X ′1 X ′

2

X ′3X ′

4

X ′5

X ′6

X ′7

X ′′1

X ′′2

X ′′3

X ′′4

X ′′5

X ′′6

X ′′7

S′

S′′π′

π′′

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 38/55

Page 49: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Determination of epipoles — analytic solution

Theorem: If 7 pairs of corresponding points (X ′1, X

′′1 ), . . . , (X

′7, X

′′7 ) (“control

points”) are given, the determination of the epipoles is a cubic problem.

Proof: 7 pairs of corresponding points give 7 linear homogeneous equations

β(x′i,x

′′i ) = x

⊤i ·B · x′′

i = 0, i = 1, . . . , 7,

for the 9 entries in the (3×3)-matrix B = (bij) — called essential matrix.

det(bij) = 0 gives an additional cubic equation which fixes all bij up to a commonfactor.

For noisy image points one should use more than 7 control points and then methodsof least square approximation for obtaining the ‘best fitting matrix’ B:

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 39/55

Page 50: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Determination of epipoles — analytic solution

Theorem: If 7 pairs of corresponding points (X ′1, X

′′1 ), . . . , (X

′7, X

′′7 ) (“control

points”) are given, the determination of the epipoles is a cubic problem.

Proof: 7 pairs of corresponding points give 7 linear homogeneous equations

β(x′i,x

′′i ) = x

⊤i ·B · x′′

i = 0, i = 1, . . . , 7,

for the 9 entries in the (3×3)-matrix B = (bij) — called essential matrix.

det(bij) = 0 gives an additional cubic equation which fixes all bij up to a commonfactor.

For noisy image points one should use more than 7 control points and then methodsof least square approximation for obtaining the ‘best fitting matrix’ B:

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 39/55

Page 51: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Determination of epipoles — analytic solution

1) Let A denote the coefficient matrix in the linear homogeneous system for theentries of B. Then the ‘least square fit’ for this overdetermined system is aneigenvector for the smallest eigenvalue of the symmetric matrix A

⊤·A (= smallestsingular value of A).

2) Since the essential matrix must have rank 2, we use the ’projection into theessential space’. This means, the singular value decomposition of B gives arepresentation

B = U · diag(σ1, σ2, σ3) ·V⊤ with orthogonal U,V and σ1 ≥ σ2 ≥ σ3 .

Then in the uncalibrated case B = U · diag(σ1, σ2, 0) · V⊤ is optimal (withrespect to the Frobenius norm) and in the calibrated case

B = U · diag(σ, σ, 0) ·V⊤ with σ = (σ1 + σ2)/2.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 40/55

Page 52: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Determination of epipoles — analytic solution

1) Let A denote the coefficient matrix in the linear homogeneous system for theentries of B. Then the ‘least square fit’ for this overdetermined system is aneigenvector for the smallest eigenvalue of the symmetric matrix A

⊤·A (= smallestsingular value of A).

2) Since the essential matrix must have rank 2, we use the ’projection into theessential space’. This means, the singular value decomposition of B gives arepresentation

B = U · diag(σ1, σ2, σ3) ·V⊤ with orthogonal U,V and σ1 ≥ σ2 ≥ σ3 .

Then in the uncalibrated case B = U · diag(σ1, σ2, 0) · V⊤ is optimal (withrespect to the Frobenius norm) and in the calibrated case

B = U · diag(σ, σ, 0) ·V⊤ with σ = (σ1 + σ2)/2.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 40/55

Page 53: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

3. Numerical reconstruction of two images

Step 1: Specify at least 7 reference points

′2′2

11111111111111111

22222222222222222

33333333333333333 44444444444444444

55555555555555555

6666666666666666677777777777777777

88888888888888888

99999999999999999

1010101010101010101010101010101010

1111111111111111111111111111111111

1212121212121212121212121212121212

13131313131313131313131313131313131414141414141414141414141414141414

1515151515151515151515151515151515

1616161616161616161616161616161616

1717171717171717171717171717171717

1818181818181818181818181818181818

1919191919191919191919191919191919

202020202020202020202020202020202011111111111111111

22222222222222222

33333333333333333 44444444444444444

55555555555555555

66666666666666666

7777777777777777788888888888888888

99999999999999999

1010101010101010101010101010101010

1111111111111111111111111111111111

1212121212121212121212121212121212

13131313131313131313131313131313131414141414141414141414141414141414

1515151515151515151515151515151515

1616161616161616161616161616161616

1717171717171717171717171717171717

1818181818181818181818181818181818

1919191919191919191919191919191919

2020202020202020202020202020202020

. . . manually — or automatically by methods of pattern recognition

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 41/55

Page 54: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 2: Compute the essential matrix

Two images with depicted epipolar lines [see J. Kosecka et al.]

Remark: In the calibrated case ≥ 5 pairs of corresponding points are needed, sincein the decomposition B = S · R each factor depends on 3 parameters only.Because of the homogeneity only 5 unknowns are essential.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 42/55

Page 55: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 2: Compute the essential matrix

′4′4

Step 2: Compute the essential matrix B — including the pairs of epipolar lines

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 43/55

Page 56: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 3: Factorize B = S·R

Theorem: There are exactly two ways of decomposing B = U ·D ·V⊤ withD = diag(σ, σ, 0) into a product S ·R with skew-symmetric S and orthogonal R :

S = ±U·R+·D·U⊤ and R = ±U·R⊤+ ·V⊤ with R+ =

0 −1 0

1 0 0

0 0 1

.

Proof:

a) It is sufficient to factorize U·D = S·R′ which implies B = S · (R′·V⊤), i.e.,R = R

′·V⊤.

b) D represents the product of the orthogonal projection into the x1x2-plane andthe scaling with factor σ . The rotation U transforms the x1x2-plane into theimage plane of U·D.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 44/55

Page 57: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 3: Factorize B = S·R

Theorem: There are exactly two ways of decomposing B = U ·D ·V⊤ withD = diag(σ, σ, 0) into a product S ·R with skew-symmetric S and orthogonal R :

S = ±U·R+·D·U⊤ and R = ±U·R⊤+ ·V⊤ with R+ =

0 −1 0

1 0 0

0 0 1

.

Proof:

a) It is sufficient to factorize U·D = S·R′ which implies B = S · (R′·V⊤), i.e.,R = R

′·V⊤.

b) D represents the product of the orthogonal projection into the x1x2-plane andthe scaling with factor σ . The rotation U transforms the x1x2-plane into theimage plane of U·D.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 44/55

Page 58: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 3: Factorize B = S·R

c) In the case

S =

0 −z′3 z′

2

z′3 0 −z′

1

−z′2 z′

1 0

we have

Sx = z′ × x for z

′ =

z′1

z′2

z′3

.

Hence, the skew symmetric matrixS represents the product of anorthogonal projection parallel toz′, a 90◦-rotation about z

′ and ascaling with factor ‖z′‖.

z′

x

xn

z′×x

ϕ

Π ⊥ z′

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 45/55

Page 59: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 3: Factorize B = S·R

d) Matrix R+ =

0 −1 0

1 0 0

0 0 1

is orthogonal, R+ · D =

0 −σ 0

σ 0 0

0 0 0

is

skew-symmetric with z′ = (0, 0, σ). We transform it by U to obtain the required

position, i.e., S = ±U·(R+·D)·U⊤.

R+ commutes with D =⇒ U ·D = U ·D ·R+ ·U⊤ ·U ·R⊤+ =

=[±U·R+·D·U⊤

]

︸ ︷︷ ︸S

·[±U·R⊤

+

]

︸ ︷︷ ︸

R′

.

e) B represents an orthogonal axonometry; its column vectors are images ofan orthonormal frame. We know from Descriptive Geometry that apart fromtranslations there are not more than two different frames with given images.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 46/55

Page 60: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 3: Factorize B = S·R

d) Matrix R+ =

0 −1 0

1 0 0

0 0 1

is orthogonal, R+ · D =

0 −σ 0

σ 0 0

0 0 0

is

skew-symmetric with z′ = (0, 0, σ). We transform it by U to obtain the required

position, i.e., S = ±U·(R+·D)·U⊤.

R+ commutes with D =⇒ U ·D = U ·D ·R+ ·U⊤ ·U ·R⊤+ =

=[±U·R+·D·U⊤

]

︸ ︷︷ ︸S

·[±U·R⊤

+

]

︸ ︷︷ ︸

R′

.

e) B represents an orthogonal axonometry; its column vectors are images ofan orthonormal frame. We know from Descriptive Geometry that apart fromtranslations there are not more than two different frames with given images.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 46/55

Page 61: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Step 4: Intersecting corresponding rays

In one of the frames compute the approximate point of intersection betweencorresponding rays.

photo 2

photo 1x′′

x′

c2

c1

s

For the center of the common perpendicular line segment the sum of squareddistances is minimal.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 47/55

Page 62: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Summary of algorithm

1) Specify n > 7 pairs (X ′i,X

′′i ), i = 1, . . . , n.

2) Set up linear system of equations for the essential matrix B and seek best fittingmatrix (eigenvector of the smallest eigenvalue).

3) Compute the closest rank 2 matrix B with two equal singular values.

4) Factorize B = S ·R ; this reveals the relative position of the two camera frames.

5) In one of the frames compute the approximate point of intersection betweencorresponding rays.

6) Transform the recovered coordinates into world coordinates.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 48/55

Page 63: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Remaining problems

• Analysis of precision (e.g., no precise linear images due to effects of lenses)

• Effects of automated calibration (autofocus and zooming change the focaldistance d),

• There are critical configurations (e.g., all passpoints within one plane) wherethe problem of projectivity has no unique solution despite of an arbitrarily bignumber of control points. How to figure out the correct one?

• How to find the correct decomposition of B = S ·R among the two possibleone?

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 49/55

Page 64: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

The solution

′′′′

11111111111111111

22222222222222222

33333333333333333 44444444444444444

55555555555555555

6666666666666666677777777777777777

88888888888888888

99999999999999999

1010101010101010101010101010101010

1111111111111111111111111111111111

1212121212121212121212121212121212

13131313131313131313131313131313131414141414141414141414141414141414

1515151515151515151515151515151515

1616161616161616161616161616161616

1717171717171717171717171717171717

1818181818181818181818181818181818

1919191919191919191919191919191919

2020202020202020202020202020202020

original image

1

2

3 4

56

78

9

10

11

121314

15

16

17

18

19

20

the reconstruction (M ∼ 1 : 100)

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 50/55

Page 65: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

1

1

2

3 4

56

78

9

9

10

11

12

12

13

1314

15

16

17

18

18

19

20

Z1

Z1

Z2

Z2

Position of centers

relative to the depicted object

front view

top viewPhoto 1

Photo 2

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 51/55

Page 66: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

Literatur

• H. Brauner: Lehrbuch der konstruktiven Geometrie. Springer, Wien 1986.

• H. Brauner: Lineare Abbildungen aus euklidischen Raumen. Beitr. AlgebraGeom. 21, 5–26 (1986).

• A. Dur: An Algebraic Equation for the Central Projection. J. GeometryGraphics 7, 137–143 (2003).

• O. Faugeras: Three-Dimensional Computer Vision. A Geometric Viewpoint.MIT Press, Cambridge, Mass., 1906 .

• O. Faugeras, Q.-T. Luong: The Geometry of Multiple Images. MIT Press,Cambridge, Mass., 2001.

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 52/55

Page 67: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

• R. Harley, A. Zisserman: Multiple View Geometry in Computer Vision.Cambridge University Press 2000.

• V. Havel: O rozkladu singularnıch linearnıch transformacı. Casopis Pest. Mat.85, 439–447 (1960).

• H. Havlicek: On the Matrices of Central Linear Mappings. Math. Bohem.121, 151–156 (1996).

• M. Hoffmann: On the Theorems of Central Axonometry. J. GeometryGraphics 2, 151–155 (1997).

• M. Hoffmann, P. Yiu: Moving Central Axonometric Reference Systems. J.Geometry Graphics 9, (2005) (in press).

• E. Kruppa: Zur achsonometrischen Methode der darstellenden Geometrie.Sitzungsber., Abt. II, osterr. Akad. Wiss., Math.-Naturw. Kl. 119, 487–506(1910).

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 53/55

Page 68: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

• Yi Ma, St. Soatto, J. Kosecka, S. Sh. Sastry: An Invitation to 3-DVision. Springer-Verlag, New York 2004.

• H. Stachel: Mehrdimensionale Axonometrie. Proceedings of the Congress ofGeometry, Thessaloniki 1987, 159–168.

• H. Stachel: Parallel Projections in Multidimensional Space. Proceedings ofCompugraphics ‘91, Sesimbra (Portugal) 1991: Vol. I, 119–128.

• H. Stachel: Zur Kennzeichnung der Zentralprojektionen nach H. Havlicek.Sitzungsber., Abt. II, osterr. Akad. Wiss., Math.-Naturw. Kl. 204, 33–46 (1995).

• H. Stachel: On Arne Dur’s Equation Concerning Central Axonometries. J.Geometry Graphics 8, 215–224 (2004).

• E. Stiefel: Zum Satz von Pohlke. Comment. Math. Helv. 10, 208–225(1938).

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 54/55

Page 69: Basics of Epipolar Geometry - geometrie.tuwien.ac.at · Central projection in coordinates Left hand matrix: (h′ 1,h ′ 2) are image coordinates of the principal point H, (f1,f2)

• E. Stiefel: Lehrbuch der darstellenden Geometrie. 3. Aufl., Basel, Stuttgart1971.

• H. Stachel: Descriptive Geometry Meets Computer Vision — The Geometryof Two Images. J. Geometry Graphics 10, 137–153 (2006).

• J. Szabo, H. Stachel, H. Vogel: Ein Satz uber die Zentralaxonometrie.Sitzungsber., Abt. II, osterr. Akad. Wiss., Math.-Naturw. Kl. 203, 3–11 (1994).

• J. Tschupik, F. Hohenberg: Die geometrische Grundlagen derPhotogrammetrie. In Jordan, Eggert, Kneissl (eds.): Handbuch derVermessungskunde III a/3. 10. Aufl., Metzlersche Verlagsbuchhandlung,Stuttart 1972, 2235–2295.

• K. Vala: A propos du theorem de Pohlke. Ann. Acad. scient. Fennicae 270,3–5 (1959).

May 26, 2014: Seminar, Institute of Mathematics and Physics, STU Bratislava 55/55