Upload
buithien
View
215
Download
1
Embed Size (px)
Citation preview
1
6.A44 Computational PhotographyDepth of Field
Frédo Durand
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Add date: Friday
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Depth of field
lenssensor
Point in focus
Object with texture
• We allow for some tolerance
lenssensor
Point in focus
Object with texture
Max acceptable circle of confusion
Depth of field
Depth of focus
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Depth of field
• What happens when we close the aperture by two stop?– Aperture diameter is divided by two– Depth of field is doubled
lenssensor
Point in focus
Object with texture
Diaphragm
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Depth of field depends on focusing distance
• What happens when we divide focusing distance by two?– Similar triangles => divided by two as well
lenssensor
Point in focus
Half depth of field
Half depth of field
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
DoF summary 1
• Half aperture, Double DoF• Double distance, double DoF• Focal length?
2
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Depth of field & focal length
• Recall that to get the same image size, we can double the focal length and the distance
• Recall what happens to physical aperture size when we double the focal length for the same f number?– It is doubled
24mm 50mm
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
• Same image size, same f number• DoF in object space?
– The same!
Depth of field & focal length
Wide-anglelens
Telephotolens (2x f), same aperture
DoF
DoF
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Important conclusion
• For a given image size and a given f number, the depth of field (in object space) is the same.
• Might be counter intuitive.
• Now what happens to the background blur?
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
• Same object-space blur• But more magnified with telephoto
=> more blurry
Background blur for distant object
Wide-anglelens
Telephotolens (2x f), same aperture
DoF
DoF
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Pattern enlarged 4 times: it is “smoother”, looks more blurry
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Important conclusion
• For a given image size and a given f number, the depth of field (in object space) is the same. – That is, the depth of acceptable sharpness is the same
• But the background looks more blurry with telephoto– Because it gets magnified
• Notice that magnification is – 1 around the object (because we change the distance) – 2 at infinity
– Assignment: Guess the function!
3
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Seeing beyond occlusion
• Photo taken through zoo bars• Telephoto at full aperture• The bars are so blurry
that they are invisible
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Crazy DoF images
• By Matthias Zwicker• The focus is between the two sticks
Sharp version
Really wide aperture version
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Depth of field
• It’s all about the size of the lens aperture
lenssensor
Point in focus
Object with texture
lens
sensor Point in focus
Object with textureFrédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Sensor size
• http://www.mediachance.com/dvdlab/dof/index.htm
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
The coolest depth of field solution
• http://www.mediachance.com/dvdlab/dof/index.htm• Use two optical systems
lensdiffuser
Point in focus
Object with texture
lens
sensor
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
The coolest depth of field solution
• http://www.mediachance.com/dvdlab/dof/index.htm
lensdiffuser
Point in focus
Object with texture
lens
sensor
4
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Photoshop• Using layers: • One sharp layer, one blurry layer (using Gaussian blur)• Layer mask selects focus
Input (sharp layer)
Result
Blurred layer
Mask of blurry layer)
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Photoshop• Problem: halo around edges
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Photoshop lens blur• Reverse-engineered algorithm: average over circle• Size of circle depends on pseudo depth • Discard pixels that are too much closer
Input Depth map (painted manually)
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Photoshop lens blur
• Filter>Blur>Lens blurInput
Result
Depth map (painted manually)
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Tilt-shift lens
• Advanced control on Perspective– In particular for architecture
• Advanced control on plane of focus– Does not need to be parallel to film
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Architectural perspective
• Problem:converging verticals
• Normal since we lookupwards
• But disconcerting
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching
5
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Solution: crop a wider image
• Take a very wide angle • Crop the upper part
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching
Wide-angle image looking upwardNotice the converging verticals
Image with wider field of view (sort of)The viewing direction is horizontal, the verticals are parallel. When we crop, we get what we wanted.
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Solution: crop a wider image
• Take a very wide angle• Crop the upper part• This is what shifting does
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching
Lens center
Sensor
SceneProjection
Shift direction
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Architectural perspective
• Solution: view-camera• Lens shifted with respect to film
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Architectural perspective
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Digital perspective correction
• Photoshop, distort
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Digital perspective correction
• Photoshop, distort• Can be done traditionally
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching
6
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Shift: control plane of focus
Snapshot-Perspective-Speed, aperture-Filter-Lighting-Processing & Print-Make up-Retouching
sensor
No shift Shift
Lens aperture
Focus plane
sensor Lens aperture
Focus plane
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
• Useful for landscapeto get depth of field from foreground to infinity
Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Soft focus
• Everything is blurry• Rays do not converge• Some people like it for portrait
With soft focus lens Frédo Durand — MIT Computer Science and Artificial Intelligence Laboratory - [email protected]
Assignment
• Guess the function (slide 12)• Take a high-dynamic range picture.
– Get HDRShop– Calibrate the camera response curve (you can share the curve)– Use the bracketing mode on the camera to take a sequence of 3
pictures– Assemble a high-dynamic-range image using HDRShop