Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation...

45
Projective Geometry Jianbo Shi Some slides taken from Steve Seitz

Transcript of Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation...

Page 1: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

ProjectiveGeometry

JianboShi

SomeslidestakenfromSteveSeitz

Page 2: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

(R,t)

Camera coordinate

y y’fz C

yc

xc

zcp

World coordinate

x=Kr1 r2txw

yw1

Recall for planar surface

X = K H3x3 XWe have the homographic mapping:

H3x3

Page 3: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

(R,t)

Camera coordinate

y y’fz C

yc

xc

zcp

World coordinate

x=Kr1 r2txw

yw1

Recall for planar surface

H3x3

This implies if we have H, 1) We can recover the full rotation matrix, R, 2) We can recover the position vector t

Page 4: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Projective Transformation

Page 5: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

From Plane to Plane

Page 6: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

ProjectivetransformationGoal: study geometry of image projection from one plane to another plane(the image plane).

Facts: 1) parallel lines intersect, 2) circle becomes ellipses, 3) straight line is still straight

Page 7: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Projectivetransformation

Definition: Line remains a line!Projective transform is an invertible mapping from to itself, such that three points lies on a same line iff do.

0 0.5 1

0

0.2

0.4

0.6

0.8

1

0.6 0.8 1 1.2

2

2.2

2.4

2.6

2.8

3

3.2

3.4

x1

x2

x3

h(x1)

h(x2)

h(x3)

Page 8: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

• Theorem:

Projectivetransformation

Check what happened to lies on line l?

Line Mapping:

Page 9: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

=

x’y’

xy

How many independent para? Can we always set h33 = 1?

Page 10: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Classesof2Dprojectivetransformations

Page 11: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Special case: Similarity TransformationSimilarity

0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5 2

2

2.5

3

3.5

4

4.5

Page 12: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

SpecialCase:AffineTransformation

0 0.1 0.2 0.3 0.4 0.5

0

0.05

0.1

0.15

0.2

0.25

0.3

0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.5 1 1.5

0

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Page 13: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Special case: Projective transformation

0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.1 0.2 0.3 0.4 0.5

0

0.05

0.1

0.15

0.2

0.25

0.3

Page 14: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image
Page 15: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Example

0.6 0.8 1 1.2

2

2.2

2.4

2.6

2.8

3

3.2

3.40 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

10 0.1 0.2 0.3

0

0.1

0.2

0.3

0.4

0.5

0.6

0 0.1 0.2 0.3 0.4 0.5

0

0.05

0.1

0.15

0.2

0.25

0.3

Page 16: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Example

• Projective

0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0 0.1 0.2 0.3 0.4 0.5

0

0.05

0.1

0.15

0.2

0.25

0.3

Page 17: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Example

Affine

0 0.1 0.2 0.3

0

0.1

0.2

0.3

0.4

0.5

0.6

0 0.1 0.2 0.3 0.4 0.5

0

0.05

0.1

0.15

0.2

0.25

0.3

Page 18: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Example

0 0.1 0.2 0.3

0

0.1

0.2

0.3

0.4

0.5

0.6

Similarity

0.6 0.8 1 1.2

2

2.2

2.4

2.6

2.8

3

3.2

3.4

Page 19: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Points, Lines & Projective Transformation

Page 20: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Lines under Projective Transformation

•With homogenous coordinates:

•Point:

•Line:

l0 = H�T l

Page 21: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Before transformation

Page 22: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

After transformation

Page 23: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Just checking…

• Verify:

Page 24: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Vanishing point, revisited

Page 25: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Points at infinity: Revisited

• Where are the points at infinity in the image plane? – The point at infinity can be in the FINITE region

of the image !

Page 26: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Example

Page 27: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Seeing vanishing point

• vanishing point of horizontal direction:

Page 28: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

• In the image plane:

Lineatinfinity:Revisited

• Alinepassingallpointsatinfinity:

Page 29: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Line of infinity

• line of infinity is:

Notice:thisisthelastcolumnof

Page 30: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

The line of infinity

Page 31: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

ComparingheightsVanishing

Point

Page 32: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Measuringheight

1

2

3

4

55.4

2.8

3.3

Camera height

Page 33: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

q1

Computingvanishingpoints(fromlines)

• Intersectp1q1 withp2q2

v

p1

p2

q2

Least squares version• Better to use more than two lines and compute the “closest” point of

intersection• See notes by Bob Collins for one good way of doing this:

– http://www-2.cs.cmu.edu/~ph/869/www/notes/vanishing.txt

Page 34: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Vanishingpoint

Vanishingline

Vanishingpoint

Vertical vanishingpoint

(at infinity)

Criminisi ’99

Page 35: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

C

Measuringheightwithoutaruler

groundplane

Compute Y from image measurements• Need more than vanishing points to do this

Y

Page 36: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Measuring height

RH

vz

r

b

t

H

b0

t0

vvx vy

vanishing line (horizon)

Page 37: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Measuring height vz

r

b

t0

vx vy

vanishing line (horizon)

v

t0

m0

What if the point on the ground plane b0 is not known?

• Here the guy is standing on the box

• Use one side of the box to help find b0 as shown above

b0

t1

b1

Page 38: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

What if vz is not infinity?

Page 39: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image
Page 40: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Thecrossratio• AProjectiveInvariant

– Something thatdoesnotchangeunderprojectivetransformations(including perspectiveprojection)

P1

P2

P3

P4

1423

2413

PPPPPPPP

−−

−−

The cross-ratio of 4 collinear points

Can permute the point ordering• 4! = 24 different orders (but only 6 distinct values)

This is the fundamental invariant of projective geometry

⎥⎥⎥⎥

⎢⎢⎢⎢

=

1i

i

i

i ZYX

P

3421

2431

PPPPPPPP

−−

−−

Page 41: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

vZ

rt

b

tvbrrvbt−−

−−

Z

Z

image cross ratio

Measuringheight

B (bottom of object)

T(top of object)

R(reference point)

ground plane

HC

TBRRBT

−∞−

−∞−

scene cross ratio

⎥⎥⎥⎥

⎢⎢⎢⎢

=

1ZYX

P⎥⎥⎥

⎢⎢⎢

=

1yx

pscene points represented as image points as

RH

=

RH

=

R

Page 42: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Measuring height

RH

vz

r

b

t

R

H

Z

Z=

−−

−−

tvbr

rvbt

image cross ratio

H

b0

t0

vvx vy

vanishing line (horizon)

Page 43: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Measuring heights of people

Here we go !

reference185.3 cm

Page 44: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Forensic Science: measuring heights of suspects

Vanishing line

Refe

ren

ce h

eig

ht

Reference height

Page 45: Projective Geometry - Information and Computer Sciencecis580/Spring2016/...Projective transformation Goal: study geometry of image projection from one plane to another plane(the image

Assessing geometric accuracy

Flagellation, Piero della Francesca

Estimated relative heights

Are the heights of the 2 groups of people consistent with each other?