Partial hand held panoramas with vertical lines, using manual stitching

John Strait
January 2007

This multi-step procedure can be used for multi-row, partial panorama (less than full circle) stitching of hand held photos when there are vertical lines visible in each row of the panorama.  Please be aware that this function was not specifically designed into The Panorama Factory V4. It is a pleasant surprise that it can be done at all and that it works so well.

Please note that this procedure requires V4.2 or newer.

This is a fairly lengthy process. As with all hand held stitching, it requires a certain amount of patience and attention to detail.

I have personally tested this procedure for 2 row panoramas.  I do not believe that it generalizes to more rows.


Step A -- Stitch the first row

In this step, you stitch the first row of images into a horizontal panorama.  This first row is used as the starting point for the full panorama.  It establishes the focal length and the horizontal axis of the panorama.  I recommend you start with the row that is closest to having tilt angle zero because it is the reference for all other rows.

  1. Start a new project and immediately Cancel the Wizard.

  2. Use the Import images... command (File menu) to import images for all rows into the project file and make sure they are arranged left to right in each row, one row after the other.

  3. Select the thumbnails in the first row (I recommend you start with the row closest to tilt angle zero) and choose the Stitch with the Wizard command (New image menu).

  4. Choose Manual photo stitching on Wizard 2/9.

  5. Select Automatically detect focal length and Correct barrel distortion on Wizard 3/9.

  6. I recommend not selecting any checkboxes on Wizard 4/9.

  7. Select Partial panorama and Spherical projection on Wizard 5/9.

  8. Place stitching points on Wizard 6/9 to stitch the first row of the panorama.  I recommend this procedure for placing stitching points:

    The images may become cockeyed as a result of the manual stitching.  This is caused by variations in camera tilt (pitch axis) and rotate (roll axis) from one image to the next.  This is normal.  We will correct it with the warping grid in the next step.

  9. Advance to Wizard 7/9.  In this step, you'll use the warping grid to correct the manual stitch to be level and square.  For more information about the warping grid, refer to the section "Wizard step 7/9 – Preview at low resolution" in Chapter 1 of the online help.

    When you first enter this Wizard step, it will show you the results of the manual stitch before applying the warping grid.

  10. Use the "vertical line method" as described in the section "Wizard step 7/9 – Preview at low resolution" in Chapter 1 of the online help to straighten the image.  It can be helpful to increase the Preview resolution to make it easier to see how the warping grid relates to the vertical line.  Increasing the preview resolution also slows down the program, so it is best to keep it at 50% or lower.

    Place a pair of handles (red dots) on vertical lines at the left and right ends of the image.  After placing the handles, click Apply warp.

  11. Examine the preview image.  After applying the warp, all vertical lines should be perfectly straight and plumb.   If not, adjust the warping grid until you are satisfied. There is no loss of image quality if you apply the warping grid multiple times because the image is recomputed from the original image data each time you rewarp.

  12. Advance to Wizard 8/9 and select Prepare for internet display and Maximum size.

  13. Advance to Wizard 9/9 to complete the stitch and click Done to exit the Wizard.

  14. At this point, you should see a stitched and cropped thumbnail in the upper pane and the cropped image in the lower pane.

  15. Choose the Properties command (Image menu).  Write down the W value from Image size (pixels) in the Image properties dialog box.  We'll need this value in a later step.  We'll refer to it as StepA_W.  Click Cancel to close the Image properties dialog box.

  16. Choose the Panoramic properties command (Image menu).  Write down the HFOV value from Horizontal field of view (degrees) in the Panoramic image properties dialog box.  We'll need this value in a later step.  We'll refer to it as StepA_HFOV.

  17. FOR THE BOTTOM ROW ONLY:  If you are starting with the bottom row, also write down the Below value from Vertical field of view (degrees) in the Panoramic image properties dialog box.  We'll need this value in a later step.  We'll refer to it as StepAB_Below.

  18. Click Cancel to close the Panoramic image properties dialog box.


Step B -- Stitch the remaining rows

