The Art, Science and Algorithms Rays of Scene to pixels of - - PDF document

the art science and algorithms
SMART_READER_LITE
LIVE PREVIEW

The Art, Science and Algorithms Rays of Scene to pixels of - - PDF document

General topic for next couple of weeks Cameras : Pinhole Camera and Optics The Art, Science and Algorithms Rays of Scene to pixels of Photography Camera without optics Lens in the camera system Lenses & Depth of Field (DOF)


slide-1
SLIDE 1

The Art, Science and Algorithms

  • f Photography

Lenses & Depth of Field (DOF) Optics I CSCI 4900/6900 Maria Hybinette

1

  • General topic for next couple of weeks
  • Cameras: Pinhole Camera and Optics

– Rays of Scene to pixels – Camera without optics – Lens in the camera system – The Lens Equation

2

Cameras captures Rays of Light à Get it ta a sensor { Film or Digital} and that creates a photograph

Camera & Rays of Light

  • Recall: Context of Computational

Photography

3

Slide: Irfan Essa

  • How we capture a 3D

scene into 2D array of pixels

  • Rays are fundamental

primitives

  • Illumination (Light Rays)

follows a path from the source to the scene

– Geometry to extract information of the scene

  • Computation can

control the parameters

  • f the optics, sensor and

illumination

  • Rays to Pixels

History-Science-Art of the Camera

  • Mathematicians, scientists (or artists

deeply scientifically motivated) have been the key pushers of the advancement of the camera

  • Idea has been around about the 4th, 5th

and 6th Century B.C. (‘aperture’)

– Chines philosopher Mo-Ti “the collecting plate”, “locked treasure room”; – Aristotle & Euclid’s ‘Optica’ talked about a pinhole camera, or the camera obscura) – Byzantine mathematician Anthemius of Tralles used a type of camera obscura in his

  • experiments. 6th

4 Maria Hybinette

h@p://en.wikipedia.org/wiki/History_of_photography h@p://www.moGobscura.com/moG_about.html

Camera = Vaulted room Obscura = Dark Camera Obscura = Darkroom

Camera Obscura (pinhole camera)

Maria Hybinette 5

  • Abu Ali al-Haytham, mathematician

(around 1000 AD)

v Lights streams of particles travel in

straight lines

  • Johannes Kepler (“Astronomiae Pars

Optica” (1604))

v Corrected theory on how camera

  • bscura operated

v Inverse square laws of light v Astronomical laws v Human optics v Later “Dioptrice“1611- telescope

h@p://en.wikipedia.org/wiki/Johannes_Kepler

Maria Hybinette 6

h@p://arts.jrank.org/pages/9526/Camera-obscura.html

slide-2
SLIDE 2

Other (Drawing) Mechanisms

Maria Hybinette 7

Silhoue@e Machine, 1780 h@p://en.wikipedia.org/wiki/PerspecGve_(graphical) h@p://www.acmi.net.au/AIC/DRAWING_MACHINES.html AlberG’s “ArGst’s Glass” 1450 Law of 1 pt PerspecGve GilberG, Brunelleschi 1413-1425 AlberG’s “Grid” or “Veil” 1450 Dürer's Perspectograph 1525-1538 Camera Lucida William Hyde Wollaston 1807 (Kepler Inspired)

Camera = Vaulted room Lucida= Lighted, Lit, Shining Camera Lucida= Lighted room

Camera as Art

  • More recently: Tim’s Vermeer
  • https://en.wikipedia.org/wiki/Tim

%27s_Vermeer

8

Evolution of the Camera

  • Today

9

1839 1907 1948 BC Formal to Casual

  • Behind the Camera

Evolution

Slide Adapted from Irfan Essa

Single-Lens Reflex Camera

  • Mirrors that direct light

from the lens to the viewfinder :

– view through the lens and see exactly what will be captured “before taking picture

  • Single Lens vs Non Single

Lens

– View finder with its own lens.

  • Reflex: Mirror Reflect

the a portion of the light to the viewfinder

10

Figure: h@p://electronics.howstuffworks.com/ camera5.htm

Capturing Rays: Objective and Tools

Slide: Irfan Essa

11

Geometry (Perspective) Light Scattering

When you take a picture

3D Scene

Illumination Optics Processing Display

User

Sensor

Try to capture Using:

Optics / Lens Sensor / Color Filter

  • Objective: Light source – we want to capture reflection

