1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski CORNEA AQUEOUS HUMOR.

51
1 CS 223-B CS 223-B Lecture 1 Lecture 1 Sebastian Thrun Gary Bradski http://robots.stanford.edu/cs223b/ index.html CORNEA AQUEOUS HUMOR
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    215
  • download

    1

Transcript of 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski CORNEA AQUEOUS HUMOR.

Page 1: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

1

CS 223-BCS 223-BLecture 1Lecture 1

Sebastian Thrun

Gary Bradski

http://robots.stanford.edu/cs223b/index.html

CORNEAAQUEOUSHUMOR

Page 2: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

2

Readings

• Computer Vision, Forsyth and Ponce– Chapter 1

• Introductory Techniques for 3D Computer Vision, Trucco and Verri– Chapter 2

Page 3: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

3

Lenses and Cameras*

* Slides, where possible, stolen with abandon, many this lecture from Marc Pollefeys comp256, Lect 2

-- Brunelleschi, XVth Century

Page 4: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

4

Distant objects appear smaller

A “similar triangle’s” approach to vision. Notes 1.1

Marc Pollefeys

Page 5: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

5

Consequences: Parallel lines meet

• There exist vanishing points

Marc Pollefeys

Page 6: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

6

Vanishing points

VPL VPRH

VP1VP2

VP3

Different directions correspond to different vanishing points

Marc Pollefeys

Page 7: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

7

Implications For Perception*

* A Cartoon Epistemology: http://cns-alumni.bu.edu/~slehar/cartoonepist/cartoonepist.html

Same size things get smaller, we hardly notice…

Parallel lines meet at a point…

Page 8: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

8

Implications For Perception 2

Perception must be mapped to a space variant grid

Logrithmic in nature

Steve Lehar

Page 9: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

9

The Effect of Perspective

Page 10: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

10

Different Projections: Affine projection models: Weak perspective projection

0

'where'

'z

fmmyy

mxx

is the magnification.

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

Smoosh everything flat onto a parallel plane at distance z0

Marc Pollefeys

Page 11: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

11

Affine projection models: Orthographic projection

yy

xx

'

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

Marc Pollefeys

Page 12: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

12

Limits for pinhole cameras

Marc Pollefeys

Page 13: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

13

On to Thin Lenses …

Snell’s law

n1 sin 1 = n2 sin 2

Notes 1.2

a b

d e

F

Page 14: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

14

Paraxial (or first-order) optics

Snell’s law:

n1 sin 1 = n2 sin 2

Small angles:

n1 1 n22R

nn

d

n

d

n 12

2

2

1

1

R γβα

111

h

d

h

222 R

βγαd

hh

22

11 RR d

hhn

h

d

hn

Sin = y/rTan = y/x Marc Pollefeys

Page 15: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

15

