Projective 2D geometry

51
Projective 2D geometry Appunti basati sulla parte iniziale del testo di R.Hartley e A.Zisserman “Multiple view geometry Rielaborazione di materiale di M.Pollefeys

description

Projective 2D geometry. Appunti basati sulla parte iniziale del testo di R.Hartley e A.Zisserman “Multiple view geometry” Rielaborazione di materiale di M.Pollefeys. Projective 2D Geometry. Points, lines & conics Transformations & invariants 1D projective geometry and the Cross-ratio. - PowerPoint PPT Presentation

Transcript of Projective 2D geometry

Page 1: Projective 2D geometry

Projective 2D geometry

Appunti basati sulla parte iniziale del testo di R.Hartley e A.Zisserman “Multiple view geometry” Rielaborazione di materiale di M.Pollefeys

Page 2: Projective 2D geometry

• Points, lines & conics• Transformations & invariants

• 1D projective geometry and the Cross-ratio

Projective 2D Geometry

Page 3: Projective 2D geometry

Homogeneous coordinates

0 cbyax Ta,b,c

0,0)()( kkcykbxka TT a,b,cka,b,c ~

Homogeneous representation of lines

equivalence class of vectors, any vector is representative

Set of all equivalence classes in R3(0,0,0)T forms P2

Homogeneous representation of points

0 cbyax Ta,b,cl Tyx,x on if and only if

0l 11 x,y,a,b,cx,y, T 0,1,,~1,, kyxkyx TT

The point x lies on the line l if and only if xTl=lTx=0

Homogeneous coordinates

Inhomogeneous coordinates Tyx, T321 ,, xxx but only 2DOF

Page 4: Projective 2D geometry

Points from lines and vice-versa

l'lx

Intersections of lines

The intersection of two lines and is l l'

Line joining two points

The line through two points and is x'xl x x'

Example

1x

1y

Line joining two points: parametric equation A point on the line through two points x and x’ is y = x + x’

Page 5: Projective 2D geometry

Ideal points and the line at infinity

T0,,l'l ab

Intersections of parallel lines

TTand ',,l' ,,l cbacba

Example

1x 2x

Ideal points T0,, 21 xx

Line at infinity T1,0,0l

l22 RP

tangent vector

normal direction

ab , ba,

Note that in P2 there is no distinction

between ideal points and others

Page 6: Projective 2D geometry

A model for the projective plane

exactly one line through two points

exaclty one point at intersection of two lines

Page 7: Projective 2D geometry

Duality

x l

0xl T0lx T

l'lx x'xl

Duality principle:

To any theorem of 2-dimensional projective geometry there corresponds a dual theorem, which may be derived by interchanging the role of points and lines in the original theorem

Page 8: Projective 2D geometry

Conics

Curve described by 2nd-degree equation in the plane

022 feydxcybxyax

0233231

2221

21 fxxexxdxcxxbxax

3

2

3

1 , xxyx

xx or homogenized

0xx CT

or in matrix form

fed

ecb

dba

2/2/

2/2/

2/2/

Cwith

fedcba :::::5DOF:

Page 9: Projective 2D geometry

Five points define a conic

For each point the conic passes through

022 feydxcyybxax iiiiii

or

0,,,,, 22 cfyxyyxx iiiiii Tfedcba ,,,,,c

0

1

1

1

1

1

552555

25

442444

24

332333

23

222222

22

112111

21

c

yxyyxx

yxyyxx

yxyyxx

yxyyxx

yxyyxx

stacking constraints yields

Page 10: Projective 2D geometry

Pole-polar relationship

The polar line l=Cx of the point x with respect to the conic C intersects the conic in two points. The two

lines tangent to C at these points intersect at x

Page 11: Projective 2D geometry

Polarity: cross ratio

Cross ratio of 4 colinear points y = x + x’ (with i=1,..,4)

ratio of ratios

i i

42

32

41

31

θ- θ

θ- θθ- θ

θ- θ

Harmonic 4-tuple of colinear points: such that CR=-1

Page 12: Projective 2D geometry

Chasles’ theorem

A B

C

DX

Conic = locus of constant cross-ratio towards 4 ref. points

Page 13: Projective 2D geometry

Polarity: conjugacyGiven a point y and a conic C, a point z is conjugated of y wrt C

if the 4-tuple (y,z,x’ ,x’’ ) is harmonic, where x’ and x’’ are the intersection points between C and line (y,z).

Intersection points (y+z) C (y +z) = 0 is a 2-nd degree equation on y Cy + 2 y Cz + z Cz = 0 --> two solutions ’and’’.

Since y and z correspond to and , harmonic -> ’+ ’’ = 0Hence the two solutions sum up to zero: y Cz = 0, and also z Cy = 0

the point z is on the line Cy, which is called the polar line of y wrt Cthe polar line Cy is the locus of the points conjugate of y wrt C

Conic C is the locus of points belonging to their own polar line y Cy = 0

TTTT 2

T T

T

Page 14: Projective 2D geometry

Correlations and conjugate points

A correlation is an invertible mapping from points of P2 to lines of P2. It is represented by a 3x3 non-singular matrix A as l=Ax

Conjugate points with respect to C(on each others polar)

0xy CT

Conjugate lines with respect to C*

(through each others pole)

0ml * CT

Page 15: Projective 2D geometry

Polarity and tangent linesConsider a line through a point y, tangent to a conic C:let us determine the point z conjugate of y wrt C:

since the intersection points coincide, then ’’’ harmonic 4-tuple: also z coincides with the tangency point

All points y on the tangent are conjugate to tangency point z wrt C

polar line of a point z on the conic C is tangent to C through z In addition: since there are two tangents to C through a point y not

on C,both tangency points are conjugate to y wrt C

polar line of y wrt C (=locus of the conjugate points) = line through the two tangency points of lines through y

Page 16: Projective 2D geometry

Tangent lines to conics

The line l tangent to C at point x on C is given by l=Cx

lx

C

Page 17: Projective 2D geometry

Dual conics0ll * CT

A line tangent to the conic C satisfies

Dual conics = line conics = conic envelopes

1* CCIn general (C full rank): in fact

Line l is the polar line of y : y = C l , but since y Cy = 0

l C C C l = 0 C = C = C

-1 T

-T -1T -T* -1

Page 18: Projective 2D geometry

Degenerate conics

A conic is degenerate if matrix C is not of full rank

TT mllm C

e.g. two lines (rank 2)

e.g. repeated line (rank 1)

TllC

l

l

m

Degenerate line conics: 2 points (rank 2), double point (rank1)

CC **Note that for degenerate conics

Page 19: Projective 2D geometry

Projective transformations

A projectivity is an invertible mapping h from P2 to itself such that three points x1,x2,x3 lie on the same line if and

only if h(x1),h(x2),h(x3) do.

Definition:

A mapping h:P2P2 is a projectivity if and only if there exist a non-singular 3x3 matrix H such that for any point in P2 represented by a vector x it is true that h(x)=Hx

Theorem:

Definition: Projective transformation

3

2

1

333231

232221

131211

3

2

1

'

'

'

x

x

x

hhh

hhh

hhh

x

x

x

xx' Hor

8DOF

projectivity=collineation=projective transformation=homography

Page 20: Projective 2D geometry

Mapping between planes

central projection may be expressed by x’=Hx(application of theorem)

Page 21: Projective 2D geometry

Removing projective distortion

333231

131211

3

1

'

''

hyhxh

hyhxh

x

xx

333231

232221

3

2

'

''

hyhxh

hyhxh

x

xy

131211333231' hyhxhhyhxhx 232221333231' hyhxhhyhxhy

select four points in a plane with known coordinates

(linear in hij)

(2 constraints/point, 8DOF 4 points needed)

Remark: no calibration at all necessary, better ways to compute (see later)

Page 22: Projective 2D geometry

More examples

Page 23: Projective 2D geometry

Transformation of lines and conics

Transformation for lines

ll' -TH

Transformation for conics-1-TCHHC '

Transformation for dual conicsTHHCC **'

xx' HFor a point transformation

Page 24: Projective 2D geometry

A hierarchy of transformations

Projective linear group Affine group (last row (0,0,1)) Euclidean group (upper left 2x2 orthogonal) Oriented Euclidean group (upper left 2x2 det 1)

Alternative, characterize transformation in terms of elements or quantities that are preserved or invariant

e.g. Euclidean transformations leave distances unchanged

Page 25: Projective 2D geometry

Class I: Isometries(iso=same, metric=measure)

1100

cossin

sincos

1

'

'

y

x

t

t

y

x

y

x

1

11

orientation preserving:orientation reversing:

x0

xx'

1

tT

RHE IRR T

special cases: pure rotation, pure translation

3DOF (1 rotation, 2 translation)

Invariants: length, angle, area

Page 26: Projective 2D geometry

Class II: Similarities(isometry + scale)

1100

cossin

sincos

1

'

'

y

x

tss

tss

y

x

y

x

x0

xx'

1

tT

RH

sS IRR T

also know as equi-form (shape preserving)

metric structure = structure up to similarity (in literature)

4DOF (1 scale, 1 rotation, 2 translation)

Invariants: ratios of length, angle, ratios of areas, parallel lines

Page 27: Projective 2D geometry

Class III: Affine transformations

11001

'

'

2221

1211

y

x

taa

taa

y

x

y

x

x0

xx'

1

tT

AH A

non-isotropic scaling! (2DOF: scale ratio and orientation)

6DOF (2 scale, 2 rotation, 2 translation)

Invariants: parallel lines, ratios of parallel segment lengths, ratios of areas

DRRRA

2

1

0

0

D

))(( TTT VDVUVUDVA

where

Page 28: Projective 2D geometry

Action of affinities and projectivities

on line at infinity

2211

2

1

2

1

0v

xvxvx

xx

x

vAA

T

t

000 2

1

2

1

x

xx

x

vAA

T

t

Line at infinity becomes finite,

allows to observe vanishing points, horizon,

Line at infinity stays at infinity,

but points move along line

Page 29: Projective 2D geometry

Class VI: Projective transformations

xv

xx'

vP T

tAH

Action: non-homogeneous over the plane

8DOF (2 scale, 2 rotation, 2 translation, 2 line at infinity)

Invariants: cross-ratio of four points on a line

(ratio of ratio)

T21,v vv

Page 30: Projective 2D geometry

Decomposition of projective transformations

vv

sPAS TTTT v

t

v

0

10

0

10

t AIKRHHHH

Ttv RKA s

K 1det Kupper-triangular,decomposition unique (if chosen s>0)

0.10.20.1

0.2242.8707.2

0.1586.0707.1

H

121

010

001

100

020

015.0

100

0.245cos245sin2

0.145sin245cos2

H

Example:

Page 31: Projective 2D geometry

Overview transformations

1002221

1211

y

x

taa

taa

1002221

1211

y

x

tsrsr

tsrsr

333231

232221

131211

hhh

hhh

hhh

1002221

1211

y

x

trr

trr

Projective8dof

Affine6dof

Similarity4dof

Euclidean3dof

Concurrency, collinearity, order of contact (intersection, tangency, inflection, etc.), cross ratio

Parallellism, ratio of areas, ratio of lengths on parallel lines (e.g midpoints), linear combinations of vectors (centroids). The line at infinity l∞

Ratios of lengths, angles.The circular points I,J

lengths, areas.

Page 32: Projective 2D geometry

Number of invariants?

The number of functional invariants is equal to, or greater than, the number of degrees of freedom of the configuration less the number of degrees of freedom of the transformation

e.g. configuration of 4 points in general position has 8 dof (2/pt)

and so 4 similarity, 2 affinity and zero projective invariants

Page 33: Projective 2D geometry

Projective geometry of 1D

x'x 22H

The cross ratio

Invariant under projective transformations

T21, xx

3DOF (2x2-1)

02 x

4231

43214321 x,xx,x

x,xx,xx,x,x,x Cross

22

11detx,x

ji

ji

ji xx

xx

Page 34: Projective 2D geometry

Recovering metric and affine properties from images

• Parallelism• Parallel length ratios

• Angles • Length ratios

Page 35: Projective 2D geometry

The line at infinity

l

1

0

0

1

0ll

TT

TT

At

AH A

The line at infinity l is a fixed line under a projective transformation H if and only if H is an affinity

Note: not fixed pointwise

Page 36: Projective 2D geometry

Affine properties from images

projection rectification

AP

lll

HH

321

010

001

' 0,l' 3321 llll T

in fact, any point x on l’ is mapped to a point at the ∞ ∞

Page 37: Projective 2D geometry

Affine rectificationv1 v2

l1

l2 l4

l3

l∞

21 vvl

211 llv 432 llv

Page 38: Projective 2D geometry

Distance ratios

badd :c,b:b,a

T0,1v' H

TTT 1,,1,,1,0 baa

c,b,a H

Page 39: Projective 2D geometry

The circular points

0

1

I i

0

1

J i

I

0

1

0

1

100

cossin

sincos

II

iseitss

tssi

y

x

S

H

The circular points I, J are fixed points under the projective transformation H iff H is a similarity

Page 40: Projective 2D geometry

The circular points

“circular points”

0233231

22

21 fxxexxdxxx 02

221 xx

l∞

T

T

0,,1J

0,,1I

i

i

TT 0,1,00,0,1I iAlgebraically, encodes orthogonal directions

03 x

Intersection points between any circle and l∞

Page 41: Projective 2D geometry

Conic dual to the circular points

TT JIIJ* C

000

010

001*C

TSS HCHC **

The dual conic is fixed conic under the projective transformation H iff H is a similarity

*C

Note: has 4DOF

l∞ is the null vector

*C

A line conic: set of lines through any of the circular points

Page 42: Projective 2D geometry

Angles

mmll

mlcos

**

*

22

21

22

21

2211

CC

CTT

T

mmll

mlml

T321 ,,l lll T321 ,,m mmmEuclidean:

Projective: m''m'l''l'

m''l'cos

**

*

CC

CTT

T

0m'l * CT (orthogonal)

m''l'm'l'ml *** CHHCC TTTTin fact, e.g.

Page 43: Projective 2D geometry

Length ratios

sin

sin

),(

),(

cad

cbd

Page 44: Projective 2D geometry

Metric properties from images

vvv

v

'

*

*

**

TT

TT

T

TT

T

K

KKK

HHCHH

HHHCHHH

HHHCHHHC

APAP

APSSAP

SAPSAP

TUUC

000

010

001

'*

Rectifying transformation from SVD

UH

Page 45: Projective 2D geometry

Normally: SVD (Singular Value Decomposition)

TUVC

c

b

a

00

00

00

'*

But is symmetric '*C '' **

CVDUUDVC TTT

and SVD is unique VU

with U and V orthogonal

TUUC

000

010

001

'*Why ?

Observation : H=Uorthogonal (3x3): not a P2 isometry

Page 46: Projective 2D geometry

Once the image has been affinely rectified

TAA HCHC ** '

0000

010

001

'*

T

T

T

T

T 1t1

t

0

0KK0K

0

KC

Metric from affine

Page 47: Projective 2D geometry

Metric from affine

000

0

3

2

1

321

m

m

m

lllTKK

0,,,, 2221211

212

21122122111

Tkkkkkmlmlmlml

Page 48: Projective 2D geometry

Metric from projective

0c,,,,, 332332133122122111 5.05.05.0 mlmlmlmlmlmlmlmlml

0vvv

v

3

2

1

321

m

m

m

lllTT

TT

K

KKK

Page 49: Projective 2D geometry

Projective conic classificationTUDUC -TCUUD 1

321321321 ,,diag,,diag,,diag ssseeesssD0or 1ie

Diagonal Equation Conic type

(1,1,1) improper conic

(1,1,-1) circle

(1,1,0) single real point

(1,-1,0) two lines

(1,0,0) single line

0222 wyx

0222 wyx

022 yx

022 yx

02 x

Page 50: Projective 2D geometry

Affine conic classification

ellipse parabola hyperbola

Page 51: Projective 2D geometry

Fixed points and lines

ee H (eigenvectors H =fixed points)

ll TH (eigenvectors H-T =fixed lines)

(1=2 pointwise fixed line)