Beruflich Dokumente
Kultur Dokumente
Marc Levoy
Computer Science Department Stanford University
Outline
! !
thick lenses
! ! ! ! !
2
depth of eld aberrations & distortion vignetting, glare, and other lens artifacts diffraction and lens quality special lenses
telephoto, zoom
! Marc Levoy
! Marc Levoy
!
5
Why is it so complicated?
(Canon)
! Marc Levoy
! Marc Levoy
(Hecht)
! ! ! !
light can be modeled as traveling waves the perpendiculars to these waves can be drawn as rays diffraction causes these rays to bend, e.g. at a slit geometrical optics assumes
!!0 no diffraction in free space, rays are straight (a.k.a. rectilinear propagation)
! Marc Levoy
in geometrical optics, we assume that rays do not bend as they pass through a narrow slit this assumption is valid if the slit is much larger than the wavelength physical optics is a.k.a. wave optics
! Marc Levoy
! !
(Hecht)
xi xt
sin ! i sin ! t
nt ni
!
10
(Hecht)
when transiting from air to glass, light bends towards the normal when transiting from glass to air, light bends away from the normal light striking a surface perpendicularly does not bend
! Marc Levoy
!
12
(Hecht)
A. a hyperbola
!
13
Spherical lenses
hyperbolic lens
(Hecht)
spherical lens
(wikipedia)
two roughly tting curved surfaces ground together will eventually become spherical spheres dont bring parallel rays to a point
this is called spherical aberration nearly axial rays (paraxial rays) behave best
! Marc Levoy
14
(gtmerideth)
(Canon)
15
! Marc Levoy
Paraxial approximation
object
P
image
e
P'
assume e ! 0
Not responsible on exams for orange-tinted slides
16
! Marc Levoy
Paraxial approximation
object
u
P
l
image
h
e
z
! ! ! !
P'
assume e ! 0 assume sin u = h / l ! u (for u in radians) assume cos u ! z / l ! 1 assume tan u ! sin u ! u
! Marc Levoy
17
!3 !5 !7 + ... assume rst term of sin ! = ! " + " 3! 5! 7! i.e. sin " " " !2 !4 !6 " + ... assume rst term of cos ! = 1 " + 2! 4! 6! i.e. cos " " 1 so tan " " sin " " "
these are the Taylor series for sin " and cos "
(phi in degrees)
18 ! Marc Levoy
Paraxial focusing
object
P i i'
image
P'
(n)
(n ')
equivalent to
sin ! i nt = sin ! t ni
Snells law:
n sin i = n ' sin i '
with
n = ni for air n ' = nt for glass i, i ' in radians ! i , ! t in degrees
! Marc Levoy
paraxial approximation:
n i ! n' i'
19
Paraxial focusing
i = u+a u ! h/z u' ! h / z'
u
P i
h
i'
(n)
z
(n ')
n i ! n' i'
20 ! Marc Levoy
Paraxial focusing
i = u+a u ! h/z u' ! h / z'
u
P i
h
i'
(n)
z
(n ')
n i ! n' i'
!
21
Focal length
r
P
(n)
z
(n ')
z'
P'
n / z + n / r ! n' / r " n' / z' n / r ! n' / r " n' / z' z ' ! (r n ') / (n ' " n)
!
22
f focal length = z
! Marc Levoy
Lensmakers formula
!
using similar derivations, one can extend these results to two spherical interfaces forming a lens in air
so
si
(Hecht, edited)
23
and recalling that as object distance so is moved to innity, image distance si becomes focal length fi , we get
1 fi " 1 1% = (nl ! 1) $ ! '. R2 & # R1
(Hecht, eqn 5.16)
24
! Marc Levoy
yo yi
so
! !
25
si
yo yi
so
yi si = yo so
y
26
si
! Marc Levoy
yo yi
so
yi si = yo so
y
27
si
yi si ! f = yo f
and
.....
1 1 1 + = so si f
! Marc Levoy
sensor
(Flash demo)
http://graphics.stanford.edu/courses/ cs178/applets/gaussian.html 28
1 1 1 + = so si f
! Marc Levoy
to focus on objects at different distances, move sensor relative to lens at so = si = 2 f we have 1:1 imaging, because
1 1 1 + = 2f 2f f
sensor
In 1:1 imaging, if the sensor is 36mm wide, an object 36mm wide will ll the frame.
29
1 1 1 + = so si f
! Marc Levoy
to focus on objects at different distances, move sensor relative to lens at so = si = 2 f we have 1:1 imaging, because
1 1 1 + = 2f 2f f
sensor
1 1 1 + = so si f
! Marc Levoy
30
positive focal length f means parallel rays from the left converge to a point on the right negative focal length f means parallel rays from the left converge to a point on the left (dashed lines above)
! Marc Levoy
31
(Pamplona)
34
! Marc Levoy
using diopters
Ptot = P1 + P2
example
1 1 1 + = 70mm 500mm 61.4mm
-or-
35
Close-up lters
1/500mm = +2 diopters
(wikipedia)
! !
36
Close-up lters
Canon 70-300mm
+
changes minimum focal length from 70mm to 61.4mm
1 1 1 + = 70mm 500mm 61.4mm
37
Magnication
object image
yo yi
so
si
MT
38
yi si ! = ! yo so
! Marc Levoy
Thick lenses
!
an optical system may contain many lenses, but can be characterized by a few numbers
(Smith)
39 ! Marc Levoy
Center of perspective
(Hecht)
in a thin lens, the chief ray traverses the lens (through its optical center) without changing direction in a thick lens, the intersections of this ray with the optical axis are called the nodal points for a lens in air, these coincide with the principal points
40
! Marc Levoy
(Flash demo)
http://graphics.stanford.edu/courses/ cs178/applets/thinlens.html
(Hecht)
lenses transform a 3D object to a 3D image; the sensor extracts a 2D slice from that image as an object moves linearly (in Z), its image moves non-proportionately (in Z) as you move a lens linearly relative to the sensor, the in-focus object plane moves non-proportionately as you refocus a camera, the image changes size !
! Marc Levoy
41
a cube in object space is transformed by a lens into a 3D frustum in image space, with the orientations shown by the arrows in computer graphics this transformation is modeled as a 4 ! 4 matrix multiplication of 3D points expressed in 4D homogenous coordinates in photography a sensor extracts a 2D slice from the 3D frustum; on this slice some objects may be sharply focused; others may be blurry
! Marc Levoy
!
42
Recap
!
the Gaussian lens formula relates focal length, object distance, and image distance
changing these settings also changes magnication these settings and sensor size determine eld of view convex lenses make real images; concave make virtual images lenses perform a 3D perspective transform of object space
43
Que s t ions?
! Marc Levoy
Depth of eld
f N= A
!
44
(London)
(Kingslake)
principal planes are the paraxial approximation of a spherical equivalent refracting surface
1 N= 2 sin ! '
! !
45
Cinematography by candlelight
! Marc Levoy
46
Cinematography by candlelight
! Marc Levoy
47
48
C depends on sensing medium, reproduction medium, viewing distance, human vision,... for print from 35mm lm, 0.02mm (on negative) is typical for high-end SLR, 6 is typical (1 pixel) larger if downsizing for web, or lens is poor ! Marc Levoy
MT
yi si ! = ! yo so
C
depth of focus
object
! !
49
image
DoF is asymmetrical around the in-focus object plane conjugate in object space is typically bigger than C
! Marc Levoy
depth of focus
object
! !
50
image
DoF is asymmetrical around the in-focus object plane conjugate in object space is typically bigger than C
! Marc Levoy
f N
depth of focus
D2
D1
object
U
image
51
NCU 2 D2 = 2 f ! NCU
! Marc Levoy
2NCU 2 f 2 = D1 + D2 = 4 f ! N 2C 2U 2
where
is F-number of lens C is circle of confusion (on image) U is distance to in-focus plane (in object space) f is focal length of lens
N
52
! Marc Levoy
DTOT
2NCU 2 ! f2
1 pixel on this video projector C = 2.5 ! 2816 / 1024 pixels DEFF = 363mm
N = f/6.3 C = 2.5 U = 17m (56) f = 27mm (equiv to 135mm) DTOT = 12.5m (41)
1 pixel on this video projector C = 2.5 ! 2816 / 1024 pixels DEFF = 34m (113)
1 pixel on this video projector C = 6.4 ! 5616 / 1024 pixels DEFF = 17.5mm
DTOT = 0.29mm!
so
si
normal
macro
57
! Marc Levoy
Extension tube: ts between camera and lens, converts a normal lens to a macro lens
!
58
toilet paper tube, black construction paper, masking tape camera hack by Katie Dektar
(CS 178, 2009)
! Marc Levoy
Canon 25mm
Canon f = 500mm
! ! !
both allow closer focusing, hence greater magnication both degrade image quality relative to a macro lens extension tubes work best with wide-angle lenses; close-up lters work best with telephoto lenses extension tubes raise F-number, reducing light need different close-up lter for each lens lter diameter
! Marc Levoy
! !
59
Canon 25mm
Canon f = 500mm
Nikon 1.4!
a teleconverter ts between the camera and lens, like an extension tube they increase f, narrowing FOV & increasing magnication, but they dont change the focusing range like extension tubes, they raise F-number, reducing light, and they are awkward to add or remove see http://www.cambridgeincolour.com/tutorials/macro-extension-tubes-closeup.htm
! Marc Levoy
!
60
DTOT
2NCU 2 ! f2
(Flash demo)
http://graphics.stanford.edu/courses/ cs178/applets/dof.html
f/2.8
61
f/32
! Marc Levoy
(Flash demo)
http://graphics.stanford.edu/courses/ cs178/applets/dof.html
(London)
62 ! Marc Levoy
Hyperfocal distance
!
NCU 2 D2 = 2 f ! NCU
!
An observant student discovered an error in my calculation of H for this photograph. I believe the values below are now correct. Ive changed the projector to an HD projector (1920 pixels wide) to make the numbers work out conveniently.
becomes innite if
f2 U ! ! H NC
!
N = f/6.3 C = 2.5 ! 2816 / 1920 pixels U = 17m (56) f = 27mm (equiv to 135mm) DTOT = 18.3m on HD projector H = 31.6m (104)
In that case, the front depth of eld becomes H (Flash demo) D1 = 2 http://graphics.stanford.edu/courses/ cs178/applets/dof.html so if I had focused at 32m, everything from 16m to innity would be in focus on a video projector, including the men at 17m
!
63
! Marc Levoy
(Flash demo)
http://graphics.stanford.edu/courses/ cs178/applets/dof.html
(London)
64 ! Marc Levoy
2NCU 2 ! f2
as sensor shrinks, lens focal length f typically shrinks to maintain a comparable eld of view as sensor shrinks, pixel size C typically shrinks to maintain a comparable number of pixels in the image thus, depth of eld DTOT increases linearly with decreasing sensor size this is why amateur cinematographers are drawn to SLRs
their chips are larger than even pro-level video camera chips so they provide unprecedented control over depth of eld
! Marc Levoy
65
In class I mentioned that the Red One professional cinematographers digital video camera (http:/ /www.red.com/) might have pixels as large as a full-frame SLR like the Canon 5D Mark II. It doesnt. The Red Ones sensor is 13.7mm x 24.4mm, while a full-frame SLRs sensor is 24mm x 36mm. Thus, the depth of field in an SLR is shallower even than the Red One. The SLR is also less expensive, by several orders of magnitude.
if we zoom in (increase f ) and stand further back (decrease U ) by the same factor
DTOT
!
2NCU 2 ! f2
(juzaphoto.com)
50mm f/4.8
67
! Marc Levoy
changing from a wide-angle lens to a telephoto lens and stepping back, you can make a foreground object appear the same size in both lenses and both lenses will have the same depth of eld on that object but the telephoto sees a smaller part of the background (which it blows up to ll the eld of view), so the background will appear blurrier ! Marc Levoy
! !
68
(wikipedia.org)
the appearance of small out-of-focus features in a photograph with shallow depth of eld
69
determined by the shape of the aperture people get religious about it but not every picture with shallow DoF has evident bokeh...
! Marc Levoy
Natasha Gelfand
71
! Marc Levoy
(Fredo Durand)
! Marc Levoy
72
for a pixel focused on the subject, some of its rays will strike the occluder, but some will pass to the side of it, if the occluder is small enough the pixel will then be a mixture of the colors of the subject and occluder thus, the occluder reduces the contrast of your image of the subject, but it doesnt actually block your view of it
! Marc Levoy
! !
73
74
(Eddy Talvala)
! Marc Levoy
Recap
!
depth of eld (DTOT) is governed by circle of confusion (C), aperture size (N), subject distance (U), and focal length ( f )
2NCU 2 DTOT ! f2 depth of eld is linear in some terms and quadratic in others if you focus at the hyperfocal distance H = f 2 / NC, everything from H / 2 to innity will be in focus depth of eld increases linearly with decreasing sensor size
useful sidelights
bokeh refers to the appearance of small out-of-focus features you can take macro photographs using a telephoto lens depth of eld blur is not the same as blurring an image
75
Que s t ions?
! Marc Levoy