Lecture 12: Cameras and
Geometry
CAP 5415
Fall 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
Plane
Slide 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
Camera Obscura, Gemma Frisius, 1558
The first camera
– Known to Aristotle
– Depth of the room is the effective focal length
Camera Obscura
• Can also be a box
We’ll use the pinhole camera model
to describe image formation
Notice how the image is inverted
(Image from Slides by Forsyth)
Projection Effects
Pinhole
• Height of objects depends on the distance from
the pinhole (O)
(Image from Slides by Forsyth)
Projection Effects: Horizon Line
• Consider two parallel lines that lie in a plane (Π)
• Will converge to a point on the horizon line(H)
Pinhole
(Image from Slides by Forsyth)
• Observe this next time you are driving on a flat
road
Vanishing points
• Each set of parallel • Good ways to spot
lines (=direction) faked images
meets at a different – scale and perspective
point don’t work
– The vanishing point for – vanishing points
this direction behave badly
• Sets of parallel lines – supermarket tabloids
on the same plane are a great source.
lead to collinear
vanishing points.
– The line is called the
horizon for that plane
(From Slides by Forsyth)
The equation of projection
(Image from Slides by Forsyth)
The equation of projection
We know:
so
(Image from Slides by Forsyth)
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, because
a very small set of rays
from a particular point
hits 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
“circle of
confusion”
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?
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’
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
f/8 f/11 f/16
f/22
From http://www.cambridgeincolour.com/tutorials/diffraction-photography.htm#
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 • My sensor would
picture of this edge 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)