1. Projective geometry

26
1. Projective geometry Homogeneous representation of points and lines in 2D space 2D projective space Points at infinity and the line at infinity Conics and dual conics Projective transformation Hierarchy of 2D projective transformation

Transcript of 1. Projective geometry

Page 1: 1. Projective geometry

1. Projective geometry• Homogeneous representation of points and lines in 2D space• 2D projective space• Points at infinity and the line at infinity• Conics and dual conics• Projective transformation• Hierarchy of 2D projective transformation

Page 2: 1. Projective geometry

Notation• Scalars:

• Vectors:

• Transpose:

• Matrices:

• Transpose:

x, y, . . .

x,y, . . .

A, B, P, . . .

A>, B>, P>, . . .

x

>,y>, . . .

Page 3: 1. Projective geometry

Homogeneous representation of lines in 2D space• A line on a xy plane:• Any line can be represented by a 3-vector

• The same line is given by

• In this sense, is equivalent to

• Such vectors are called homogeneous vectors• This equivalence will be represented by

• Two vectors on both sides are parallel

ax+ by + c = 0

l = [a, b, c]>

k(a, b, c)> = (ka, kb, kc)>

(a, b, c)> k(a, b, c)>

/

(a, b, c)> / k(a, b, c)>

kax+ kby + kc = k(ax+ by + c) = 0

Page 4: 1. Projective geometry

Homogeneous representation of points in 2D space• A point is on a line

• Homogeneous representation of a point:• The same point is given by:

• To recover the original (inhomogeneous) coordinates from homogeneous coordinates, simply do

(x, y) l = (a, b, c)>

, l

>x =

⇥a b c

⇤2

4x

y

1

3

5 = ax+ by + c = 0

x = (x, y, 1)>

k(x, y, 1)> = (kx, ky, k)>

(x, y, 1)> / k(x, y, 1)>

x = (x1, x2, x3)>

✓x1

x3,

x2

x3

Page 5: 1. Projective geometry

2D projective space• Sets of equivalent vectors in this sense form a special space

called the projective space

𝐱

𝐱′

𝐱′′𝐱

𝐱′

𝐱′′

3D Euclidean space 2D projective space

Page 6: 1. Projective geometry

Intersection of lines• Q) What is the crossing point of lines?

• A) It is given by their cross product:

• Proof:

• E.g. Crossing point of and ?

l =

2

4abc

3

5 l0 =

2

4a0

b0

c0

3

5

x ⌘ l⇥ l

0

l

>x = l

>(l⇥ l

0) = 0(Scalar triple product)

l

l0

l⇥ l0

x = 1 y = 1

l = [�1, 0, 1]> l0 = [0,�1, 1]>

x = l⇥ l

0 =

2

4�101

3

5⇥

2

40�11

3

5 =

2

4111

3

5

(1/1, 1/1) = (1, 1)𝑥

𝑦

(1,1)

𝑥 = 1

𝑦 = 1

Page 7: 1. Projective geometry

Points at infinity• Consider the intersection of and

• Conversion to inhomogeneous coordinates…

• A point with homogeneous coordinates is called “a point at infinity”

• A point gives a finite point if and gives a point at infinity if

l = (a, b, c)> l0 = (a, b, c0)>

l⇥ l0 = (bc0 � bc, ca� ac0, ab� ab)> = (c0 � c)(b,�a, 0)>

(b/0,�a/0) = (1,1)

(x, y, 0)>

(x1, x2, x3)>

x3 6= 0x3 = 0

Page 8: 1. Projective geometry

Points at infinity• In inhomogeneous domain, parallel lines do not have an

intersection• In homogenous domain, parallel lines have an intersection at a

point at infinity • Points at infinity and finite points can be treated equally ß an

advantage of using homogeneous representation• Note that there are an infinite number of ʻpoints at infinityʼ

(a, b, 0)>

𝑥

𝑦

Page 9: 1. Projective geometry

The line at infinity• The special line is called “the line at infinity”

• The name comes from the fact that every point at infinity will lie on this line

• This line is unique, and will be denoted by

l = (0, 0, 1)>

⇥0 0 1

⇤2

4x1

x2

0

3

5 = 0

l1 = (0, 0, 1)>

Page 10: 1. Projective geometry

Duality of points and lines• There is symmetry between points and lines

• Exchange of points and lines in a proposition wonʼt change its correctness

• E.g. Intersection of lines is given by

• Prove this directly without using the duality (1st assignment)

l

>x = x

>l = 0

A line passing through two points is given by

x = l⇥ l

0

l = x⇥ x

0

,

Page 11: 1. Projective geometry

Conics• A conic = a curve obtained as the intersection of a cone with a

plane

Ellipse Hyperbola Parabola

Any conic on a xy plane is given by

ax

2 + bxy + cy

2 + dx+ ey + f = 0

x x1/x3 and y x2/x3

ax

21 + bx1x2 + cx

22 + dx1x3 + ex2x3 + fx

23 = 0

Page 12: 1. Projective geometry

Conics• Or, can also be written as

• Any 3×3 symmetric matrix represents a conic• Matrices scaled by constants give the same conic

• Specifying five points determines a conic (passing these points)

x

>Cx = 0

C =

2

4a b/2 d/2b/2 c e/2d/2 e/2 f

3

5

Page 13: 1. Projective geometry

Proof: lies on , since

Tangents to a conic• The line tangent to a conic at a point is given by l xC

l = Cx

x

x

>l = x

>Cx = 0

Assume that there exists another point lying on and .

Cl

y

Then, for any , it should hold that ↵

