Mike Stark
Homework #4
An implementation of the Thin-Lens Camera Model
Overview
For this assignment we were asked to implement a simple, but fairly realistic,
thin-lens camera model, and demonstrate that it works by displaying some
images here. So, without further ado...
Images
The following images were created using a reasonably
realistic camera parameters, modeled after a 35mm camera (with a "square" film
plane rather than the typical 2:3 aspect ratio) having a 50 mm focal length.
The camera was arranged in space so that the center of projection is on the
main axis, 50 mm (the focal length) in front of the film plane. The film
plane is fixed in space and the lens is allowed to move for focusing,
analogous to a real camera mounted on a tripod. Specifically, for all the
images below, except otherwise noted, the parameters are:
- Focal Length: 50mm
- f-ratio: (variable)
- Shutter Speed: (variable)
- Center of Projection: (0, 0, 1m)
- Image Plane Normal: (1, 0, -0.16m)
- "Up" Vector: (0, 0, 1)
- Film Center: (0, 0)
- Film Dimensions: 36mm x 36mm
The orientation thus has the camera mounted one meter above the origin of the
xy-plane, looking along the positive x-axis, declined slightly from the
horizon. The xy-plane is painted with an infinite unit checkerboard, with red
checks decreasing in brightness with increasing x coordinate. (This was done
to avoid the pathological aliasing problems of the checkerboard near the
horizon.)
There are four "signs" indicating distance from the center of projection.
Each is raised about 0.9m above the plane for aesthetic reasons; however, this
may cause some perceptual confusion as they tend to make the plane look closer
than it is. The first checker corner visible at the bottom of the screen is
actually the point (1, 0). There is an image of the full moon visible about
400,000 km away along the x-axis, which is sufficiently far away to be
considered at "infinity". The only lighting in the scenes is the ambient
lighting.
The scene looks like this, using a "pinhole" camera.
This, along with most of the other images on this page, were done using a
simple box filter and 64 samples per pixel, jittered on both the image plane
and the lens. The aperture is circular, and the sampling is accomplished
using Pete's concentric square-to-disk map.
Variation of the Focus
The following images were rendered at f5.6, which amounts to an aperture
diameter of about 8.9mm.
One thing worth noting here is that the effective field of view is
somewhat narrower when the focus is close than when it is far. The reason for
this is that a closer focus causes the lens to be further from the film plane,
so it subtends a smaller angle and hence a smaller field of view. The effect
is perhaps easier to visualize with the pinhole camera model; one can
certainly see more through a tiny hole by putting an eye nearly against it!
Even more obvious than the change of field of view with the focus is the
change in the apparent size of the ".25 m" object in the scene, which is
greater than the change in the field of view itself. This is a result of the
fact that the lens is moving (closer to the object) as the focus is drawn in.
Another orientation option would be to leave the lens fixed in space, and move
the film plane to focus. In this case the field of view would change, but the
apparent size of the near objects would only change as much as the field of
view.
| Focus at 0.25m |
Focus at 0.5m |
 |
 |
| Focus at 1m |
Focus at 2m |
 |
 |
| Focus at "infinity" |
 |
Variation of the Aperture
The following images have focus plane fixed at 0.5m but have significant
variation the aperture. Note that differences the image rendered at f22 is
| f22 |
f11 |
 |
 |
| f5.6 |
f3.3 |
 |
 |
Some Movies
Here are a couple of not particularly good animations showing the variation
in the focus and the aperture. Both are in SGI format, despite the ".qt"
extension. I'd rather have made them into QuickTime movies, but the software
on the SGI's I was using didn't seem to want to let me do it. I don't know
why, I didn't have any trouble creating the movies in homework 4.
The focus animation goes from focusing at 0.20 meters to about 5 meters,
in steps proportional to the inverse of the focus distance. The aperture
animation starts with an aperture of 25 mm and goes to zero, in increments of
1 mm. Neither one turned out very good, I'm afraid.