projective geometry - università ca' foscari venezia

36
Projecve Geometry

Upload: others

Post on 15-Nov-2021

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Projective Geometry - Università Ca' Foscari Venezia

Projective Geometry

Page 2: Projective Geometry - Università Ca' Foscari Venezia

Image formation

Let’s design a camera– Idea 1: put a piece of film in front of an object– Do we get a reasonable image?

Slide source: Seitz

Page 3: Projective Geometry - Università Ca' Foscari Venezia

Pinhole camera

Idea 2: add a barrier to block off most of the rays– This reduces blurring– The opening known as the aperture

Slide source: Seitz

Page 4: Projective Geometry - Università Ca' Foscari Venezia

Pinhole camera

Figure from Forsyth

f

f = focal lengthc = center of the camera

c

Page 5: Projective Geometry - Università Ca' Foscari Venezia

Projection can be tricky…Slide source: Seitz

Page 6: Projective Geometry - Università Ca' Foscari Venezia

Projection can be tricky…Slide source: Seitz

Making of 3D sidewalk art: http://www.youtube.com/watch?v=3SNYtd0Ayt0

Page 7: Projective Geometry - Università Ca' Foscari Venezia

Projective Geometry

What is lost?• Length

Which is closer?

Who is taller?

Page 8: Projective Geometry - Università Ca' Foscari Venezia

Length is not preserved

Figure by David Forsyth

B’

C’

A’

Page 9: Projective Geometry - Università Ca' Foscari Venezia

Projective Geometry

What is lost?• Length• Angles

Perpendicular?

Parallel?

Page 10: Projective Geometry - Università Ca' Foscari Venezia

Projective Geometry

What is preserved?• Straight lines are still straight

Page 11: Projective Geometry - Università Ca' Foscari Venezia

Vanishing points and linesParallel lines in the world intersect in the image at a “vanishing point”

Page 12: Projective Geometry - Università Ca' Foscari Venezia

Vanishing points and lines

oVanishing Point oVanishing Point

Vanishing Line

• The projections of parallel 3D lines intersect at a vanishing point• The projection of parallel 3D planes intersect at a vanishing line• If a set of parallel 3D lines are also parallel to a particular plane, their

vanishing point will lie on the vanishing line of the plane• Not all lines that intersect are parallel• Vanishing point <-> 3D direction of a line• Vanishing line <-> 3D orientation of a surface

Page 13: Projective Geometry - Università Ca' Foscari Venezia

Vanishing points and lines

Vanishing point

Vanishing line

Vanishing point

Vertical vanishing point

(at infinity)

Slide from Efros, Photo from Criminisi

Page 14: Projective Geometry - Università Ca' Foscari Venezia

Vanishing points and lines

Photo from online Tate collection

Page 15: Projective Geometry - Università Ca' Foscari Venezia

Note on estimating vanishing points

Use multiple lines for better accuracy… but lines will not intersect at exactly the same point in practice

One solution: take mean of intersecting pairs… bad idea!

Instead, minimize angular differences

Page 16: Projective Geometry - Università Ca' Foscari Venezia

Vanishing objects

Page 17: Projective Geometry - Università Ca' Foscari Venezia

Projection: world coordinates ↔ image coordinates

Camera Center (tx, ty, tz)

.

.

. f Z Y.Optical Center (u0, v0)

v

u

P=(u,v)T

P=(X,Y,Z)T

Page 18: Projective Geometry - Università Ca' Foscari Venezia

Homogeneous coordinates

Conversion

Converting to homogeneous coordinates

homogeneous image coordinates

homogeneous scene coordinates

Converting from homogeneous coordinates

Page 19: Projective Geometry - Università Ca' Foscari Venezia

Homogeneous coordinates

Invariant to scaling

Point in Cartesian is ray in Homogeneous

Homogeneous Coordinates

Cartesian Coordinates

Page 20: Projective Geometry - Università Ca' Foscari Venezia

Basic geometry in homogeneous coordinates

• Line equation: ax + by + c = 0

• Append 1 to pixel coordinate to get homogeneous coordinate

• Line given by cross product of two points

• Intersection of two lines given by cross product of the lines

jiij ppline

jiij linelineq