In this step, you stitch the remaining rows of images into horizontal panoramas that are parallel to the first row.  If all goes well, these rows will match the spherical coordinate system of the first row.  Repeat these steps for all of the rows.

  1. Choose the Show imported images command (View menu) to display the imported thumbnails in the lower pane.

  2. Select the thumbnails for the row and choose the Stitch with the Wizard command (New image menu).

  3. This time, remove the checkmark from Automatically detect focal length and then choose I am certain of the focal length on Wizard 3/9. This guarantees all rows are stitched with the same focal length setting (the first stitch sets the Wizard value to the detected focal length).

  4. Advance to Wizard 6/9 and place stitching points on one image pair as you did for the first row.  As before, I recommend this procedure for placing stitching points:

  5. Advance to Wizard 7/9. As in the first row, you'll use the warping grid to correct the manual stitch to be level and square.  For more information about the warping grid, refer to the section "Wizard step 7/9 – Preview at low resolution" in Chapter 1 of the online help.

    When you first enter this Wizard step, it will show you the results of the manual stitch before applying the warping grid.

  6. Find the horizontal line you used as a reference in row 1.  Use the "horizon method" as described in the section "Wizard step 7/9 – Preview at low resolution" in Chapter 1 of the online help to place three handles (red dots) on the horizontal line. 

    I Place a pair of handles (red dots) on vertical lines at the left and right ends of the image.  You do not need to use the same vertical lines that you used for row 1.  Any vertical lines will do.  After placing the handles, click Apply warp.

  7. Examine the preview image.  After applying the warp, all vertical lines should be perfectly straight and plumb.   If not, adjust the warping grid until you are satisfied. There is no loss of image quality if you apply the warping grid multiple times because the image is recomputed from the original image data each time you rewarp.

  8. Advance to Wizard 9/9 to complete the stitch and click Done to exit the Wizard.  At this point, you should have a stitched thumbnail and a cropped thumbnail for each row in the upper pane.  The most recent cropped image should appear in the lower pane.

  9. FOR THE BOTTOM ROW ONLY:  When you stitch the bottom row (if it was not the first row you stitched), choose the Panoramic properties command (Image menu).  Write down the Below value from Vertical field of view (degrees) in the Panoramic image properties dialog box.  We'll need this value in a later step.  We'll refer to it as StepAB_Below.

  10. Click Cancel to close the Panoramic image properties dialog box.


Step C -- Rotate the cropped images 90 degrees clockwise

In this step, we rotate the cropped images 90 degrees to prepare them for row-to-row stitching.

  1. Select all cropped thumbnails at once. Click the first cropped thumbnail to select it and then hold the CTRL key while you click each of the other cropped thumbnails. After these clicks, you should be able to see that the cropped thumbnails are selected and the stitched thumbnails are not selected.

  2. Choose the Rotate command (New image menu).  Answer Yes if you are asked whether you want to apply the command to the group of thumbnail images.

  3. Under Image rotation, enter 90 degrees and select Clockwise.

  4. Select Fit rotated image.

  5. Click OK.  This adds the rotated thumbnails to the upper pane.


Step D -- Stitch the rotated rows together

In this step, we stitch the rows together.

  1. Note that the rows may in the wrong order.  They need to be in order from lower row to upper row for stitching.  To move a thumbnail, first single-click it so that only one thumbnail is selected.  Then click and drag the thumbnail to its new position.

  2. Select all the rotated thumbnails at once. Click the first rotated thumbnail to select it and then hold the CTRL key while you click each of the other rotated thumbnails. After these clicks, you should be able to see that the rotated thumbnails are selected and all other thumbnails are not selected.

  3. Choose the Stitch with the Wizard command (New image menu).

  4. Choose Manual document stitching on Wizard 2/9.  This stitching method joins the images without warping.  It is unnecessary to do any additional warping because the rows have already been converted to the spherical coordinate system.  This stitching method also permits the images to be different sizes.

  5. Advance to Wizard 4/7.  Surprisingly, you may not need to place any stitching points here!  Simply click the Next button and confirm that you want to advance to the next Wizard step.  You'll be prompted with a message box asking whether you want to advance with incomplete stitching points.  Click Yes.

    It is OK to advance without placing any stitching points.  This forces The Panorama Factory to perform automatic alignment on the images and usually produces the best results.  Placing stitching points carries the risk that the images may be rotated slightly during the alignment.  This is usually the right thing when actually stitching document scans, because it corrects for rotations of the document when placed on the document scanner.  However, in this multi-row procedure, we usually want to avoid any new rotation after the initial row stitches.

  6. Advance to Wizard 5/7.  Examine the preview image to be sure the stitch is accurate. You may need to adjust the preview resolution.  The default setting for preview resolution assumes you are stitching a normal panorama and it sometimes makes a poor choice here.  But in any case, do not set the preview resolution too large or this step will be very slow!

    If the stitch is not accurate, you should return to Wizard 4/7 and add stitching points.  We recommend that you only add one stitching point pair to each image pair.  A single stitching point pair defines the image-to-image alignment without introducing image rotation.

  7. Advance to Wizard 7/7 to complete the stitch and click Done to exit the Wizard.  You should see a new stitched thumbnail and a cropped thumbnail in the upper pane.  The cropped image is shown in the lower pane.


Step E -- Rotate the fully stitched image 90 degrees counter-clockwise

In this step, we rotate the fully stitched image back to its correct orientation.