from the scene that is illuminated by the source (sun)

  • Scenes must be illuminated must have a lightsource

12

slide-3
SLIDE 3

Add a Sensor

  • Add a Sensor Film or Sensor
  • Do we get a reasonable image.

13

  • Add a barrier

14

  • Image

15

Sensor

Camera Obscura

  • Rays of light come straight from each

point of an object

16

Camera = Vaulted room

  • Theoretically,
  • No distortion:

Straight Lines remain straight

  • Infinite depth of

field: Everything in focus (but there is optical lurring) DOF

17

Byelorussky Station: commons.wikimedia.org

Why not use Sensors without Optics?

  • 1 Pinhole: Rays of

light come straight from each point of an

  • bject

– no distortion. – straight lines are still straight – infinite DOF

  • Larger Pinhole

– Fuzzy image, due to geometric blur

18

h@p://www.pracGcalphysics.org/go/Guidance_93.html

slide-4
SLIDE 4

Larger Pinhole

19

  • Geometric Blur : Aperture

Smaller Pinhole

  • Diffraction limit, smaller

apertures means more diffraction

  • Small hole does not create a

bright dot but a diffused circular disk, called an Airy’s disc, surrounded by concentric circular rings

20 h@p://www.huecandela.com/hue-x/pin-pdf/Prober-%20Wellman.pdf

h@p://hyperphysics.phy-astr.gsu.edu/hbase/phyopt/cirapp2.html

Pinhole Size Summary

  • Large pinhole gives

geometric blur (2mm)

  • Optimal pinhole gives

little light (0.35mm)

– Maximum sharpness, aperture is proportional to its distance from the image plane.

  • Small pinhole gives

diffraction blur (0.07mm)

21

Hecht & Ganesan “OpGcs 4th ed.” p205

  • Large Pinhole =

Geometric Blur

  • Small Pinhole =

Diffraction Blur

  • Best Pinhole =

Very Little Light

22

  • For d (pinhole

diameter), f (distance from pinhole to sensor), and

  • π (wavelength of light):

23

d = 2 r 1 2fπ

π

f

Replacing pinhole with a lens

24

slide-5
SLIDE 5

Replacing pinhole with a lens

  • 1 Pinhole: Rays of light come

straight from each point of an

  • bject

– no distortion, – straight lines are still straight – infinite DOF

  • Larger Pinhole fuzziness

25

  • Lens: Need to collect rays emanating from a ‘near’ point in the scene

through ‘different pinholes’, so that they so converge at a point at the sensor.

Geometrical Optics

  • Parallel rays converge to a point located at focal

length f from the lens, its principal focal point

  • ‘Center’ rays going though center of lens are

not deviated – so points are shown at the same perspective

26 flange

f in camera

Gauss’s ray tracing construction

  • Rays coming from points on a plane parallel to

the lens are focused on another plane parallel to the lens

27

Marc Levoy 2010 Principal Focal Point

Same Lens: Changing Focus Distance

  • Focus distance (from

camera to the object in scene).

– To focus on objects at different focus distances, move the sensor relative to the lens.

28

f f

Scene Inside Camera

  • Focused at infinite à Parallel rays --

Converges at the principal focus point

  • As subject gets closer:
  • distances decreases to object,
  • distance increases to image
  • Further away from the prin. fp.*

Deriving the Lens Formula

  • Rays from points on a plane parallel to the lens,

focuses on a plane parallel to the lens on the other side (and upside down).

  • Lens Equation: Relates distances: to object, to

image and focal length

  • Step 1: Flip d0 to other side so we can relate it to

the other parameters à create blue triangle…

29

Deriving Lens Formula

  • Flip d0 to other side so we can relate it to

the other parameters à blue triangle

  • Relate lines d0, d1 to sides A, B by looking

at resulting green triangles derived from blue triangles (verify they are similar).

30

slide-6
SLIDE 6

Deriving Lens Formula

  • Flip d0 to other side so we can relate it to the other

parameters à blue triangle

  • Relate lines d0, d1 to sides A, B by looking at

resulting green triangles derived from blue triangles (verify they are similar).

  • NOW Relate principal focal length f to A/B by

finding new similar triangles à red/pink triangles

31

Deriving Lens Formula

  • Flip d0 to other side so we can relate it to the other