Page 21: Projective Geometry - Università Ca' Foscari Venezia

Another problem solved by homogeneous coordinates

Cartesian: (Inf, Inf)Homogeneous: (1, 1, 0)

Intersection of parallel linesCartesian: (Inf, Inf) Homogeneous: (1, 2, 0)

Page 22: Projective Geometry - Università Ca' Foscari Venezia

Slide Credit: Saverese

Projection matrix

x: Image Coordinates: (u,v,1)K: Intrinsic Matrix (3x3)R: Rotation (3x3) t: Translation (3x1)X: World Coordinates: (X,Y,Z,1)

Ow

iw

kw

jwR,T

XtRKx

Page 23: Projective Geometry - Università Ca' Foscari Venezia

K

Projection matrix

Intrinsic Assumptions• Unit aspect ratio• Optical center at (0,0)• No skew

Extrinsic Assumptions• No rotation• Camera at (0,0,0)

X0IKx

Page 24: Projective Geometry - Università Ca' Foscari Venezia

Remove assumption: known optical center

Intrinsic Assumptions• Unit aspect ratio• No skew

Extrinsic Assumptions• No rotation• Camera at (0,0,0)

K

X0IKx

Page 25: Projective Geometry - Università Ca' Foscari Venezia

Remove assumption: square pixels

Intrinsic Assumptions• No skew

Extrinsic Assumptions• No rotation• Camera at (0,0,0)

K

X0IKx

Page 26: Projective Geometry - Università Ca' Foscari Venezia

Remove assumption: non-skewed pixels

Intrinsic Assumptions Extrinsic Assumptions• No rotation• Camera at (0,0,0)

Note: different books use different notation for parameters

K

X0IKx

Page 27: Projective Geometry - Università Ca' Foscari Venezia

Oriented and Translated Camera

Ow

iw

kw

jw

t

R

Page 28: Projective Geometry - Università Ca' Foscari Venezia

3D Rotation of Points

Rotation around the coordinate axes, counter-clockwise:

p

p’

y

z

Slide Credit: Saverese

100

0cossin

0sincos

)(

cos0sin

010

sin0cos

)(

cossin0

sincos0

001

)(

z

y

x

R

R

R

Page 29: Projective Geometry - Università Ca' Foscari Venezia

Allow camera rotation

XtRKx

Page 30: Projective Geometry - Università Ca' Foscari Venezia

Degrees of freedom

5 6

XtRKx

Page 31: Projective Geometry - Università Ca' Foscari Venezia

Vanishing Point = Projection from Infinity

R

R

R

z

y

x

z

y

x

z

y

x

KpKRptRKp

0

R

R

R

z

y

x

vf

uf

v

u

w

100

0

0

10

0 0uz

fxu

R

R

0vz

fyv

R

R

Page 32: Projective Geometry - Università Ca' Foscari Venezia

Orthographic Projection

• Special case of perspective projection– Distance from the COP to the image plane is infinite

– Also called “parallel projection”– What’s the projection matrix?

Image World

Slide by Steve Seitz

11000

0010

0001

1z

y

x

v

u

w

Page 33: Projective Geometry - Università Ca' Foscari Venezia

Scaled Orthographic Projection

• Special case of perspective projection– Object dimensions are small compared to distance to

camera

– Also called “weak perspective”– What’s the projection matrix?

Image World

Slide by Steve Seitz

1000

000

000

1z

y

x

s

f

f

v

u

w

Page 34: Projective Geometry - Università Ca' Foscari Venezia

Example

Near field: object appearance changes as objects translate

Far field: object appearance doesn’t change as objects translate

Page 35: Projective Geometry - Università Ca' Foscari Venezia

Beyond Pinholes: Radial Distortion• Common in wide-angle lenses or for

special applications (e.g., security)• Creates non-linear terms in projection• Usually handled by through solving for

non-linear terms and then correcting image

Image from Martin Habbecke

Corrected Barrel Distortion

Page 36: Projective Geometry - Università Ca' Foscari Venezia

Things to remember

• Vanishing points and vanishing lines

• Pinhole camera model and camera projection matrix

• Homogeneous coordinates

Vanishing point

Vanishing

line

Vanishing point

Vertical vanishing point

(at infinity)

XtRKx