text
SEARCH
issue 20 - May 2005 - column


BEGINNER'S TOOLS: PANOTOOLS WORKFLOW FOR MERE MORTALS
by Roger Howard



In the first of this series geared towards VR beginners, Roger Howard takes you through a detailed PanoTools workflow.

INTRODUCTION TO PANOTOOLS

PTMac is a descendant of the popular PanoTools family of imaging and panoramic stitching products. Built for power, control and quality, PanoTools has never been seen as particularly user-friendly to novices, though conceptually it is quite simple. In the decade since its initial release, a number of products have come along designed to put a nicer face on PanoTools with GUIs designed to automate – more or less – the PanoTools stitching process.

Control points are at the core of all PanoTools stitching workflows – a control point is two sets of coordinates identifying the same location in two overlapping images. If you build up enough control points, PanoTools can find a way to fit all your images together into a seamless panorama. The original process of defining control points was more than a little scary for most photographers, or at least those who don’t also happen to be rocket scientists with natural resistance to carpal tunnel syndrome.

The PanoTools GUI products – PTAssembler, PTGUI, PTMac, and others – were initially developed with the main goal of providing a more graphical means of defining control points – by visually selecting successive pairs of overlapping images and then clicking to define shared control points. However, even this approach to control points give a lot of photographers a creative cold shower – setting them up is a tedious and unpleasant way to spend an afternoon, especially if you’ve got a sensitive mouse button finger. On cold days I might as well just hit the index finger on my mouse hand with a hammer a few dozen times to get the same effect (minus the panoramic output)!

Once control points have been assigned the really hard part is over, but it’s not all just ready to post of the Web yet.

Assuming you don’t have major parallax problems, and the control points you set were good, then you’ll be able to render out a panorama that fits without misalignments. Yet even then, there’s a final challenge – due to slight exposure variations from the center to the edge in most photographs, and other phenomenon like relative motion of subjects between overlapping images (trees blowing, pedestrians moving, etc), even with a perfect fit of your images there are still artifacts that PanoTools alone cannot cope with.

Two products in particular have brought humanity to PanoTools. David Lowe, a computer science professor at the University of British Columbia released SIFT, or Scale Invariant Feature Transform, a technology with the sole purpose of identifying matching details in possibly overlapping images. With minor adaptation, this technology is, in many cases, now capable of completely automating the task of setting control points; my carpal tunnel actually twitches with reverence every time I say Lowe’s name. (SIFT has been licensed by MacDonald, Dettwiler & Associates and Evolution Robotics.) At about the same time, a tool named enblend hit the scene, which can deal with the nasty problem of blending stitched images together without leaving unsightly artifacts behind. Often enough, both of these tools do better, more accurate work than the humans they replace – and when they don’t, its always possible to override their choices.

As with the development of the stitching GUIs themselves, the intervening years have brought new and better technologies to bear on the most difficult stitching steps, while leaving intact the potential for control and ultimate quality of output in PanoTools. In 2005, PanoTools has reached a point of maturity, or at least it's in sight.

In the rest of this article we’ll look at how anyone can exploit this process to do high-quality stitching and output without holding an advanced degree in number theory. First, I’m going to walk you through each step in relatively excruciating detail; once you’ve got a handle on the interface, or if you’re male and therefore hate reading anything resembling instructions, you can skip to the cheat sheet section at the end for a highly abbreviated process.

DEFINING THE PANOTOOLS WORKFLOW

Now that you’re ready to believe PanoTools stitching doesn’t have to be a sadomasochistic venture, let’s provide a little structure for your workflow. I’ll be using PTMac 3 in this article, but other tools such as PTGUI will have similar workflow.

1. Post-Production Preparations
2. Shoot and prepare your images
3. Generate control points
4. Optimize
5. Render
6. Blend
7. Convert for display

Post Production Preparations
Before we start, you’ll need a few tools. As I work on a Mac, I get my PanoTools products from Kevin Kratzke at Kekus.com.

1. Xpoints
2. PTMac 3

Once these products are installed and configured (make sure to launch each one at this point to enter serial numbers and any basic configuration), we’re going to setup a rough template for your lens that can be reused in every future project which was shot with the same (and at the same focal length).

1. Launch PTMac

2. If it fires up the Wizard, check “Don’t show wizard at startup” and dismiss it by clicking Cancel

3. Add an image – any JPEG or TIFF will do – to the Source Images list by dragging one onto the window or clicking the “Add…” button.

4. Select the Lens Setting panel

5. Set the orientation – landscape or portrait – as appropriate, and enter the focal length of your lens (in 35mm equivalent values)

6. Select Save As from the File menu, and save the file with a descriptive name, like “12mm Portrait.txt”. Be sure to include the “.txt”

Shoot and Prepare Images
Image preparation for panoramas is largely a reflection of personal preference: doing color correction and other digital darkroom activities, retouching dust spots, and of course capturing images properly to begin with. Assuming basic knowledge of photograph, following a few technical guidelines here will make the rest of the process much easier. This article won’t teach you how to use your camera, lens, tripod or panoramic tripod head, so I’m only offering general advice – not specific steps – in this section.