parameters à blue triangle

  • Relate lines d0, d1 to sides A, B by looking at

resulting green triangles derived from blue triangles (verify they are similar).

  • Relate principal focal length f to A/B by finding

new similar triangles à red/pink triangles

32

Deriving Lens Formula

  • Flip d0 to other side so we can relate it to the other

parameters à blue triangle

  • Relate lines d0, d1 to sides A, B by looking at

resulting green triangles derived from blue triangles (verify they are similar).

  • Relate principal focal length f to A/B by finding

new similar triangles à red/pink triangles

33

Deriving Lens Formula: f, d0, d1

  • Flip d0 to other side so we can relate it to the other parameters à

blue triangle

  • Relate lines d0, d1 to sides A, B by looking at resulting green

triangles derived from blue triangles (verify they are similar).

  • Relate principal focal length f to A/B by finding new similar

triangles à red/pink triangles : Algebra to get to yellow and determine scaling.

34

Deriving Lens Formula: Heights

  • Use same pink triangles and A/B

to relate the heights of object and the image (scaling factor)

35

Points of Interest: 2F Focal Distance

  • When the object is at 2F the image is of the

same size as object size.

36

slide-7
SLIDE 7

Other Points of Interests

Case 1: Object at infinity à No image

All ray parallel and converges at principal focal point, no image.

Case 2: Object beyond 2f.

Reduced image, inverted

Case 3: Object at 2f

Same size as object, inverted

Case 4: Object between 2f and f

Magnified

Case 5: Object at f.

Ray refracts in parallel, No Image

Case 6: Object within f Virtual Image (not on sensor) Magnifying glass

37

h@p://boomeria.org/physicstextbook/ch14.html

Not Focusing

38 h@p://www.bhphotovideo.com/explora/photography/Gps-and-soluGons/how-focus-works

Depth of field: DOF

39

  • Range of distance of subject that is

sharp

– Shallow / deep – Short / long – Small / large

  • Control parameters:

– Focal length* – Camera to subject distance – Aperture (f-number) larger 1/16 .. Smaller more similar to pinhole cameras – Format size (circle of confusion)” h@p://en.wikipedia.org/wiki/Depth_of_field

Depth of Field: Circle of Confusion

  • Focus: Point on focus plane
  • Part of image that is acceptable sharp leveraging our

perception and a lens’ imperfection

– Largest ‘circle’ that we still perceive as a point (width of a pixel) – Rays don’t focus a the same spot

  • Diffraction

40 h@ps://www.youtube.com/watch?v=Pdq65lEYFOM

h@ps://en.wikipedia.org/wiki/Circle_of_confusion

Depth of field (vs. Depth of focus*)

41

  • Range of distance of subject that is

sharp

  • Control parameters:

– Focal length (f) – Camera to subject distance (d) – Aperture (f-number) (N) – Format size (as related to circle of confusion, C)

h@p://en.wikipedia.org/wiki/Depth_of_field * SomeGmes “depth of focus” refers refers to the zone behind the lens wherein the sensor (or film) is placed to produce an in focus image ( and depth of field is in front of lens).

DOF ≈ 2NCd 2 f 2

h@p://graphics.stanford.edu/courses/cs178/applets/dof.html

Depth of Field

42

  • Control parameters:

– Focal length (f) – Camera to subject distance (s, D) – Aperture (f-number) (a, or N). – Related to the Diameter of Circle of confusion

h@p://graphics.stanford.edu/courses/cs178/applets/dof.html h@ps://en.wikipedia.org/wiki/Circle_of_confusion

DOF ≈ 2NCd 2 f 2

slide-8
SLIDE 8

Focal Length (shorter are wider)

43

  • A measure on how strongly

a lens focuses or converges light.

  • Categories (35 mm format)

– Wide, short (<35mm), stronger convergence of light (larger DOF) – Normal (35mm-65mm) – Telephoto, long (>65mm), weak (less DOF)

Measured from opGcal center of lens or system of lenses while the lens is focused to infinity Magnifies, FOV, DOF Wide – long DOF, wide fov Normal – 44, fov human eye Long – narrow FOV, short DOF

Same focus distance: Focal Length

  • Tree is in focus at the lens focal

length when it is placed ‘infinitely’ away.

  • Weaker lenses (lower optical

power) have longer focal lengths (assuming the lens is built with one lens)

  • To stay in focus needs to move

sensor further back

