1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 [email protected].

31
1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 [email protected]

Transcript of 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 [email protected].

Page 1: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

1

Formation et Analyse d’Images

Daniela Hall

19 Septembre 2005

[email protected]

Page 2: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

2

Course material

• course slides (.pdf)– http://www-prima.inrialpes.fr/perso/Hall/Courses/FAI0

5/• References on the slides• last years documents

– http://www-www-prima.inrialpes.fr/perso/Hall/Courses/FAI04/

• CVonline:– http://homepages.inf.ed.ac.uk/rbf/CVonline/

• Contact: email [email protected]

Page 3: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

3

Course Overview

• Session 1: – Overview– Human vision – Homogenous coordinates– Camera models

• Session 2:– Tensor notation– Image transformations

• Session 3:– Reflection models– Color spaces

• Session 4:– Pixel based image analysis

• Session 5:– Gaussian filter operators– Scale Space

Page 4: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

4

Course overview

• Session 6:– Contrast description– Hough transform

• Session 7:– Kalman filter

• Session 8:– Tracking of regions, pixels, and lines

• Session 9:– Stereo vision

• Session 10:– Epipolar geometry

• Session 11: exercises and questions

Page 5: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

5

Session Overview

1. Course overview2. Image formation in the eye and the camera

1. The eye2. The retina3. Capacities of the eye

3. Homogenous coordinates4. Camera models

1. Pinhole camera2. Perspective projection3. Mathematical formulation

Page 6: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

6

Image formation in the eye

• Biological vision: process of using light reflected from surrounding world for modifying behaviour.

• Humans require conscious understanding of the 3d world from 2d projections on the retina.

• Surrounding environment is interpreted by visual input.

Ref: CVonline/LOCAL_COPIES/OWENS/LECT1/

Page 7: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

7

The eye

aqueous humor

Page 8: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

8

The eye

• Light enters the eye through the transparent cornea, passes through the aqueous humor, the lens and the vitreous humor, where it forms the image on the retina.

• Accomodation: muscular adjustment of the lens that focuses the image directly on the retina.

Page 9: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

9

The retina

• Complex tiling of photoreceptors (rods and cones).

• Photoreceptors stimulated by light transmit electrical signals to the brain via the optic nerve.

• Location of the optic nerve on the retina has no photoreceptors. No light is perceived within this region (blind spot).

Page 10: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

10

The retina

• Rods and cones communicate through several layers of cells to the ganglion cells

• Synapses: junctions between layers

• Rods and cones are situated at the back of the retina.

• Light passes through the different layers and the signal is transmitted back via synaptic junctions to the optic nerve.

Page 11: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

11

The retina

• Ganglion cell responds to the photostimulus according to a receptive field.

• The spatial organization of the receptive field on the retinal ganglion cell is circular symmetric (either excitatory center and inhibitory suround or inverse). Such cells are known as mexican hat operators

• Other spatial organization are – simple cells (orientation sensitive receptive fields),– complex cells (non-linear combination of even and odd responses)

and – end-stopped cells (simple differentiation operators).

Page 12: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

12

Capacities of the eye

• Sensitivity and performance approach the limits set by quantum physics.

• Eye can detect a single photon• Eye adapts to ranges in light of many orders of magnitude• No camera can even partially match this performance• Inputs from left and right are processed in the optic

chiasma.• The slight difference of viewpoint of the eyes is used to

deduce depth. • Nerve fibers lead from the optic chiasma to the striate

cortex (the seat of visual processing in the brain).

Page 13: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

13

Session Overview

1. Course overview2. Image formation in the eye and the camera

1. The eye2. The retina3. Capacities of the eye

3. Camera models1. Pinhole camera2. Homogenous coordinates3. Perspective projection4. Mathematical formulation

Page 14: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

14

Camera model

• Physical geometry

The pinhole camera is the simplest. It has a infinitesimally smallhole through which light enters and forming an inverted image on the camera surface (retina). To simplify things, we model a pinhole camera by placing the retina between the camera center and the object (projective model)

Page 15: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

15

Camera model

• Projective model

Ti

Trr

r

Tccc

c

Tsss

s

jiP

yxP

zyxP

