# The PanoramIX Authoring Tool

## Version 0.1.4.92, February 26, 1998

## 5.5 The AutoStitch Dialog

The AutoStitch dialog provides an automated means of finding the optimal alignment of adjacent side images. This dialog also provides similar means for aligning top and bottom images with the sides of a panorama. The image shown here represents the AutoStitch dialog for side images. An example of an AutoStitch dialog for a top or bottom image is shown below.

The AutoStitch dialog contains the following sections:

a. Image Identification and Selection,
b. Pattern Matching Controls,
c. Progress Bar,
d. Pattern Matching Functions.

The principal results of the AutoStitch are seen in the main window where one can observe the improvements in image alignment. More detailed information concerning the effects of the AutoStitch operations can be seen by opening the EditImage window and the Edit Sides, Edit Top, or Edit Bottom dialog.

Back to AutoStitch Dialog

Back to the Options Menu

Back to PanoramIX Authoring Tool

### 5.5.1 Image Identification and Selection

The upper portion of the AutoStitch dialog contains fields for identifying and selecting an image to be aligned. The Previous and Next buttons allow one to step backward and forward through the list of raw images comprising to current panorama. The Image number field identifies the position of the current image within the raw image list. One can jump directly to any member of this list by entering its image number in this field. The name of the image file from which this raw image was loaded is displayed in the Name field.

The Type field indicates whether the currently selected image is a top image, bottom image, or side image. The AutoStitch functions are not supported for panoramic images or sprites. In the case of a side image, the AutoStitch function will attempt to match the left side of the selected image with the right side of the preceding side image. In the case of a top image or bottom image, the AutoStitch will compare the overlapping areas of the top or bottom image and the cylindrical panoramic image created by stitching the sides images together.

The Diff field displays the value of the difference between the patterns found in the current image and the corresponding portion of the previous side image. The object is to minimize the value shown in the Diff field. Initially, this will not have a numerical value because this value is unknown until the first pattern matching test has been made. This value is currently based on the absolute value of the differences between the R, G, and B color values for the corresponding pixels in the overlapping portions of the adjacent images.

The value shown in the Diff field may run from zero to 255, where zero indicated a perfect match. Ideally, the value in the Diff field will be reduced to zero when the best match is found. In real situations, a perfect match is never possible. Values up to about 16 generally imply very good matches. Values in the range of 16 to 32 tend to be good matches, and values of 32 to 64 represent fair matches. Values greater than 64 may indicate relatively poor matches.

The Diff value depends on the relative exposure values for the images being compared. Large changes in exposure can cause Diff to have a very large value. In such cases, the value of Diff can be reduced by a large amount by balancing the exposures either manually or automatically after aligning the images. In most situations, it is best to align the images, balance exposures, then re-align and re-balance until no further changes are obtained.

Back to AutoStitch Dialog

Back to the Options Menu

Back to PanoramIX Authoring Tool

### 5.5.2 Pattern Matching Controls

Below the image selection and identification fields, there are five fields that control the pattern matching operations. The first two fields determine the ranges of horizontal and vertical alignment shifts that will be searched for the best match. These values are centered on the Horizontal shift and Vertical shift values indicated in the alignment box in the Edit Sides dialog. For example, if the value of the Horizontal shift for the current image is 3 pixels, and the Horizontal Search Range in the AutoStitch dialog is 9 pixels, then the pattern matching tests will be performed for all values of the Horizontal shift from -1 to 7 (that is, 9 values centered on 3).

In the case of an AutoStitch dialog for a side image, the next two fields control the size of the pattern area to be compared in the two images. The first of these specifies the number of columns to be compared. This set of columns is centered about the left alignment edge of the current image, as shown by the left vertical line (for Elevation of zero) or left diagonal line (for non-zero Elevation angles) in the Edit Image window. The contents of these columns will be compared to the contents of the corresponding columns on the right side of the preceding side image.

