Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D...

28
Computer Vision cmput 499/615 Lecture 8: Lecture 8: 3D projective 3D projective geometry and it’s geometry and it’s applications applications Martin Jagersand Martin Jagersand

Transcript of Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D...

Page 1: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Computer Visioncmput 499/615

Lecture 8:Lecture 8:

3D projective geometry and 3D projective geometry and it’s applicationsit’s applications

Martin JagersandMartin Jagersand

Page 2: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

First 1D Projective lineProjective Coordinates

• Basic projective invariant in Basic projective invariant in PP11: the : the cross ratiocross ratio

a

a b

c

d

acbd

b cd

acbd=

Requires 4 points:3 to create a coordinate systemThe fourth is positioned within that system

inhomogeneous

Page 3: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Cross ratio

• Basic projective invariant in Basic projective invariant in PP11: the : the cross ratiocross ratio

•Properties:Properties:– Defines coordinates along a 1d projective lineDefines coordinates along a 1d projective line– Independent of the homogeneous representation of Independent of the homogeneous representation of xx– Valid for ideal points Valid for ideal points – Invariant under homographiesInvariant under homographies

22

11

4231

43214321 det},;,{

ji

jiji xx

xxxx

xxxx

xxxxxxxx

homogeneous

HZ CH 2.5

Page 4: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Projective 3D space

0),,,,( 44321 xxxxxX

),,()1,,,(

)/,/,/(),,,( 4342414321

ZYXZYX

xxxxxxxxxx

)0,,,( 321 xxx

•Projective transformation:Projective transformation: –4x4 nonsingular matrix 4x4 nonsingular matrix HH–Point transformationPoint transformation–Plane transformationPlane transformation

•Quadrics:Quadrics: QQ Dual: Dual: Q*Q*–4x4 symmetric matrix Q4x4 symmetric matrix Q

–9 DOF (defined by 9 points in general pose)9 DOF (defined by 9 points in general pose)

•PointsPoints

•PlanesPlanes0

),,,( 4321

πT

Points and planes are dual in 3d projective

space.

ππ

XXTH

H

'

'

0XX QT 0* ππ QT

•Lines: 5DOF, various parameterizationsLines: 5DOF, various parameterizations

Page 5: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

3D points

TT

1 ,,,1,,,X4

3

4

2

4

1 ZYXX

X

X

X

X

X

in R3

04 X

TZYX ,,

in P3

XX' H (4x4-1=15 dof)

projective transformation

3D point

T4321 ,,,X XXXX

Page 6: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Planes

0ππππ 4321 ZYX

0ππππ 44332211 XXXX

0Xπ T

Dual: points ↔ planes, lines ↔ lines

3D plane

0X~

n dT T321 π,π,πn TZYX ,,X

~ 14 Xd4π

Euclidean representation

n/d

XX' Hππ' -TH

Transformation

Page 7: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Planes from points

X

X

X

3

2

1

T

T

T

2341DX T123124134234 ,,,π DDDD

0det

4342414

3332313

2322212

1312111

XXXX

XXXX

XXXX

XXXX

0πX 0πX 0,πX π 321 TTT andfromSolve

(solve as right nullspace of )π

T

T

T

3

2

1

X

X

X

0XXX Xdet 321

Or implicitly from coplanarity condition

124313422341 DXDXDX 01234124313422341 DXDXDXDX 13422341 DXDX

Page 8: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Representing a plane byby lin comb of 3 points

xX M 321 XXXM

0π MT

I

pM

Tdcba ,,,π T

a

d

a

c

a

bp ,,

Representing a plane by its nullspace span M

All points lin comb of basis

Canonical form:Given a plane nullspace span M is

Page 9: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Points from planes

0X

π

π

π

3

2

1

T

T

T

0Xπ 0Xπ 0,Xπ X 321 TTT andfromSolve

(solve as right nullspace of )X

T

T

T

3

2

1

π

π

π

Page 10: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Lines

T

T

B

AW μBλA

T

T

Q

PW* μQλP

22** 0WWWW TT

0001

1000W

0010

0100W*

Example: X-axis

(4dof)

Join of two points: A, B

Intersection of two planes: P, Q

Page 11: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Points, lines and planes

TX

WM 0π M

W*

M 0X M

W

X

*W

π

Join of point X and line W is plane

Intersection of line W with plane is point X

Page 12: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Affine space

Difficulties with a projective space:Difficulties with a projective space:– Nonintuitive notion of direction:Nonintuitive notion of direction:

– Parallelism is not represented– Infinity not distinguishedInfinity not distinguished– No notion of “inbetweenness”: No notion of “inbetweenness”:

– Projective lines are topologically circular– Only cross-ratios are availableOnly cross-ratios are available

– Ratios are required for many practical tasks

A

B +/-

Solution: find the plane at infinity!

•Transform the model to give ∞ its canonical coordinates

•2D analogy: fix the horizon line

Determining the plane at infinity upgrades the geometry from projective to affine

)1,0,0,0(π

)1,0,0(l

Page 13: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

From projective to affine

• Finding the plane (line, point) at infinity Finding the plane (line, point) at infinity – 2 or 3 sets of parallel lines 2 or 3 sets of parallel lines (meeting at “infinite” points)(meeting at “infinite” points)

– a known ratio can also determine infinite pointsa known ratio can also determine infinite points

l

2D

3D

1Dp

21

11

x

21

23

1x2(1+x)

= cross ratio

Page 14: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

From projective to affine

HZ

2D

3D

Projective Affine

Page 15: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Affine space

•Affine transformationAffine transformation– 12 DOF12 DOF

– Leaves Leaves unchangedunchanged

• InvariantsInvariants– Ratio of lengths on a lineRatio of lengths on a line– Ratios of anglesRatios of angles– ParallelismParallelism

100034333231

24232221

14131211

aaaa

aaaa

aaaa

H A

Kutulakos and Vallino, Calibration-Free Augmented

Reality, 1998

Page 16: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Metric space

•Metric transformation (similarity)Metric transformation (similarity)– 7 DOF7 DOF– Maps absolute conic to itself Maps absolute conic to itself

• InvariantsInvariants– Length ratiosLength ratios– AnglesAngles– The absolute conicThe absolute conic

1TS

sRH

O

t

Without a yard stick, this is the highest level of geometric structure that can be retrieved from images

Page 17: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

The absolute conic

• Absolute conic is an imaginary circle onAbsolute conic is an imaginary circle on• It is the intersection of every sphere with It is the intersection of every sphere with

• In a metric frameIn a metric frame

π

0),,(),,(

0

)1,0,0,0(

321321

4

23

22

21

TxxxIxxx

x

xxx

π

0

0*

*

T

T

I

0

0

On : π

*

absolute dual quadric

π

Page 18: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

From affine to metric

• IdentifyIdentify on on OR identify OR identify– via angles, ratios of lengths – e.g. perpendicular lines

•Upgrade the geometry by bringingUpgrade the geometry by bringing to its to its canonical form via an affine transformation canonical form via an affine transformation

2D3D

π *

021 dd T

1D ?

Page 19: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Examples

2D

3D

Affine Metric

Two pairs of perpendicular lines

5 known points

Page 20: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

What good is a projective model?

Represents fundamental feature interactions

Used in rendering with an unconventional engine:

Achieving 3d tasksvia

2d image control

Visual Servoing

Physical Objects!

f1

f2

f3

Tcol(f1,f2,f3) = f1 - f2f3

collinearity task

Page 21: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

What good is a projective model?

Represents fundamental feature interactions

Used in rendering with an unconventional engine:

Achieving 3d tasksvia

2d image control

Visual Servoing

Physical Objects!

Y12

y22

y32

y31

y21

y11

image collinearity constraint

Page 22: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

A point meets a line in each of two images...

Collinearity?

Page 23: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Collinearity?

But it doesn’t guarantee task achievement !

Page 24: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

All achievable tasks...

are ALL projectively distinguishable

coordinate systems

One point

Coincidence

Noncoincidence

1000

1000

1000

1000

0100

1000

1000

1000

1000

1000

0100

1000

0100

0010

Collinearity

General Position

2pt. coincidence

3pt. coincidence

1000

0100

1100

1000

1000

1000

1000

1000

1000

0100

0100

1000

0100

1100

100

1000

0100

0010

1110

1000

0100

0010

0001

4pt. coincidence

2 2pt. coincidence

Cross Ratio

General Position

Coplanarity

Page 25: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Tpp

Tcol

Tcopl

Tcr

point-coincidence

collinearitycoplanarity

cross ratios ()

Cinj

Cwk

Task primitives

Tpp

Injective

Projective

Composing possible tasks

Task operators

T1 T2 = T1 T2 = T1•T2 T = 0 if T = 0

1 otherwise

T1

T2

AND OR NOT

Page 26: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

wrench: view 1 wrench: view 2

Twrench(x1..8) =

Tcol(x2,x5,x6)Tcol(x4,x7,x8)

Tpp(x1,x5) Tpp(x3,x7) 1

2

34

56

78

Result: Task toolkit

Page 27: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

GroupGroup TransformationTransformation InvariantsInvariants DistortionDistortion

ProjectiveProjective

15 DOF15 DOF

• Cross ratioCross ratio

• IntersectionIntersection

• TangencyTangency

AffineAffine

12 DOF12 DOF

• ParallelismParallelism

• Relative dist in 1dRelative dist in 1d

• Plane at infinityPlane at infinity

MetricMetric

7 DOF7 DOF

• Relative distancesRelative distances

• AnglesAngles

• Absolute conicAbsolute conic

EuclideanEuclidean

6 DOF6 DOF

• LengthsLengths

• AreasAreas

• VolumesVolumes

Geometric strata: 3d overview

1TS

sRH

O

t

1TA

AH

O

t

1TE

RH

O

t

v

AH TP v

t

π

3DOFπ

5DOF

Faugeras ‘95

Page 28: Computer Vision cmput 499/615 Lecture 8: 3D projective geometry and it’s applications 3D projective geometry and it’s applications Martin Jagersand.

Perspective and projection

• Euclidean geometry is not the only representation- for building models from images- for building images from models

representations ?

• But when 3d realism is the goal, how can we effectively build and use

projectiveaffinemetric