Perspective correction

From Wiki
Revision as of 00:38, 24 July 2005 by Erik Krause (talk) (to be continued)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This tutorial has no direct relevance to panorama creation. However, perspective correction is an issue for panorama creation as well, if you shoot your images tilted up or down. But please note that it is not necessary to correct the images prior to stitching - this is done in one go with alignment and stitching.

Falling lines can be annoying not only in architectural photography. In former times photographers used shift lenses (some times called Correction lenses) to correct for that. These lenses usually are pretty expensive, not available in all needed focal lengths and limited to a certain amount of correction.

Panotools are able to simulate a shift lens in terms of geometry (obviously they can't simulate it in terms of Depth of Field). There are some easy and straightforward techniques to achieve perspective correction depending on the direction the camera was tilted.


You need either PTGui or hugin for this tutorial. The usage of these programs is more or less identical although names differ sometimes a bit. I'll explain using PTGui and provide a small glossary where the respective hugin names are listed.

In all cases you start a new project and add the image you want to correct by pressing the Add button.

Go to Lens parameters tab and choose your lens type (presumable normal (rectilinear)). Enter the approximate Field of View if not already read from Exif data (it's not necessary to have it exact). If you already have lens correction parameters enter them in the a, b and c field else enter 0.0 for each.

In Panorama settings tab choose Rectilinear ('flat') as output.

Camera tilted up or down

Falling lines example © Daniela D�rbeck
corrected image in Panorama Editor

If the camera was level to the horizon, one pair of vertical control points is enough to correct for falling lines. Go to Control points tab and set a point to the top of something vertical in your image in the left pane and one at the bottom of the same vertical structure in the rigth pane. Be sure to choose Vertical line as control point type.

On Optimizer tab check Interface: Advanced. Check Pitch and Use control points of: for Image 0. All other fields are unchecked. Then press Run Optimizer and confirm the following dialog.

Open Panorama Editor and press the Fit panorama button. The image should be corrected and shifted up or down with black space below or above. You can cut the frame using the small sliders at the bottom and right side of the window. However, you can't crop away the additional black space.

Once you're done proceed as described under Save and Exit.

(to be continued)


PTGui - hugin

PTGui names left mentioned in the text correspond to hugin names right.

Add - Add individual image

Lens parameters - Camera and Lens

Note that in hugin you must select the image in the list first.

Panorama settings - Stitcher


In hugin choose the custom parameters below from the Optimize drop list.

Run Optimizer - Optimize now

Panorama Editor - Panorama preview

In PTGui: Ctrl+E - in hugin: Ctrl+P

Fit panorama

In PTGui: Ctrl+F or menu: Edit -> Fit panorama - in hugin: Fit

--Erik Krause 18:38, 23 Jul 2005 (EDT)