1. Minimize parallax by using a panoramic tripod head, properly calibrated for your camera and lens, or learn to control your rotation carefully when shooting handheld. For a single row of images, or scenes where the subject matter is relatively distant, parallax will be less of a problem.

2. Control your exposures by using the Manual exposure mode, set the same for each shot. If you’re shooting in JPEG or TIFF, choose your exposure settings based on the most critical subject areas. If shooting RAW, you can tend to underexpose a bit to better capture critical highlight detail and compensate later when processing the RAW files.

3. For most panoramas you’ll ideally shoot stopped down where your lens is sharpest and depth of focus is deep, yet still maintaining a fast enough shutter speed to freeze subject motion. Since these variables trade off against each other it’s a bit of a balancing act; higher ISO settings will help a lot, but may add more noise to your images. Shooting handheld will set you back a few stops.

4. Shoot RAW if it’s practical and your camera supports it; the white balance control, broader dynamic range, and effective exposure compensation can save your panorama.

5. If shooting RAW, process your images into TIFFs for stitching. Use 8bit per channel (24bit) RGB TIFFs, in the sRGB color space. As you get more sophisticated at shooting and stitching panoramas, you’ll understand when you’re ready to ignore these recommendations!

6. Put all your images into a single folder when they are ready to stitch.

Control Points

As painful as control point selection may be or seem, it’s a very accurate way of stitching. Enter SIFT, also known as the Scale-Invariant Feature Transformation, which in technical terms is a bloody brilliant way of saving your hands from curling into claws while automatically choosing controls points for you! Kekus.com provides a friendly interface to SIFT in their XPoints product. Here’s how to use it:

1. Launch XPoints

2. Select the Pictures panel and then drop your images into the list

3. Select the Panorama panel;

4. Click Select and choose the template we created in the very first section – this will tell XPoints the basic info about your lens – it’s focal length – that it needs to do the job. At this point, only the Horizontal Field of View (based on the focal length) is important – you can ignore the other settings in this panel.

5. Click the XPoints panel

6. Set Downscale resolution to somewhere between 1200 and 1800; lower values are much faster, but will result in fewer found control points.

7. Check Use RANSAC algorithm; this will attempt to delete any inaccurate control points found but may result in too few control points for an effective stitch; I tend to work without RANSAC as I’d rather have too many control points and delete a few, then get 20 minutes into it and realize I need to run XPoints again! It’s up to you.

8. Check Search sequentially; this will cause XPoints to only try to find control points between sequential images (image 1 and 2, image 2 and 3, etc).

9. If your panorama is 360 degrees around check Cylindrical search; this will search for control points between the first and last image in the sequence.

10. Click Start

11. This process may take a while, depending on the number and resolution of the images, and the various settings you chose in this section. If you click the Pictures panel while it’s running, you can monitor the status of the process.

12. When the process is complete, it will prompt you to save a file; this file is a PTMac project file we’ll use in the next section. Save it to the same folder as the images. Name it descriptively; I also usually append “.ptm” to the end, so I know it’s a PTMac project file. For instance, “My Pano.ptm”.

Optimize

Optimizing is the one step in this process that may require a bit of practice to get right, though for many panos it won’t take more than one attempt to get good results. If you think of your images as pieces of a jigsaw puzzle, optimizing is the process of using the assigned control points to figure out how best they all fit together. There are essentially two types of optimizing going on – optimizing to fit the images together on the surface of an invisible sphere (using position, yaw, pitch, and roll), and optimizing the values for the lens parameters since no lens is perfect (all have some distortion, which affects stitching) and most don’t even report a very accurate focal length. Getting a good stitch heavily depends on knowing how to properly optimize – so here’s how I’d do it, at least until you know better than I!

1. Open your project file (“My Pano.ptm”) in PTMac; if it presents a warning about finding the missing files in the current folder, just say OK.

2. Click the Optimize tab; we’re going to assume XPoints found enough control points to get started.

3. Setup the window as shown in figure PTMAC 1, if you have more or less images the setup should still be the same; just remember to leave Image 0 unchecked for Yaw, Pitch, and Roll;

4. Click Run Optimizer;

5. If the Panorama Tools Script window comes up immediately, just hit OK. Unchecking the Show script box in the Optimizer pane will prevent these windows from coming up unnecessarily. After a moment, another Panorama Tools Script window may come up again; hit OK again if it does.

6. A Control point distance window will appear, providing you some stats. Hit OK, we’re going to ignore this for now.

7. Back in the Optimizer pane, add a check mark next to Field of View; hit the Run Optimizer button again, and repeat steps 5 and 6. This will attempt to find a better value for the lens focal length than what was entered originally.

8. Return to the Optimizer pane yet again; this will be our final pass. Put a check mark next to A, B, and C.

9. Click Run Optimizer again; this time, don’t dismiss the Control point distance window.

10. Generally, looking at the Average control point distance value will tell you whether your stitch will be a success or not. Values of 2 or less are ideal, but depending on the subject matter you might get away with a lot larger errors. Landscapes and other subjects with little specific detail are more tolerant than interiors and architecture where near-field subjects and straight lines make any error obvious.

