Lecture 22: Cameras & Lenses III - Cs184.eecs.berkeley.edu

Transcription

Lecture 22:Cameras & Lenses IIIComputer Graphics and ImagingUC Berkeley CS184/284A, Spring 2017

Depth of Field

Depth of FieldFrom London and Upton Depth of field is the range of object depths that are renderedwith acceptable sharpness in an imageCS184/284ARen Ng

The area insubject in wConfusionforDepthRelationship Betweenthe IdealFocal of Fieldappears sharPoint and the Permissible Circle ofsharpnesstConfusion and DepthofFieldSet circle of confusion as the maximumpermissible blur spot on the image planethatsubjectwhewill appear sharp under final viewing conditionsplanefallsfilm, For printed photographs from 35mm0.025mm (on negative) is typicalpermissible For digital image sensors, 1 pixel is typical(e.g. 1.4 micron for phones)field varies Larger if intended for viewing at webaperesolution, or if lens is poor length,distance, soIdeal focal pointrough estimFrocalculateduntof defie pthldFrontdepRearDeof depthfie pthReardeptldoffocusf: focal lenPermissible circle of confusioncircle of cRen Nga: subjecconverge at a point in the focal plane.CircleofFigure-15CS184/284A[Canon, EF Lens Work III]Lens

Depth of FielddNADepth of fieldDepth of focusdSdNdSdFdFCircle of confusion, CfDSDNDOF DF2DF CS184/284Af2DS fN C(DS N N11 DFdF11 DSdS11 DNdNfdFdSdNDF CACAfDA1f1f1fDN2f)DNDS f 2f N C(DSf)Ren Ng

DOF cs178/applets/dof.htmlCS184/284ARen Ng

Hyperfocal DistanceThe focus distance that maximizes the depth of field(such that infinity is at limit of acceptable sharpness)Hyperfocal DOFHyperfocal distanceHH/2 DF f2DS f 2N C(DSf)DNDS f 2 2f N C(DSf)2fHAs DF ! 1, DS H f, DN NC2CS184/284A(Calculation omitted)Ren Ng

Ansel Adams, Mount Williamson Clearing Storm

Other Focus / DOF Situations to Consider How does sensor size affect defocus blur and DOF? E.g. consider cell phone vs 35mm format sensors For a given lens & f-stop, how does moving closer/further from the subject (and adjusting focus ontosubject) affect defocus / DOF of other objects? In 1:1 macro, does focal length affect DOF?What is the lens-sensor separation for hyperfocalcondition, for full-resolution viewing vs webresolution viewing?If you understand these, you understand lenses!CS184/284ARen Ng

Bokeh

BokehBokeh is the shape and qualityof out-of-focus blur For small, out-of-focus lights,bokeh takes on the shape ofthe lens apertureM Yashna, flickr, 40mm f/3.0CS184/284ARen Ng

Bokehdiyphotography.netHeart-shaped bokeh?CS184/284ARen Ng

BokehDino Quinzani, Leica Noctilux 50mm, f/0.95Why does the bokeh vary across the image?CS184/284ARen Ng

The Psychological Effect ofShallow Depth of Field

Dr. Joanne Liu, the president of Doctors without Borders, spoke on 10/7/15 in Geneva. Denis Balibouse/Reuters

Hillary Clinton spoke during a campaign event at Cornell College in Mount Vernon, Iowa, on 10/7/15. Scott Morgan/Reuters

https://www.youtube.com/watch?v W5cbk0xVnzA

Exposure

Exposure H TxEExposure time x irradianceExposure time (T) Controlled by shutter (discussed last lecture)Irradiance (E) Power of light falling on a unit area of sensorControlled by f-stop (aperture and focal length)CS184/284ARen Ng

Exposure Controls in PhotographyAperture size Change the f-stop by opening / closing theaperture (if camera has iris control)Shutter speed Change the duration the sensor pixels integratelightISO gain Change the amplification (analog and/or digital)between sensor values and digital image valuesCS184/284ARen Ng

Constant Exposure: F-Stop vs Shutter SpeedExample: these pairs of aperture and shutter speedgive equivalent exposureF-StopShutter1.42.02.81/500 1/250 21If the exposure is too bright/dark, may need to adjustf-stop and/or shutter up/down.CS184/284ARen Ng

Constant Exposure: Depth of Field vs Motion Blurf/41/125 sec f / 111/15 secf / 321/2 secPhotographers must trade off depth of field and motion blur for moving subjectsCS184/284ARen Ng

