Virtual photography


It is possible to use the mathematical muscle of panorama software to convert photos, taken with a real camera, into images that might have been taken with a different camera, or might not even be possible to take with any real camera. Simply convert the photos to an ideal spherical image, using a formula that inverts the projection of the real camera; then project the sphere into a flat image using a different formula.

This is equivalent to photographing the subject with a different camera, whose projection is defined by the second formula. That could be a mathematical simulation of a real camera, for example with a different focal length, a tilt-shift mechanism, and so on. But a software camera need not be limited to what a real lens and focal plane can do, so there is great scope for creating optically impossible but visually pleasing virtual photographs. A popular example is “little planet” projections of spherical panoramas.

You would not expect to see a little planet view while walking in the park. But there can be far more realistic looking virtual photographs. The one above is almost as extreme as a little planet — the field of view is about 205 x 110 degrees — yet at first glance, at least, it strikes you as something you might actually be able to see in person. I made it from 10 photos shot freehand with a 24mm lens on a 2/3 frame dslr. First I stitched those to a partial spherical panorama with PTGui, then “re-photographed” the scene with my Panini-Pro software.

Panini-Pro is an interactive virtual camera designed to make it easy to create visually pleasing flat images from spherical ones. It has a variety of controls for re-projecting the sphere, including zoom, shift, rotation, tilt, swing, and deformations of both the sphere and the focal plane — and of course the Panini projection, which can zoom from rectilinear through cylindrical stereographic to mirror-cylinder. You control everything from a gui, and you get immediate visual feedback; so it is usually not hard to arrive at an image that “just looks right”.

Panini-Pro can also work with single photos, which it converts to spherical using an adjustable lens model like the ones found in stitchers. Since you make those adjustments, the sphere may not be mathematically perfect, but so long as you get close, you can make a nice looking virtual photo. Here is an example of converting a snapshot taken with a fish-eye lens into a more realistic looking simulated perspective view.

Fish-eye Photo, 180 x 140 degrees

I took the photo with an 8mm fish-eye lens on a crop camera, trying for a good point of view but making no effort to level the camera. When I loaded it into Panini-Pro I set the lens parameters — focal length and curve shape — to match the lens.  Then I rotated the spherical image (by adjusting pitch and roll angles) to make all vertical elements of the scene vertical on screen — this is equivalent to leveling the camera, and is critical to a good result. While doing that I used the shift controls to keep the image framed nicely. 

Next I adjusted the Panini compression parameter for a convincing perspective in the horizontal aspect, and scaled the image down by about 8% vertically to give the people more plausible shapes (the Panini projection tends to exaggerate height).  Finally I used Panini-Pro\’s spot flattening tools to “squeeze” bulging areas near the floor and ceiling into more pleasing shapes, touched up yaw, pitch, zoom and framing, and saved the view.  My guide throughout was the visual appearance of the image, not any theoretical rules of perspective.  I was working more like a painter than an engineer.

Simulated Perspective Photo, 170 x 110 degrees

[revision of a post from June 2012]

Leave a Reply

Your email address will not be published.