11. If your Average control point distance is reasonable you’re ready to render, skipping the next step; if not, you may need to do some cleanup as in step 12. You may also go and add additional control points manually, especially if you end up having to delete too many; you should always have at least three control points per overlapping image pair.

12. Assuming your panorama can be stitched at all, then you need to go and delete the worst control points. Click the Control Points tab, then click the button labeled Table. Click the heading labeled Distance to sort all the control points in your project by their distance – the higher the number, the worse it is. Delete any really obviously bad offenders to start by selecting the control point in the table and hitting Delete, but don’t go hog wild. Often after deleting the worst ones you can re-optimize and get much better values for the rest. Now return to step 8 and optimize again. Depending on the quality of your control points, you may go through a few rounds of this. Once you’ve got acceptable Average control point distance values move on to the render section.

At this point, be sure to save your project so you don’t lose all the hard work you’ve done up to this point!

Render and Blend

Once you think you’ve got a good stitch, it’s time to create your panorama! In this section we’ll set up the output settings, preview the panorama to make sure it’s worth the render time, and if it looks good then we’ll do a full resolution render.

1. Click the Panorama Settings tab and make sure Projection is set to Equirectangular.

2. Click the Create Panorama tab.

3. Make sure all the images in the Include images list are checked.

4. Click the Apply button to set the resolution of your panorama to the optimal size.

5. Set File format to Enblend TIFF.

6. Set Interpolator to Poly 3.

7. Set the Scale slider under the Preview button to about 10% and don’t check View interactively.

8. Click the Preview button. If the panorama looks good, we’re ready to render. If not, work on your photography or go back and fix your control points and re-optimize again.

9. Click the Create Panorama button and tell it where to save your render. Now go do something else, or if you’re like me then you’ll sit there mentally urging the status bars to move faster!

Convert

Using this process, PTMac output a finished TIFF suitable for printing (you’ll probably want to do some cropping however). If you’re looking for an interactive panorama, you will need to convert to QuickTime or another similar format using an appropriate tool. For converting equirectangular TIFFs to QuickTime movies on the Mac, CubicConverter is the best tool there is.

WRAPPING IT UP
I spent a lot of bytes walking you through this process, so I hope you got reasonable results your first time out but if you didn’t, don’t despair! Panoramic stitching is an art as much as the photography itself; it takes time, practice, and perseverance to get professional results. In this tutorial I hoped, more than anything, to give you a template for a process that will ultimately lead to success, but if you want instant results you might have latched on to the wrong medium. Given time, you’ll evolve beyond this process, gradually realize where I cut corners or outright avoided mentioning things, and eventually come up with something much better. This was a first dip, not a swim across the Atlantic!

CHEAT SHEET

1. Use XPoints to generate a PTMac project

a. Select an existing lens template (from a previous pano using the same lens) or manually enter the Horizontal Field of View of your images;

b. Set the Filter options; Use RANSAC if you don’t want a lot of stray control points; use Search Sequentially; use Cylindrical search if your panorama wraps 360 degrees around.

c. Click Start; when it’s done, save the file in the folder with your images.

2. Open the project file in PTMac

3. Optimize:
a. First optimize for FOV
b. Then optimize for FOV, A,B, and C
c. If the average control point distance isn’t acceptable, delete the worst control points and re-optimize. If you end up with less than 3 control points per overlapping image pair manually assign a few.

4. Setup your render
a. Use Equirectangular projection
b. Set the output size to the maximum
c. Use Enblend TIFF as your output file format
d. Use Poly 3 as the interpolator

5. Preview

6. If the preview looks good, Render!

Email: rogerhoward[at]mac[dot]com

Subscribe Newsletter
Send to a friend
Do you have an interesting story
you want to share with our readers ?
Drop us a mail
VRMAG Homepage
Join:
VRMAG's Yahoo group

Check out:
VRMAG's Blog

VRMAG recommends:

Tripod heads:
360Precision
Nodal Ninja

Stitcher apps:
Autopano Pro
REALVIZ Stitcher
PTGui Pro

VR player:
Krpano
Flash panorama player
SPi-V
Pure player for Java

Community projects:
World Wide Panorama
ViewAt.org

Translations, voiceovers:
Networks

Print Magazine:
Monocle




The purpose of this banner is to raise funds for a new VR community project VRMag will launch in a few months.



 

Homepage
- - Credits - Links - Blog - VRMAG Yahoo Group - RSS Feed

Previous Issues: 01 - 02 - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28

VRMAG archive: Feature Story - Hotlist - Column - Reviews - Day Trips

VArtist archive: Spotlight - Guest Artist - Gallery - Showcase - VR Industry - Community

The copyright of the images belong to the individual photographers. VRMAG is a publication of ©2008 VRWAY Int. All Rights Reserved.
Designated trademarks and brands are the property of their respective owners.

Other VRWAY publications: Arounder | Arounder Magazine | Panogames | Fullscreenqtvr | VPBrochure | VRBG