(x+ ↵y)>C(x+ ↵y) = 0

This means that any point should lie on . x+ ↵y C

This is possible only if is a line or there exists no such point .C y

𝐲

𝐱𝐥

l

Page 14: 1. Projective geometry

Dual conics• A conic gives a set of points. A dual conic is another type

of conics, which gives a set of lines• Also known as line conics

• Consider , where • This gives a set of tangent lines to conic ---- (*)

l>C⇤l = 0

C⇤C

C⇤ ⌘ C�1

x

>Cx = 0

l>C⇤l = 0

C

Show the above (*) is true (2nd assignment).

Page 15: 1. Projective geometry

2D projective transformation• Projective transformation (different names: projectivity,

homography, colineation)• Definition: An invertible mapping from/to 2D projective spaces that

satisfies that if three points lie on a line, then the mapped points lie on a line.

• Intuitively, any mapping from a plane to a plane that maps a line to a line

• Such a transformation ( ) is given by the following equation:

x

0 /

2

4h11 h12 h13

h21 h22 h23

h31 h32 h33

3

5x

x

0 / Hx or

x ! x

0

Page 16: 1. Projective geometry

An example: central projection• Central projection: a point on a plane is mapped onto a point on

another plane as shown below

• Obviously, central projection maps a line to a line, and thus it is a 2d projective transformation

ππ’

xx’

Page 17: 1. Projective geometry

Calculating a projective transformation• If you want to represent the points before/after the mapping in

inhomogeneous coordinates…

x

0 /

2

4h11 h12 h13

h21 h22 h23

h31 h32 h33

3

5x

2

4x

0

y

0

1

3

5 /

2

4h11 h12 h13

h21 h22 h23

h31 h32 h33

3

5

2

4x

y

1

3

5 =

2

4h11x+ h12y + h13

h21x+ h22y + h23

h31x+ h32y + h33

3

5

x

0 =h11x+ h12y + h13

h31x+ h32y + h33

y

0 =h21x+ h22y + h23

h31x+ h32y + h33

Page 18: 1. Projective geometry

Transformation of lines and conics• A 2D projective transformation mapping a point as

• maps a line as

• proof:

• and maps a conic as

• proof:

x

0 / Hx

l0 / H�>l

C0 / H�>CH�1

x

0>l

0 = (x>H>)l0 = (x>H>)(H�>l) = x

>l = 0

x

0>C0x0 = x

>H>C0Hx = x

>H>H�>CH�1Hx = x

>Cx = 0

Page 19: 1. Projective geometry

Transformation of lines and conics

ππ’

ll’

ππ’

C

C’

Page 20: 1. Projective geometry

Hierarchy of 2D projective transformation• Projective transformation can be classified into the following

four types in the order of increasing degrees of freedom:

1. Euclidean transformation / Isometry2. Similarity transformation3. Affine transformation4. Projective transformation (full-projective ---)

x

0 /

2

4h11 h12 h13

h21 h22 h23

h31 h32 h33

3

5x

Page 21: 1. Projective geometry

Euclidean transformation• 2D projective transformations given as follows:

• Called Euclidean trans. if ε=1; isometry if ε=-1 or 1.• Combination of 2D rotation and translation• Length and area are preserved (invariant)

x

0 /

2

4" cos ✓ � sin ✓ t

x

" sin ✓ cos ✓ ty

0 0 1

3

5x

Page 22: 1. Projective geometry

Similarity transformation• 2D projective transformations given as follows:

• Combination of 2D rotation, translation, and scaling• Shape and angle are preserved (invariant)

x

0 /

2

4s cos ✓ �s sin ✓ t

x

s sin ✓ s cos ✓ ty

0 0 1

3

5x

Page 23: 1. Projective geometry

Affine transformation• 2D projective transformations given as follows:

• Parallelism is preserved• Points at infinity are mapped to points at infinity

x

0 /

2

4a11 a12 t

x

a21 a22 ty

0 0 1

3

5x

x

0 /

2

4a11 a12 t

x

a21 a22 t

y

0 0 1

3

5

2

4x1

x2

0

3

5 =

2

4a11x1 + a12x2

a21x1 + a22x2

0

3

5

x

0 /

2

4a11 a12 t

x

a21 a22 t

y

0 0 1

3

5

2

4x1

x2

0

3

5 =

2

4a11x1 + a12x2

a21x1 + a22x2

0

3

5

Page 24: 1. Projective geometry

Projective transformation• The most general one:

• Colinearity and cross-ratio are preserved• Points at infinity can be mapped to finite points

x

0 /

2

4h11 h12 h13

h21 h22 h23

h31 h32 h33

3

5x

x

0 /

2

4h11 h12 h13

h21 h22 h23

h31 h32 h33

3

5

2

4x1

x2

0

3

5 =

2

4h11x1 h12x2

h21x1 h22x2

h31x1 h32x2

3

5

x

0 /

2

4h11 h12 h13

h21 h22 h23

h31 h32 h33

3

5

2

4x1

x2

0

3

5 =

2

4h11x1 h12x2

h21x1 h22x2

h31x1 h32x2

3

5+

+

+

Page 25: 1. Projective geometry

Transformations and images• Images of a plane created by different transformations

[Hartle

y-Zisserman03

]

similarity affine projective

Page 26: 1. Projective geometry

Image rectification• Given a projective transform of a plane, we want to find a

transformation that maps it onto a similarity transform of the same plane

• Any projective trans. is determined by four point pairs

[Hartle

y-Zisserman03

]

x1x2

x3 x4 x

04x

03

x

02 x

01