lecture 13: cameras and geometry - cs department - homemtappen/cap5415/lecs/lec12.pdf• each set of...
TRANSCRIPT
Lecture 12: Cameras and Geometry
CAP 5415Fall 2010
The midterm
• What does the response of a derivative filter tell me about whether there is an edge or not?
Things aren't working
• Did you look at the filters?• Why not?• Normalize the filters
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
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
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
PlaneSlide by Steve Seitz
A little bit of history on building cameras
Camera Obscura• Latin for “Dark Box”• Dark room with a pinhole in wall• Projects image onto wall• Allows artists to get perspective right
Image from Wikipedia
Camera Obscura
The first camera– Known to Aristotle– Depth of the room is the effective focal length
Camera Obscura, Gemma Frisius, 1558
Camera Obscura
• Can also be a box
We’ll use the pinhole camera model to describe image formation
(Image from Slides by Forsyth)
Notice how the image is inverted
Projection Effects
• Height of objects depends on the distance from the pinhole (O)
(Image from Slides by Forsyth)
Pinhole
Projection Effects: Horizon Line• Consider two parallel lines that lie in a plane (Π)• Will converge to a point on the horizon line(H)
(Image from Slides by Forsyth)
Pinhole
• Observe this next time you are driving on a flat road
Vanishing points• Each set of parallel
lines (=direction) meets at a different point– The vanishing point for
this direction
• Sets of parallel lines on the same plane lead to collinear vanishing points. – The line is called the
horizon for that plane
• Good ways to spot faked images– scale and perspective
don’t work– vanishing points
behave badly– supermarket tabloids
are a great source.
(From Slides by Forsyth)
The equation of projection
(Image from Slides by Forsyth)
The equation of projection
(Image from Slides by Forsyth)
We know:
so
Lenses
• Why Lenses?• For an ideal pinhole, only one ray of light
reaches each point– Very Dim Image
• Why not make pinhole bigger?
Why not make pinhole bigger?• Only one point can generate rays that strike
a particular point on the image plane
Why not make pinhole bigger?• Now add an aperture
Pinhole too big - many directions are averaged, blurring the image
Pinhole too small- diffraction effects blur the image
Generally, pinhole cameras are dark, becausea very small set of raysfrom a particular pointhits the screen.
(From Slides by Forsyth)
Lenses
• The lens focuses multiple rays coming from the same point
(Image from Slides by Forsyth)
Thin Lens Equation
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– How can we change focus distance?
“circle of confusion”
Slide by Steve Seitz
More on Lenses
Canon EF 28-135mm f/3.5-5.6 IS USM Standard Zoom Lens for Canon SLR Cameras
28-135mm is the focal length
i o
P
P’
f
Diagram by Shree Nayar
What's f/3.5-5.6?
Canon EF 28-135mm f/3.5-5.6 IS USM Standard Zoom Lens for Canon SLR Cameras
f-number
• f is the focal length• D is the diameter of the pupil or aperture
• f/2 is the same as N=2• f/16 is the same as N=16• Which has the bigger aperture?
What's f/3.5-5.6?
• This is the widest possible aperture
Canon EF 28-135mm f/3.5-5.6 IS USM Standard Zoom Lens for Canon SLR Cameras
Why should I adjust the aperture?
• Big aperture means more light, shorter exposure time
• Also affects sharpness and depth of field
Here, the rays are focused on the image plane
Now, look at a point that is farther way
Circle of Confusion
It grows as you move farther away
Circle of Confusion
Circle of Confusion• Spot caused by a point that is not in focus
• You decide the tolerable limits(Diagram from Wikipedia)
Aperture also causes blurring• Go back to pinhole camera model• Only one point can generate rays that strike
a particular point on the image plane
Aperture also causes blurring• Now add an aperture
Depth of Field• Increasing the aperture diameter increases
the size of the circle of confusion
f/22 f/5.6
Diffraction• When light passes through a small aperture
the rays begin to interfere with each other• For a perfectly circular aperture this leads
to the airy disc pattern
Image from http://www.cambridgeincolour.com/tutorials/diffraction-photography.htm#
This leads to a loss of sharpness
From http://www.cambridgeincolour.com/tutorials/diffraction-photography.htm#
f/8 f/11 f/16
f/22
After Light Strikes the sensor
• Engineering problem:– I have sensor that records the amount of light
at different pixels– How do I get a color image instead of a black
and white image?
Solutions
• Three sensors• One sensor with a color mask
– Each pixel records one wavelength
• A common pattern for the mask is the Bayer pattern:
Mosaicing
• So, if I took a picture of this edge
• My sensor would record this image
Demosaicing
• I have 1 color at each pixel• I need three• Easy solution: Interpolate
+
Problem! This smooths across the edge
• Because the different pixels are used to red and green, the smoothing may be different
+
Result: Color Fringing
Color Fringing
(Results from Brainard et al)
Fast Solution
• The fringing occurs when the correlation between the color channels is incorrectly estimated
• One measure of this correlation is the color difference
• Can fix errors using median filtering
Simple Demosaicing Algorithm (Freeman)
• Use linear interpolation to get first estimate• Compute difference images between color
channels• Median filter these difference images• Use filtered difference images to
reconstruct
(Slide by Freeman)