The second field of this pair specifies the number of pixels to be tested in each column. The default value corresponds to half of the column size. Reducing this value has the effect of restricting attention to the central portion of each column where lens distortion and elevation changes have the least effects. Increasing this value increases the dependency on pixels with high and low elevation angles where lens distortion and camera elevation variations can have greater effects.

In the case of an AutoStitch dialog for a top image or a bottom image, the first field following the horizontal and vertical shift ranges specifies the range of rotation angles to be searched. The following field is not used.

The rotation angle specifies the rotation of the top or bottom image about the center point defined by the horizontal and vertical shift values. This angle is defined in steps corresponding to individual columns in the panoramic image. Each column corresponds to an angle in degrees given by ``

    angle = (180 degrees)/(pi*radius)

where "radius" is the radius of the panorama indicated in the Edit Sides dialog or Edit Panorama dialog.

The last field in this set specifies the maximum number of alignment cycles that may be performed in order to find the best match. If the range of values to be tested is greater than 2, and the best match is found on either extreme (min or max), then the search is repeated from this point until the number of searches reaches the value specified in this field, or a best match is not found on an extreme value.

In the case of a side image, if the horizontal or vertical shift values found for the best match differ from their initial values, then the panorama and all windows are updated. In the case of a top image or a bottom image, if the horizontal or vertical shift values or the rotation angle found for the best match differ from their initial values, then the panorama and all windows are updated.

Back to AutoStitch Dialog

Back to the Options Menu

Back to PanoramIX Authoring Tool

### 5.5.3 Progress Indicator

The pattern matching searches may require a long time to complete. The progress bar provides an indication of the fraction of the current alignment cycle which has been completed. The progress bar is currently supported only for top and bottom image alignment and shows nothing for processing of side images.

Back to AutoStitch Dialog

Back to the Options Menu

Back to PanoramIX Authoring Tool

### 5.5.4 Pattern Matching Functions

The bottom row of the AutoStitch dialog contains four buttons: labelled OK, Align, Align Ends, and Align All.

The OK button closes the AutoStitch dialog, retaining the updated parameters.

The Align button searches for optimal horizontal and vertical shift values for the currently selected side image with respect to the previous side image. In the case of a top or bottom image, this function also searches for an optimal image rotation angle.

The Align Ends button compares the current side image to the preceding image and determines the horizontal and vertical shift values needed to align these images. Instead of shifting the current image to match the image to the left, the horizontal and vertical displacement values are used to adjust all of the images to compensate for these values. The vertical displacement value is converted to a skew value which is applied to all side images to bring the previous image into correct vertical alignment with the current image. The horizontal displacement value is used to adjust the "radius" values and field of view values for all images to bring the previous image into correct horizontal alignment with the current image.

The Align Ends button should not be used on partial panoramas covering less than 360 degrees.

The Align Ends button has no effect for top or bottom images.

The Align All button is equivalent to performing the Align function for all pairs of adjacent side images except for the current/previous pair, followed by an Align Ends operation on the current image. For example, if the images are numbered 1 through 10, and the current image is image number 4, then the Align All function is equivalent to performing the Align operation on images 5, 6, 7, 8, 9, 10, 1, 2, and 3, in that order, followed by Align Ends for image 4.

The Align All button has no effect for top or bottom images. The Align Ends portion of the Align All operation is performed only for complete 360 degree panoramas. This is not performed for partial panoramas covering less than 360 degrees.

In the case of a complete panorama, the Align All function can start at any side, wrapping all the way around the scene and returning to the initial image for the ultimate Align Ends operation. In the case of a partial panorama covering less than 360 degrees, the last image cannot be aligned to the first image because these images do not meet or overlap. In this case, the Align All operation should normally start from the first image and end at the last image.

Back to AutoStitch Dialog

Back to the Options Menu

Back to PanoramIX Authoring Tool

Last modified February 27, 1998.
wluken@watson.ibm.com