Recap from Wednesday

43

Transcript of Recap from Wednesday

Page 1: Recap from Wednesday
Page 2: Recap from Wednesday

Recap from Wednesday

Two strategies for realistic rendering

capture real world data

synthesize from bottom up

Both have existed for 500 years. Both are

successful. Attempts to take the best of both

world have been successful. We’re going to

take it further.

Page 3: Recap from Wednesday

Administrative Stuff

Any questions?

Syllabus

Textbook

Matlab Tutorial

Office hours • James: Monday and Wednesday, 1pm to 2pm

• Sam: Sunday 7:30-9:30pm

• Emanuel: Monday 5-7pm

Project 1 is out

Page 4: Recap from Wednesday

Project 1

Page 5: Recap from Wednesday

The Camera

CS 129: Computational Photography

James Hays, Brown, Spring 2011

Many slides by

Alexei A. Efros

Page 6: Recap from Wednesday

How do we see the world?

Let’s design a camera • Idea 1: put a piece of film in front of an object

• Do we get a reasonable image?

Slide by Steve Seitz

Page 7: Recap from Wednesday

Pinhole camera

Add a barrier to block off most of the rays • This reduces blurring

• The opening known as the aperture

• How does this transform the image?

Slide by Steve Seitz

Page 8: Recap from Wednesday

Pinhole camera model

Pinhole model: • Captures pencil of rays – all rays through a single point

• The point is called Center of Projection (COP)

• The image is formed on the Image Plane

• Effective focal length f is distance from COP to Image Plane

Slide by Steve Seitz

Page 9: Recap from Wednesday

Point of observation

Figures © Stephen E. Palmer, 2002

Dimensionality Reduction Machine (3D to 2D)

3D world 2D image

What have we lost? • Angles

• Depth, lengths

Page 10: Recap from Wednesday

Funny things happen…

Page 11: Recap from Wednesday

Lengths can’t be trusted...

Figure by David Forsyth

B’

C’

A’

Page 12: Recap from Wednesday

…but humans adopt!

http://www.michaelbach.de/ot/sze_muelue/index.html

Müller-Lyer Illusion

We don’t make measurements in the image plane

Page 13: Recap from Wednesday

Modeling projection

The coordinate system • We will use the pin-hole model as an approximation

• Put the optical center (Center Of Projection) at the origin

• Put the image plane (Projection Plane) in front of the COP

– Why?

• The camera looks down the negative z axis

– we need this if we want right-handed-coordinates

Slide by Steve Seitz

Page 14: Recap from Wednesday

Modeling projection

Projection equations • Compute intersection with PP of ray from (x,y,z) to COP

• Derived using similar triangles

• We get the projection by throwing out the last coordinate:

Slide by Steve Seitz

Page 15: Recap from Wednesday

Homogeneous coordinates

Is this a linear transformation?

Trick: add one more coordinate:

homogeneous image

coordinates

homogeneous scene

coordinates

Converting from homogeneous coordinates

• no—division by z is nonlinear

Slide by Steve Seitz

Page 16: Recap from Wednesday

Perspective Projection

Projection is a matrix multiply using homogeneous

coordinates:

divide by third coordinate

This is known as perspective projection • The matrix is the projection matrix

• Can also formulate as a 4x4

divide by fourth coordinate Slide by Steve Seitz

Page 17: Recap from Wednesday

Orthographic Projection

Special case of perspective projection • Distance from the COP to the PP is infinite

• Also called “parallel projection”

• What’s the projection matrix?

Image World

Slide by Steve Seitz

Page 18: Recap from Wednesday

Building a real camera

Page 19: Recap from Wednesday

Camera Obscura

The first camera • Known to Aristotle

• Depth of the room is the effective focal length

Camera Obscura, Gemma Frisius, 1558

Page 20: Recap from Wednesday

Home-made pinhole camera

http://www.debevec.org/Pinhole/

Why so

blurry?

Page 21: Recap from Wednesday

Shrinking the aperture

Why not make the aperture as small as possible? • Less light gets through

• Diffraction effects…

Less light gets through

Slide by Steve Seitz

Page 22: Recap from Wednesday

Shrinking the aperture

Page 23: Recap from Wednesday

The reason for lenses

Slide by Steve Seitz

Page 24: Recap from Wednesday

Focus

Page 25: Recap from Wednesday

Focus and Defocus

A lens focuses light onto the film • There is a specific distance at which objects are “in focus”

– other points project to a “circle of confusion” in the image

• Changing the shape of the lens changes this distance

“circle of

confusion”

Slide by Steve Seitz

Page 26: Recap from Wednesday

Thin lenses

Thin lens equation:

• Any object point satisfying this equation is in focus

• What is the shape of the focus region?

• How can we change the focus region?

• Thin lens applet: http://www.phy.ntnu.edu.tw/java/Lens/lens_e.html (by Fu-Kwun Hwang ) Slide by Steve Seitz

Page 27: Recap from Wednesday

Depth Of Field

Page 28: Recap from Wednesday

Depth of Field

http://www.cambridgeincolour.com/tutorials/depth-of-field.htm

Page 29: Recap from Wednesday

Aperture controls Depth of Field

Changing the aperture size affects depth of field • A smaller aperture increases the range in which the object is

approximately in focus

• But small aperture reduces amount of light – need to

increase exposure

Page 30: Recap from Wednesday

Varying the aperture

Large apeture = small DOF

Small apeture = large DOF

Page 31: Recap from Wednesday

Depth of Field

Page 32: Recap from Wednesday

Field of View (Zoom)

Page 33: Recap from Wednesday

Field of View (Zoom)

Page 34: Recap from Wednesday

Field of View (Zoom) = Cropping

Page 35: Recap from Wednesday

f

FOV depends of Focal Length

Smaller FOV = larger Focal Length

f

Page 36: Recap from Wednesday

From Zisserman & Hartley

Page 37: Recap from Wednesday

Field of View / Focal Length

Large FOV, small f

Camera close to car

Small FOV, large f

Camera far from the car

Page 38: Recap from Wednesday

Fun with Focal Length (Jim Sherwood)

http://www.hash.com/users/jsherwood/tutes/focal/Zoomin.mov

Page 39: Recap from Wednesday

Lens Flaws

Page 40: Recap from Wednesday

Lens Flaws: Chromatic Aberration

Dispersion: wavelength-dependent refractive index • (enables prism to spread white light beam into rainbow)

Modifies ray-bending and lens focal length: f( )

color fringes near edges of image

Corrections: add ‘doublet’ lens of flint glass, etc.

Page 41: Recap from Wednesday

Chromatic Aberration

Near Lens Center Near Lens Outer Edge

Page 42: Recap from Wednesday

Radial Distortion (e.g. ‘Barrel’ and ‘pin-cushion’)

straight lines curve around the image center

Page 43: Recap from Wednesday

Radial Distortion

Radial distortion of the image • Caused by imperfect lenses

• Deviations are most noticeable for rays that pass through the

edge of the lens

No distortion Pin cushion Barrel