NOTE: It is probably best to make manual adjustments to the stitched row images and the fully stitched image before starting this step.  If you see ghosts (faint double images), you can often correct them using the Fine tune command (Image menu) and/or with manual fine tuning.  For more information, refer to the section "Fine tuning the image alignment" in Chapter 6 of the online help, "Correcting stitching problems".  Sometimes ghost images cannot be eliminated with fine tuning, for example if an object (e.g. person or car) moved between the times you made two photographs.  You can sometimes remove these ghosts by adjusting the boundaries of the blending region.  For more information, refer to the section "Adjust blending region boundaries" in Chapter 4 of the online help, "Using the Classic interface, step by step".

  1. Double-click thumbnail of the fully stitched image to make it the current image shown in the lower pane.

    NOTE: You'll also see a cropped thumbnail in the upper pane, but we don't want to use this image.  The Wizard always crops the stitched image, but sometimes the cropping can introduce a small amount of image rotation.  This is usually the right thing in normal stitching (and, in fact, for the initial row stitches) because it corrects for small rotations that are left over after stitching.  However, in this multi-row procedure, we want to avoid any new rotation after the initial row stitches.

    So we double-click the stitched thumbnail.  The stitched image will display in the lower pane, with outlines superimposed on the image to indicate the image overlap regions.

  2. Choose the Rotate command (New image menu).

  3. Under Image rotation, enter 90 degrees and select Counter clockwise.

  4. Select Fit rotated image.

  5. Click OK.  This adds the rotated thumbnail to the upper pane and shows it in the lower pane.


Step F -- Assign panoramic properties to the rotated image

This step completes the stitched image by marking it as a panorama.  We have to be very careful here to compute and enter the correct values because this defines the panoramic coordinate system of the final image.  If the values are incorrect, subsequent perspective cropping and/or conversion to VR formats (QTVR, PTViewer, IVR) may produce less satisfactory results.

  1. Double-click the thumbnail of the final rotated image to make it the current image.  Actually, if you have not clicked anything on The Panorama Factory’s window, the final rotated image should already be the current image.

  2. Choose the Properties command (Image menu).  Write down the W and H values from Image size (pixels) in the Image properties dialog box.  We'll refer to these values as StepF_W and StepF_H.  Click Cancel to close the Image properties dialog box.

  3. Choose the Panoramic properties command (Image menu).

  4. Select This is a panoramic image under Panoramic image.

  5. Compute the horizontal field of view:

    HFOV = StepF_W * StepA_HFOV / StepA_W

    Enter this value as HFOV under Horizontal field of view (degrees).

  6. Hit the Tab key on your keyboard to complete the HFOV value.  This will cause The Panorama Factory to calculate the total vertical field of view and display it as VFOV under Vertical field of view (degrees).  Write this value down.  We'll refer to it as StepF_VFOV.

  7. The Panorama Factory assumes that the panorama is symmetric above and below the horizon, which is not usually true for this type of panorama.  So we have to correct the vertical field of view to be asymmetric.  Remove the checkmark from Vertically symmetric under Vertical field of view (degrees).  This will let us enter individual values values for the field of view above and below the horizon.

  8. Enter the StepAB_Below value as Below under Vertical field of view (degrees).

  9. Compute the field of view above the horizon:

    Above = StepF_VFOV - StepAB_Below

    Enter this value as Above under Vertical field of view (degrees).

  10. Hit the Tab key on your keyboard to complete the Above and Below values.  This will cause The Panorama Factory to recalculate the total horizontal and vertical fields of view from Above and Below.  These should be very close to the StepA_HFOV and StepF_VFOV values.  If they're very much different, recheck all of your calculations.

  11. Click OK.


Step G -- Crop the image

In this step, we crop the rotated image to remove extraneous white space.  If we want to, we can simultaneously flatten the perspective.

  1. Choose the Crop command (New image menu).

  2. Set cropping parameters as you wish, or keep the defaults.  If you have gotten everything right, the Perspective correction option should create a conventional image that preserves straight lines.  You should not use perspective correction if you plan to display the image in a VR viewer.

  3. Drag the boundaries of the cropping region to enclose the part of the image you want to keep.

  4. Click Approve.


Step H -- Sharpen the image if desired

This is the time to sharpen the image if you wish.

  1. Choose the Sharpen command (New image menu).

  2. Set sharpening parameters as you wish, or keep the defaults.

  3. Click Approve.


Step I -- Save or print the finished image

Finally, save or print the image.  You can save as JPG, TIF, PNG or BMP if you just want to show it as a simple image or you can export to PTViewer or IVR format if you want to display the image in a VR viewer.  I recommend exporting in PTViewer format. You can also use IVR, but it’s hard to find the IVR viewer these days. You cannot use QTVR because this example uses spherical projection and QTVR does not support spherical projection.


Revised: January 10, 2007

© 2007 Smoky City Design, LLC and John Strait