– 200m long lenses

  • Stronger lenses – wider lenses

bends light more ‘strongly’

44

Focal length is measured in millimeters and is directly proportional to the magnification

  • f the images.

h@p://en.wikipedia.org/wiki/Focal_length

Same focus distance: Focal Length

  • Weaker lenses (lower
  • ptical power) have

longer focal lengths (assuming the lens is built with one lens)

  • To stay in focus needs

to move sensor further back

  • If sensor size is

constant, the field of view becomes smaller

45

FOV = 2 arctan( h / 2 f ) h@p://en.wikipedia.org/wiki/Focal_length Smaller FOV = larger Focal Length

Auto-Focus

46

Focal Length & DOF

  • Same subject/camera distance and same setting.
  • Wide Angle – decreases size, long DOF
  • Telephone – magnified, narrow, short DOF

47

Focal Length and FOV

  • Wide Angle – decreases size, long DOF
  • Telephone – magnified, narrow, short DOF

48

slide-9
SLIDE 9

Focal Length & Field of View

FOV is measured diagonally on a 35mm full frame camera (24 x 36mm)

49

Lee Frost, 2003, “Photography”

500mm 1000mm

From Zisserman & Hartley

Focal Length Impact Perspective Field of View / Focal Length

Large FOV, small f Camera close to car Small FOV, large f Camera far from the car

Subject to Camera Distance & DOF

  • Larger distance the longer DOF
  • Smaller, shorter DOF
  • Where the focus occurs with relation to the

hyper focal distance

52

Focal Length & Subject Distance

  • In general, increasing the focal length while

maintaining the same (image) magnification of the subject by moving away from the subject.

– Maintains a similar depth of field (not a significant change)

53

h@p://www.cambridgeincolour.com/tutorials/depth-of-field.htm h@p://www.normankoren.com/Tutorials/MTF6.html

Hyperfocal Distance

54

slide-10
SLIDE 10

Hyperfocal Distance

  • Point of focus everything from that distance

(a set distance) to infinity is in focus

– Aperture size (f-stop) – Focal Length of lens

55

Summary: Hyper Focal Distance

  • Largest possible DOF for a given f-number

– Half the hyperfocal distance to infinite and and beyond!

56

Changing focal length versus changing the view point

  • Moving back while changing focal length lets you keep
  • bjects at one depth the same size
  • In cinematography, this is called the dolly zoom, or

“vertigo effect”, after Alfred Hitchock’s movie

  • http://www.kevinwilley.com/GIF

57

h@p://www.youtube.com/watch?v=iv41W6iyyGs

Focal length on portraits

  • Standard portrait lens (85 mm)

58

Wide Angle Normal Telephoto

Changing focal length versus changing the view point

  • Changing the focal length let us move back from the

subject, while maintaining the size of the image

  • But moving back changes perspective relationships

59

Wide angle, story telling

Summary

  • Pinhole cameras compute correct linear

perspective

– But too dark – Diffraction limited

  • Lenses gather more light

– But only one plane of scene in focus – Focus by moving the sensor or lens

  • Focal length determines field of view

– From wide angle to telephoto – Depends on sensor size (shortly)

60

slide-11
SLIDE 11

Changing the sensor size

  • If the sensor is

smaller, the field of view is smaller too

  • Smaller sensors

either have fewer pixels, or noisier pixels (closer to together)

61

h@p://www.cambridgeincolour.com/tutorials/digital-camera-sensor-size.htm

Slide Credits/Resources

  • Prof. Fredo Durand & Prof. Marc Levoy
  • Videos: http://snodart.com/tutorials.php
  • Depth of field, Focal Length:

– http://en.wikipedia.org/wiki/Depth_of_field – http://www.cambridgeincolour.com/tutorials/depth-of-field.htm – http://en.wikipedia.org/wiki/Focal_length – http://www.kevinwilley.com/l3_topic02.htm

  • London, Stone, Upton “Photography” Book
  • Applets (next week):

– http://www-graphics.stanford.edu/courses/cs178-10/applets/#lens – http://www-graphics.stanford.edu/courses/cs178-10/applets/zoom.html

  • Various:

– http://www.stsite.com/camera/cam02.php – http://super.nova.org/DPR/LensPortrait/ – http://super.nova.org/DPR/ – http://www.cambridgeincolour.com/tutorials/camera-lenses.htm

62