Stitching handheld panoramas with Panorama Tools - part 1

Helmut Dersch's Panorama Tools facilitates greatly the stitching of handheld panoramas. A variety of lenses, panorama stitching methods and picture-taking strategies can be employed with Panorama Tools but this tutorial concerns itself with handheld panoramas captured with a 16mm full frame fisheye on a 35mm standard film-based camera and stitched by hand using Photoshop and Panorama Tools. This first part just deals with "single-row" stitching. Additional work is needed to complete a fullview panorama by inserting extra shots taken directly up and down. This extension of this technique will be covered in the second part of this article.

For the panorama in this tutorial approximately 12 shots were taken with a 16mm Nikkor and the images scanned. The main panoramic sequence consisted of 8 vertical-format shots handheld at roughly 50 degree intervals. Pan angles were judged just by ensuring there was plenty of overlap between the frames. The camera was levelled for these shots by looking sideways - as the shots were taken - at a bubble level on a bracket screwed into the base of the camera . An attempt was made to revolve around the position of the rear nodal point of the lens in the taking of the pictures.

First I scanned all the images (Fuji400Superia) on a Nikon scanner with a film strip attachment. This does not locate the frames precisely and also crops the negative area about 5 percent so for repeatability I scan the negatives with the bottom of the frame showing in each scan. Each image was scanned using the maximum scan area using 50% maximum scanning resolution (1350dpi).ie each image was 1296 pixels wide and 1947 pixels high. Reduced to 10% for web purposes the eight images of the main sequence look like this:

Note the thin black line at the bottom of each image frame corresponding to the negative image border. Next I crop each image with the Crop tool just to that black line i.e. the bottom of the actual image area. Now the images will have different heights so I resize them with the Canvas tool so that I make each image 1926 pixels high (This corresponds to the full image area height if I had manged to scan it all.) Now my images look like this:

If the scanner scanned just the actual negative image area these above steps would not be necessary. But with these steps we now have a more or less consistent scanning of the negatives. Each image is now 1296 pixels wide and 1926 pixels high.

We can start on warping the images so they can be joined into a single panoramic image.

First warping step is to "correct" each image so that the image geometry corresponds to that of an "ideal" fullframe fisheye lens. For this we use the Correct tool in Panorama Tools:

Choose Panorama Tools

Choose Correct

Check "Radial Shift"

Click Options - fill in the a, b, c, d values for each color (they will be the same for each color here). For my lens from a previous calibration process I use the following values: a = -0.16 b = 0.49 c = -0.53 and d = 1.2 (Under preferences check "Save fullsize result to file" "Open result with Application" and set the application path to where you have Photoshp.exe) (Under More check Polynomial)

Apply the Correct tool to each image in turn. The results are as follows:

Note the effect of the Correct tool is rather subtle in this case.

Next step is to "square" each image with the Canvas tool so now we have 8 square "corrected" "Full frame fisheye" perspective images each 1926 pixels by 1926 pixels corresponding to a HFOV of 136 degrees and a VFOV of 136 degrees (I know the FOV from the earlier calibration process). (There are blank areas at the sides of each image).

Now we use the Remap tool in Panorama Tools to convert these square full frame fisheye perspective images to "PSphere" perspective images. We leave "Prefs" and "More" as before and set Convert from to "FF fisheye" , Convert to to "PSphere" and VFOV and HFOV to 136. Applying the Remap tool to each image in turn we get 8 new square images the same size as the originals. These will be joined to make the final panorama and they are a little large so at this stage we use ImageSize to resize each image to 60% giving the following:

We can see that now the images look like they might join up. We now have 8 PSphere perspective images each 136 degrees by 136 degrees each 1156 pixels high and wide (60% of 1926). Now we take any of the 8 images. This image will be the "wrap" image ie. the one where the panorama will "wrap around" on itself. This has to be split into 2 parts to make the ends of the final PSphere panorama image. So we Select approximately 50% of the right side of the chosen image - this will be the left end of the panorama -and copy and paste this selection into a new image then and use Canvas Size to size it thus: 1530 pixels high by 3060 pixels wide: It then looks like this:

So where did these numbers come from? We want to make a final PSphere image which is 360 degrees wide and 180 degrees high. With PSphere images angle is proportional to image size for a given image. So we can convert our selection from our chosen PSphere component image into an image 180 degrees high by expanding its height to 1156 by 180/136 ie 1530 pixels high. Then to make it 360 degrees long we have to have a length of 2 times 1530 ie. 3060 pixels.

Now we go back to the chosen "wrap" image which should still have an active Selection. Go Select-Inverse and Copy/Paste/Flatten this selection into a new image. Use Canvas Size to make it 1530 pixels high (180 degrees. (Make a mark in the right hand bottom corner) It will look like this:

Select all this new image and copy and paste it into the 360 by 180 PSphere image at the other end. Nudge the Layer until it sits exactly at the end and bottom - that's what the mark is for. Flatten and your wrap is complete and the panorama now looks like this:
Now it is necessary to Copy and Paste sections of the remaining component PSphere images to complete the panorama. This will require some use of the Transform tools in Photoshop. Occasionally small sections will be needed to be Copied and Pasted. It helps to save your pano often.. Then "Erase to saved" can be used to blend in new sections. Here are some progress snapshots:

When the middle is reached and there is only one component image to be added it often happens that it seems too narrow or too broad to fit. Rather than stretching this image to make it fit the panorama it is often better to stretch one or both of the image sections at each end of the panorama instead.

If only a cylindrical vr scene is desired the panorama can be vertically cropped at this point and used directly in Photovista to make a Zoomit cylindrical scene. To use the cropped panorama in Quicktime VR authoring applications requires a final use of the Remap tool in Panorama tools to convert the cropped PSphere to QTVR (Cylindrical) perspective - thus if the cropped panorama is say 1062 pixels high (and still 3060 pixels wide) then that means we have now a vertical angle of 1062/1530 times 180 degrees ie. 125 degrees. So now we use the Remap Tool to convert from the 360 degrees by 125 degrees PSphere image to a 360 degrees by 125 degrees QTVR image. This will expand the image vertically so now it is 1868 pixels high. A 3060 by 1868 panorama is a little large for a web QTVR so we resize it to 2400 (by 1465) pixels. Normally it is a good idea with QTVR source images to make them divisible by 24 so we crop the height to 1440 with the Canvas tool. So our final QTVR source image is 2400 pixels wide and 1440 pixels high. Apply an Unsharp Mask and we are done. Here is the QTVR pano and the source image looks like this:

part 2
Copyright: Peter Murphy 1999