41

Reconnaissance d’objets et vision artificielle Jean Ponce ([email protected]) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Embed Size (px)

Citation preview

Page 1: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire
Page 2: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Reconnaissance d’objetset vision artificielle

Jean Ponce ([email protected])http://www.di.ens.fr/~ponce

Equipe-projet WILLOWENS/INRIA/CNRS UMR 8548Laboratoire d’Informatique

Ecole Normale Supérieure, Paris

Page 3: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Outline

• Motivation: Making mosaics• Perspetive and weak perspective• Coordinates changes• Intrinsic and extrensic parameters• Affine registration• Projective registration

Page 4: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Feature-based alignment outline

Page 5: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Feature-based alignment outline

Extract features

Page 6: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Feature-based alignment outline

Extract features

Compute putative matches

Page 7: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Feature-based alignment outline

Extract features

Compute putative matches

Loop:• Hypothesize transformation T (small group of putative

matches that are related by T)

Page 8: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Feature-based alignment outline

Extract features

Compute putative matches

Loop:• Hypothesize transformation T (small group of putative

matches that are related by T)• Verify transformation (search for other matches consistent

with T)

Page 9: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Feature-based alignment outline

Extract features

Compute putative matches

Loop:• Hypothesize transformation T (small group of putative

matches that are related by T)• Verify transformation (search for other matches consistent

with T)

Page 10: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

2D transformation models

Similarity(translation, scale, rotation)

Affine

Projective(homography)

Why these transformations ???

Page 11: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Pinhole perspective equation

z

yfy

z

xfx

''

''NOTE: z is always negative..

Page 12: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Affine models: Weak perspective projection

0

'where

'

'

z

fm

myy

mxx

is the magnification.

When the scene relief is small compared its distance from theCamera, m can be taken constant: weak perspective projection.

Page 13: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Affine models: Orthographic projection

yy

xx

'

' When the camera is at a(roughly constant) distancefrom the scene, take m=1.

Page 14: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Analytical camera geometry

Page 15: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Coordinate Changes: Pure Translations

OBP = OBOA + OAP , BP = AP + BOA

Page 16: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Coordinate Changes: Pure Rotations

BABABA

BABABA

BABABABAR

kkkjki

jkjjji

ikijii

...

...

...

TB

A

TB

A

TB

A

k

j

i

ABA

BA

B kji

Page 17: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Coordinate Changes: Rotations about

the z Axis

100

0cossin

0sincos

RBA

Page 18: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

A rotation matrix is characterized by the following properties:

• Its inverse is equal to its transpose, and

• its determinant is equal to 1.

Or equivalently:

• Its rows (or columns) form a right-handedorthonormal coordinate system.

Page 19: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Coordinate changes: pure rotations

PRP

z

y

x

z

y

x

OP

ABA

B

B

B

B

BBBA

A

A

AAA

kjikji

Page 20: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Coordinate Changes: Rigid Transformations

ABAB

AB OPRP

11111

PT

OPRPORP ABA

ABAB

AA

TA

BBA

B

0

Page 21: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Pinhole perspective equation

z

yfy

z

xfx

''

''NOTE: z is always negative..

Page 22: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

The intrinsic parameters of a camera

Normalized imagecoordinates

Physical image coordinates

Units:k,l : pixel/m

f : m

, a b : pixel

Page 23: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

The intrinsic parameters of a camera

Calibration matrix

The perspectiveprojection equation

Page 24: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

The extrinsic parameters of a camera

Page 25: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Perspective projections induce projective transformations between planes

Page 26: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Weak-perspective projection

Paraperspective projection

Affine cameras

Page 27: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Orthographic projection

Parallel projection

More affine cameras

Page 28: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Weak-perspective projection model

r

(p and P are in homogeneous coordinates)

p = A P + b (neither p nor P is in hom. coordinates)

p = M P (P is in homogeneous coordinates)

Page 29: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Affine projections induce affine transformations from planes onto their images.

Page 30: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Affine transformationsAn affine transformation maps a parallelogram onto

another parallelogram

11001

'

'

22221

11211

v

u

baa

baa

v

u

Page 31: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Fitting an affine transformationAssume we know the correspondences, how do we get

the transformation?

2

1

43

21

t

t

y

x

mm

mm

y

x

i

i

i

i

i

i

ii

ii

y

x

t

t

m

m

m

m

yx

yx

2

1

4

3

2

1

1000

0100

),( ii yx ),( ii yx

Page 32: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Fitting an affine transformation

Linear system with six unknowns

Each match gives us two linearly independent equations: need at least three to solve for the transformation parameters

i

i

ii

ii

y

x

t

t

m

m

m

m

yx

yx

2

1

4

3

2

1

1000

0100

Page 33: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Beyond affine transformationsWhat is the transformation between two views of a

planar surface?

What is the transformation between images from two cameras that share the same center?

Page 34: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Perspective projections induce projective transformations between planes

Page 35: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Beyond affine transformationsHomography: plane projective transformation

(transformation taking a quad to another arbitrary quad)

Page 36: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Fitting a homographyRecall: homogenenous coordinates

Converting to homogenenousimage coordinates

Converting from homogenenousimage coordinates

Page 37: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Fitting a homographyRecall: homogenenous coordinates

Equation for homography:

Converting to homogenenousimage coordinates

Converting from homogenenousimage coordinates

11 333231

232221

131211

y

x

hhh

hhh

hhh

y

x

Page 38: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Fitting a homographyEquation for homography:

iT

T

T

ii x

h

h

h

xHx

3

2

1

11 333231

232221

131211

i

i

i

i

y

x

hhh

hhh

hhh

y

x

0 ii xHx

iT

iiT

i

iT

iiT

iT

iT

i

ii

yx

x

y

xhxh

xhxh

xhxh

xHx

12

31

23

0

0

0

0

3

2

1

h

h

h

xx

xx

xx

TTii

Tii

Tii

TTi

Tii

Ti

T

xy

x

y

3 equations, only 2 linearly independent

9 entries, 8 degrees of freedom(scale is arbitrary)

Page 39: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Direct linear transform

H has 8 degrees of freedom (9 parameters, but scale is arbitrary)

One match gives us two linearly independent equationsFour matches needed for a minimal solution (null space

of 8x9 matrix)More than four: homogeneous least squares

0

0

0

0

0

3

2

1111

111

h

h

h

xx

xx

xx

xx

Tnn

TTn

Tnn

Tn

T

TTT

TTT

x

y

x

y

0hA

Page 40: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire

Application: Panorama stitching

Images courtesy of A. Zisserman.

Page 41: Reconnaissance d’objets et vision artificielle Jean Ponce (ponce@di.ens.fr) ponce Equipe-projet WILLOW ENS/INRIA/CNRS UMR 8548 Laboratoire