Project 2 - Panoramas

1 — Supplied Test Image Panorama

CSE Pano Small

The stitching of these class test images was fairly straight forward, thanks to the use of pure rotations between images and pre-computed focal length and radial distortion coefficients. The images do display large exposure differences because the camera parameters were probably left on auto (i.e. ISO, shutter-speed and/or aperture). I did not do anything in my code to correct for changes in exposure, primarily because I know that digital cameras lack the exposure latitude (e.g. brightening the dark images results in noise; darkening the light images would not bring back clipped highlights).

It was interesting how my strategy for feature detection and mapping changed between the first and second project. For the first assignment I had been concerned with keeping false-positive matches to a minimum while increasing true positives. This led me to favor a high harris-feature threshold and larger local-maxima windows. For the second project I found that RANSAC was more forgiving of false positives and the agreement process would always pick a good translation if given even just 6 match translations in agreement.

One thing that was unfortunate about the warping technique was that it left black borders around the image. These triggered harris features very easily, and worse yet, they could cause multiple matches that would point towards a (0.0, 0.0) translation. The highest agreement I saw for this was 4 (perhaps for the 4 corners of the image: two sky to black corners and two grass to black corners). Lastly, I suspect that the ratio test was not necessarily a benefit when using RANSAC. I found it better to have more matches than to try and maximize the true to false positive ratio.

2 — Hand-held Panorama

GasWorks HH Small
Gas Works Park

This image was shot with a Canon A650 using the stitch-assist mode. Although I did not use a tripod, I did try to rotate around the front of the cameras lens, and the stitch-assist helped by showing when I might run into parallax problems (e.g. when I moved the camera enough that background and foreground object couldn't both be matched up at the same time). I also used a bubble level to minimize drift. The most obvious blending problem occurred where the first and last image overlapped, which is probably to be expected.

As in the first panorama, there are some issues with highlight clipping in the sky. I was able to lessen this affect by exposing the first image - which locked the white balance and exposure for subsequent shots - towards the sun. This in turn meant that many portions of the images were quite underexposed, but these were brought up in preprocessing using Adobe Lightroom's 'Fill Light' control and on the final image in Photoshop using the Shadow/Highlight adjustment.

I had hoped to be able to use the Panotools distortion coefficient database to use someone else's equivalent of the k1 and k2 parameters for this particular camera, but it appears that many of the databases are now encrypted. Panorama Tools uses 3 parameters (a, b, c) for the equation:

a*r^3 + b*r^2 + c*r = 1

The b term would have corresponded to our k1 term; this is also the single term that Adobe Photoshop uses with its lens correction filter.

3 — Panorama using Spherical Tripod Head

UW Quad Pano Small
University of Washington Quad

All of the stitched panoramas were programatically cropped on the left and right edges. The top and bottom edges have been left uncropped, and these edges give clues about the accuracy with which the individual images were captured. It might be surprising that there is more vertical discrepancy apparent in this image, which was taken with a spherical tripod head, than with the one taken handheld. The reason for this is that I shot this panorama from the top of a 12 foot ladder placed in the middle of the UW Quad using my spherical tripod head on top of a ball head and 2-axis bubble level attached to the bottom. This setup allowed me to forgo the tripod legs, get 30° click stops and close to pure rotation from the spherical tripod head. The area in the center where the images start to dip was the direction in which I was standing on the ladder and therefor had to duck in order to not be in the image. I tried using the bubble level to avoid unwanted rotation but still introduced some despite this.

I shot the images for this panorama before realizing that warping algorithm assumed images were taken with the optical axis of the camera pointed at the horizon. In order to get the composition I desired, I had tilted the camera above the horizon using the vertical rotation arm. In order to push this panorama through, I used PTMac, a derivative of the open-source Panorama Tools developed by Helmet Dersch. I manually set point correspondences in order to calculate the focal length, distortion parameters and perspective correction necessary to create warped versions of the 16 source images. After creating these warped images I used the alignPairs and blendPairs steps of my code to put the panorama together. If this image had only required radial distortion correction and rectilinear-to-spherical remapping, I could have used the same sphrWarp function I used for the previous two panoramas. But these images perspective correction was necessary in order for translational alignments for the bottom parts of the image to agree with alignments for the top parts of the images.

Another limitation of not fixing the tripod head's position on the ladder was that a couple of images overlapped more than the click-stop spaced ones. The caused blurring artifacts with the blending hat function since it was averaging over a wider field of view than normal. A better algorithm have been to calculate where weights are equal with one set of hat function and then use this location as the ideal, constant width hat function peak for blending. Then having extra overlap would not be penalized with visual artifacts.

This image displays the best control over highlight rendition of the panoramas. This image clearly shows the benefit of shooting with a fixed lens on a digital SLR shooting in RAW mode. The images were exposed for the skies, dramatically underexposing the trees, buildings and grass. But the RAW file allowed for much greater shadow lightening than the Canon point and shot, compressed JPEGs.