zyxP

)1,,(

)1,,(

)1,,,(

)1,,,(

Scene coordinates

Camera coordinates

Image coordinates

Page 16: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

16

Change of coordinate systems

• Transformation from scene to camera coordinates

• Projection of camera coordinates to retina coordinates

• Transformation from retina coordinates to image coordinates

• Composition

• This mapping from 3 dimensions to 2 is called perspective projection

sis

scs

rc

ir

i

rir

i

crc

r

scs

c

PMPTMCP

wPCP

PMP

PTP

Page 17: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

17

Camera parameters

• 4 intrinsic parameters:– 2 for the origin of the image coordinate frame– 2 for the scale of the axes– Focal length F

• 6 extrinsic parameters:– 3 for the 3D position of the center of projection– 3 for the orientation of the image plane

Page 18: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

18

Intrinsic camera parameters

• F: focal distance

• Ci , Cj : Optical image center (in pixels)

• Di , Dj : Physical size of the pixel on the retina (in pixel/mm)

• i, j : image coordinates (in pixels)• Transformation Retina-Image

jjr

iir

CDyj

CDxi

1100

0

0

1r

r

jj

ii

y

x

CD

CD

j

i

Page 19: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

19

Homogenous coordinates

• Allow to manipulate n-dim vectors in a n+1-dim space

• A point p can be written as vector • In homogenous coordinates we add a scaling factor

• To transform the homogenous coordinates in normal coordinate, divide by the n+1 coordinate w.

y

xp

1

y

x

w

wy

wx

ph

Page 20: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

20

Homogenous coordinates

• we note

• Proof:

11

:, y

x

by

x

aba

1/

/

/

1

y

x

aa

aay

aax

a

ay

ax

y

x

a

Page 21: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

21

Translation

• Classic • Homogenous coordinates

y

x

tyy

txx

12

12

1

1

1

100

10

01

1

2

2

y

x

ty

tx

y

x

Page 22: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

22

Scaling

• Classic • Homogenous coordinates

12

12

ryy

sxx

1

1

1

100

00

00

1

2

2

y

x

r

s

y

x

x

y

ppl

5.7

6

55.1

32,

5

3 lpp

Page 23: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

23

Rotation (clockwise)

• Classic • Homogenous coordinates

1)cos(1)sin(

1)sin(1)cos(

2

2

yaxay

yaxax

1

1

1

100

0)cos()sin(

0)sin()cos(

1

2

2

y

x

aa

aa

y

x

x

y

p

pl

5

7.8

087.0105.0

05.01087.0,

0

1030lpp

Page 24: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

24

Translation and rotation

• Classic • Homogenous coordinates

tyyaxay

txyaxax

1)cos(1)sin(

1)sin(1)cos(

2

2

1

1

1

100

)cos()sin(

)sin()cos(

1

2

2

y

x

tyaa

txaa

y

x

Page 25: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

25

Translation, rotation and scaling

• Classic • Homogenous coordinates

tyyarxasy

txyarxasx

1)cos(1)sin(

1)sin(1)cos(

2

2

1

1

1

100

)cos()sin(

)sin()cos(

1

2

2

y

x

tyaras

txaras

y

x

Page 26: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

26

3d rotation

• Around x-axis (counter-clockwise)

• Around y-axis

• Around z-axis

• General )()()(,

1000

1000

0100

00)cos()sin(

00)sin()cos(

)(

1000

0)cos(0)sin(

0010

0)sin(0)cos(

)(

1000

0)cos()sin(0

0)sin()cos(0

0001

)(

aRbRcRRtz

ty

tx

RT

cc

cc

cR

bb

bb

bR

aa

aaaR

xyz

z

y

x

Page 27: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

27

Transformation Scene - Camera

• (xs,ys,zs) is position of the origin of the camera system with respect to the scene coordinates (translation).

• R is the orientation of the camera system with respect to the scene system (3d rotation).

1000s

s

scsc

sz

y

x

RT

Page 28: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

28

Transformation Camera-Retina

• Imagine a 1D camera in a 2D space.

• The transformation MRc can be found by considering

similar triangles

z(xc ,zc )

F

x

xr

O

)()(

)()(

c

cr

c

cr

c

cr

c

cr

zF

Fyy

zF

y

F

y

zF

Fxx

zF

x

F

x

Page 29: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

29

Transformation Camera-Retina

1

0

0

/1

0

0

0

1

0

0

0

1

1

,

F

M

z

y

x

M

w

wy

wx

PMP

RC

c

c

c

RCr

rRR

CR

Page 30: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

30

Transformation Retina-Image• A frame: the image is composed of pixels (picture

elements)

• Pixels are in general not squared. There physical sizes depends on the used material.

i columns

j rows

(0,0)

(i-1,j-1)

Page 31: 1 Formation et Analyse d’Images Daniela Hall 19 Septembre 2005 Daniela.Hall@inrialpes.fr.

31

Exercise

• Soit une camera avec un axe optique a la position (Ci,Cj) [pixels] et une taille de pixel de Di [mm/ligne], Dj [mm/colonne]. L'horloge du numerisateur est mal regle: chaque ligne d l'image est decalee vers la droite par k pixels par ligne.

• Ecrivez la matrice de projection, Cir de l'image

vers la retine en coordonees homogenes.