Shallow Depth of Field Can Create a Stronger ImageFrom Peterson, Understanding Exposure200mm, f/4, 1/1000 (left) and f/11, 1/125 (right)

Motion Blur Can Help Tell The StoryFrom Peterson, Understanding Exposure1/60, f/5.6, 180mm

Fastest Photography Lens F-Stop?Leica Noctilux-M 50mmf/0.95 ASPH LensHari Subramanyam, 284ARen Ng

ISO (Gain)Third variable for exposureFilm: trade sensitivity for grainDigital: trade sensitivity for noise Multiply signal before analog-to-digital conversionLinear effect (ISO 200 needs half the light as ISO100)More on this in a later lecture.CS184/284ARen Ng

ISO Gain vs Noise in Canon T2iCredit: bobatkins.comCS184/284ARen Ng

Real Compound Lenses

Recall: Snell’s Law of Refraction i sin i t sin tCS184/284ARen Ng

Recall: Snell’s Law of Refraction n!iMediumVacuum *1.0Air (sea level) 1.00029Water (20 C) 1.333Glass1.5-1.6Diamond2.42* index of refraction iswavelength dependent(these are averages)!t i sin i t sin tCS184/284ARen Ng

Real plano-convex lens (spherical surface shape).Lens does not converge rays to a point anywhere.CS184/284ARen Ngaberration.Figure . : Sphericalthis phried to remarkable extremes. Zoom l ithe desiprovideOne rewhereall modsome hlensestoday [tremelyquicklyveniencaberratmakingof at leaReal Refraction Through A Lens Is Not Ideal – Aberrations

Real Lenses vs Ideal Thin Lensesilovephotography.com Real optical system Multiple physical elementsin compound design Optical aberrationsprevent rays fromconverging perfectlyCS184/284A Theoretical abstraction Assume all rays refract at aplane & converge to a point Quick and intuitivecalculation of main imagingeffectsRen Ng

Modern Lens Designs Are Highly Complexilovephotography.comPhotographic lens cross sectionCS184/284ARen Ng

Modern Lens Designs Are Highly Complexilovehatephoto.com4 element mobile phone lens (on 24x36mm sensor)CS184/284ARen Ng

Modern Lens Designs Are Highly Complex[Apple]CS184/284ARen Ng

Modern Lens Designs Are Highly ComplexZeiss flickr.com accountMicroscope objectiveCS184/284ARen Ng

Example Lens Formula: Double GaussData from W. Smith,Modern Lens Design, p 312Radius (mm)Thick (mm)nd1.670V-no47.1Aperture 8CS184/284A40.01.71748.040.040.0Ren Ng

Ray Tracing Through Real Lens Designs200 mm telephoto35 mm wide-angle50 mm double-gauss16 mm fisheyeFrom Kolb, Mitchell and Hanrahan (1995)CS184/284ARen Ng

Ray Tracing Through Real Lens Designs200 mm telephotoNotice shallow depth of field (out of focus background)CS184/284ARen Ng

Ray Tracing Through Real Lens Designs16 mm fisheyeNotice distortion in the corners (straight lines become curved)CS184/284ARen Ng

Ray Tracing Real Lens DesignsMonte Carlo approach At every sensor pixel, compute integral of raysincident on pixel area arriving from all pathsthrough the lensAlgorithm (for a pixel) Choose N random positions in pixel For each position x’, choose a random position onxthe back element of the lens x’’00 Trace a ray through from x’ to x’’, trace refractionsthrough lens elements until it misses the nextelement (kill ray) or exits the lens (path tracethrough the scene)x0 Weight each ray according to radiometriccalculation on next slide to estimate irradiance E(x’)CS184/284ARen Ng

Radiometry for Tracing Lens DesignsdA’’rx’’Back element of lensL(x’’, x’)θ’’Za point one ray fromhe axis to .then used toe on the filmCS184/284Aθ’aZx’Sensor Plane000Figure 06: Geometry for computingthe irradiancea point on the00000 cos atcosE(x) ! x ) 00dAfilmplaneand the exact L(xform factor.02 xx x00 2DZ100 the film0 plane4 to the disk,00istheaxialdistancefromwhere L(x!x)cos dAthe2 area 00of the disk. If is assumed to be the focaland is Zx 2Dlength, (7) can be written(8)Ren Ng

Connection to Thin Lens Model

Spherical Lens & Paraxial ApproximationR1nAAssume: Lens has negligible thickness Ray is very close to axis (paraxial) All angles are small, so sin tanR2nLf ? What is the focal length?CS184/284ARen Ng

Spherical Lens & Paraxial Approximation 2 1 hR1(1) nA sin nL sin 1(2) 1 2 ) (3) nA nL ( (4) h/R1CS184/284A(Snell’s Law) 2 )(Paraxial approx.)(Paraxial approx.)Ren Ng