Thin Lenses

)1(2 and

11

'

1

n

Rf

fzz

R

n

Z

n

Z

11*

R

n

ZZ

n

1

'

1*

ZR

n

Z

n 11*

'

1111

ZZR

n

R

n

spherical lens surfaces; incoming light parallel to axis; thickness << radii; same refractive index on both sides

'

11* ZR

n

Z

n

R

nn

d

n

d

n 12

2

2

1

1

Notes 1.3 z->Marc Pollefeys

8

Page 16: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

16

Thin Lenses summary

)1(2 and

11

'

1 e wher

''

''

n

Rf

fzzz

yzy

z

xzx

http://www.phy.ntnu.edu.tw/java/Lens/lens_e.htmlMarc Pollefeys

Page 17: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

17

The depth-of-field

Marc Pollefeys

Page 18: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

18

The depth-of-field

fZo

1

Z

1

1

i

iii ZZZ

fZ

Zf

i

i

Zo

yields

d

ZZ

b

Z iii

ii Zbd

bZ

fbdfZ

fZZ ooo /

) ( Z Z Z

0oo

Similar formula for Z Z Z oo o

)( / Z bddZ ii

fZ

ZfZ

o

oi

)(

Z

0o bdfZb

Zdf o

Marc Pollefeys

Page 19: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

19

The depth-of-field

fbdfZ

fZZZZZ

/

)(

0

00000

decreases with d, increases with Z0

strike a balance between incoming light and sharp depth range. Notes 1.4

Marc Pollefeys

Page 20: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

20

Deviations from the lens model

3 assumptions :

1. all rays from a point are focused onto 1 image point• Remember thin lens small angle assumption

2. all image points in a single plane

3. magnification is constant

Deviations from this ideal are aberrations

0

'

z

fm

Marc Pollefeys

Page 21: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

21

Aberrations

chromatic : refractive index function of wavelength

2 types :

1. geometrical

2. chromatic

geometrical : small for paraxial rays

study through 3rd order optics

Marc Pollefeys

Page 22: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

22

Geometrical aberrations

spherical aberration

astigmatism

distortion

coma

aberrations are reduced by combining lenses

Marc Pollefeys

Page 23: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

23

Spherical aberration

rays parallel to the axis do not converge

outer portions of the lens yield smaller focal lenghts

Marc Pollefeys

Page 24: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

24

Astigmatism

Different focal length for inclined rays

Marc Pollefeys

Page 25: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

25

Distortion

magnification/focal length different for different angles of inclination

Can be corrected! (if parameters are know)

pincushion(tele-photo)

barrel(wide-angle)

Marc Pollefeys

Page 26: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

26

Coma

point off the axis depicted as comet shaped blob

Marc Pollefeys

Page 27: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

27

Chromatic aberration

rays of different wavelengths focused in different planes

cannot be removed completely

sometimes achromatization is achieved formore than 2 wavelengths

Marc Pollefeys

Page 28: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

28

Vignetting

Marc Pollefeys

Page 29: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

29

Calibration Gist: Invert the image formation process

kth collection of points i

Pik

pik

Image plane

x

y

z

0

Cam

era

Rk,Tk

Extrinsic ParamsRotation &Translationto image framecoord. system

f, c, , kIntrinsic Paramsfocuscenter of imageSkew = 0k radial and tangential distortion

(the camera will get several (K) viewsof this grid in rotation)External

coordinatesystem X

Y

Z operator projection theis where),,,,,,( kcfTRPp kkii kk

Note that rotation matrix R has constraints: determinant is 1, inverseis equal to transpose, optimization routine should make use of this.

Then we want the actual projection to be as close as possible toThe point given by the projection operator: over all i pointsand over all k images of grids: kk ii pp

2Argmin],,,,,[

k iiikk kkppkcfTR

• This is typically solved through a gradient decent optimization since the problem is manifestly convex.

• Note that we need a good starting guess for the initial “correct” projection points p’I the optimization then iterates to solution.

• Stereo would then just double the parameters adding left l and right r subscripts and additional summations over r & l.

Page 30: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

32

Assumed Perspective Projection

Page 31: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

33

Assumed Perspective Projection

Page 32: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

34

Cameras

we consider 2 types :

1. CCD

2. CMOS

Marc Pollefeys

Page 33: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

35

CCD

separate photo sensor at regular positionsno scanning

charge-coupled devices (CCDs)

area CCDs and linear CCDs2 area architectures : interline transfer and frame transfer

photosensitive

storage

Marc Pollefeys

Page 34: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

36

The CCD camera

Marc Pollefeys

Page 35: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

37

CMOSSame sensor elements as CCD

Each photo sensor has its own amplifierMore noise (reduced by subtracting ‘black’ image)

Lower sensitivity (lower fill rate)

Uses standard CMOS technologyAllows to put other components on chip

‘Smart’ pixels

Foveon4k x 4k sensor0.18 process70M transistors

Marc Pollefeys

Page 36: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

38

CCD vs. CMOS

• Mature technology• Specific technology• High production cost• High power consumption• Higher fill rate• Blooming• Sequential readout

• Recent technology• Standard IC technology• Cheap• Low power• Less sensitive• Per pixel amplification• Random pixel access• Smart pixels• On chip integration

with other components

Marc Pollefeys

Page 37: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

39

Colour cameras

We consider 3 concepts:

1. Prism (with 3 sensors)

2. Filter mosaic

3. Filter wheel

… and X3

Marc Pollefeys

Page 38: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

40

Prism colour camera

Separate light in 3 beams using dichroic prism

Requires 3 sensors & precise alignment

Good color separation

Marc Pollefeys

Page 39: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

41

Prism colour camera

Marc Pollefeys

Page 40: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

42

Filter mosaic

Coat filter directly on sensor

Demosaicing (obtain full colour & full resolution image)

Marc Pollefeys

Page 41: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

43

Filter wheel

Rotate multiple filters in front of lens

Allows more than 3 colour bands

Only suitable for static scenes

Marc Pollefeys

Page 42: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

44

Prism vs. mosaic vs. wheel

Wheel

1

Good

Average

Low

Motion

3 or more

approach

# sensors

Separation

Cost

Frame rate

Artifacts

Bands

Prism

3

High

High

High

Low

3

High-end

cameras

Mosaic

1

Average

Low

High

Aliasing

3

Low-end

cameras

Scientific applications

Marc Pollefeys

Page 43: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

45

new color CMOS sensorFoveon’s X3

better image qualitysmarter pixels

Marc Pollefeys

Page 44: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

46

The Human Eye

Looking down the optical axis of the eye

Reproduced by permission, the American Society of Photogrammetry andRemote Sensing. A.L. Nowicki, “Stereoscopy.” Manual of Photogrammetry,Thompson, Radlinski, and Speert (eds.), third edition, 1966.

Cross section of the eye

Page 45: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

47

Sensors and image processingRGB + B/W happens here

Question: Which way does the light enter?

Light Light

Page 46: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

48

Eye cross section

Page 47: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

49

The distribution of rods and cones across the retina

Reprinted from Foundations of Vision, by B. Wandell, Sinauer Associates, Inc., (1995). 1995 Sinauer Associates, Inc.

Cones in the fovea

Rods and cones in the periphery

Reprinted from Foundations of Vision, by B. Wandell, Sinauer Associates, Inc., (1995). 1995 Sinauer Associates, Inc.

Page 48: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

50

There’s a lot more going on in Vision …i.e. Light and Surfaces

Page 49: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

51

Real vision includes invisible inference

Page 50: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

52

Real vision includes invisible inference

Page 51: 1 CS 223-B Lecture 1 Sebastian Thrun Gary Bradski  CORNEA AQUEOUS HUMOR.

53

Real vision includes invisible inference