Spherical Lens & Paraxial Approximation 4 2 3 2h endR2(5) nL sin 3 nA sin 4f ?(Snell’s Law)(6) 3 2 (7) 4 end ) (8) nL ( 2 ) nA ( end )(9) h/R2(10) end h/fCS184/284A(Paraxial approx.)(Paraxial approx; note signR2 )(Paraxial approx.)Ren Ng

Spherical Lens & Paraxial ApproximationhR1nAR2nLf ?(3, 8) ) (11) end (nL /nA 1)( ) hnLhh(subst. 4,9,10 into 11) ) (12) 1fnAR1R2 1nL11s out, CS184/284Aapplies to all paraxial rays)(13) 1fnAR1R2h factors out; appliesto all paraxial raysRen Ng

Lens Maker’s EquationR11 f R2nAnLnLnA 11R1f ?1R2 f, R1 and R2 are signed quantities, positive pointingto the right; radii point from surface to center.CS184/284ARen Ng

Lens Maker’s Equation – Convex / ConcaveR1 0R1 0R1 0R2 0R2 0R 2 R1 0f 0f 01 f nLnAR 1 R2 0f 0f 0 11R11R2 f, R1 and R2 are signed quantities, positive pointingto the right; radii point from surface to center.CS184/284ARen Ng

Thick Lens ApproximationApproximate a complex optical system by a “thicklens” where idealized refraction occurs at two“principal planes”, one each for forward and backwardpropagation. Characterize lens by just few parameters.[Smith]CS184/284ARen Ng

Things to RememberEffectCauseField of viewDepth of fieldExposureMotion blurGrain/noiseSensor size, focal lengthAperture, focal length, object dist.Aperture, shutter, ISOShutterISOPinholes and lenses form perspective imagesPerspective composition, dolly zoomCS184/284ARen Ng

Things to RememberIdeal thin lenses Paraxial approximation, lens maker equationThin lens equation, various applicationsFocusing, defocus blur, depth of field, hyperfocalRay-tracing optical designs for real compound lenses Monte Carlo ray-tracing of train of optical elementsDefocus blur, optical aberrations, bokehCS184/284ARen Ng

AcknowledgmentsMany thanks to Marc Levoy, Pat Hanrahan, Matt Pharrand Joyce Farrell for presentation resources.CS184/284ARen Ng

Extra

Auto Focus

Contrast Detection AutofocusA target object is imagedthrough the lens to an imagepatch on the sensor.The contrast of this image patchis high if the object is in focus,low otherwise.The physical focus of the lens isadjusted until the contrast ofthis image patch is maximized.Many ways to estimate how infocus the image patch is:gradient, Sum ModifiedLaplacian (Nayar), variance CS184/284ADemo (Levoy, Willet, 10/applets/autofocusCD.htmlRen Ng

Phase Detection AutofocusRay bundles from a target objectconverge to points at differentdepths in the camera dependingon the lens focus.In a phase detection AF system raybundles passing through differentportions of the lens (red and greenshown) are brought to focus onseparate lenslets with separate AFsensors.Depending on depth of focuspoint, the ray bundles converge todifferent positions on theirrespective AF sensors (seeinteractive demo).A certain spacing (disparity)between these images is “in focus”CS184/284ADemo (Levoy, Willet, 10/applets/autofocusPD.htmlRen Ng

Phase Detection AF Used in DSLRs[Canon] Distance between phase-detect images correlates to distance in focusto target object (allows “jumping” to the right focus) Separate AF units cannot be used with “live view” or video recordingCS184/284ARen Ng

Phase Detection Pixels Embedded in SensorCanon Modern image sensors have small pixels, and may embedphase detection pixels directly into sensor image arraysCS184/284ARen Ng

Exposure Controls in Photography Aperture size Change the f-stop by opening / closing the aperture (if camera has iris control) Shutter speed Change the duration the sensor pixels integrate light ISO gain Change the amplification (analog and/o