Project 2: Autostitch

Ji Hoo

 

 

 

Overview

 

I basically implemented Autostitch Vanilla! (as per Project 2 description)

 

 

 

Some Numerical Results

 

Here are some alignment results from the benchmark images as proof of near-correctness.

 

stitch2:

Mine:

(-208.00 -5.00)

Sift (provided):

(-207.92 -5.18)

 

stitch4:

Mine:

(-208.00 -5.00)

(-209.00 -4.00)

(-209.00 -5.00)

Sift (provided):

(-207.92 -5.18)

(-208.66 -3.48)

(-209.00 -4.84)

 

 

Visual Results

Click on picture for high resolution version.

 

1. Test Sequence

panorama viewer!

Test sequence.

 

 

2. Kaidan Head: Gas Works Park

panorama viewer!

A panorama of Gas Works Park with the Kaidan tripod.

 

 

3. Hand Held: Gas Works Park

panorama viewer!

Canon’s Stitch

Panorama from a hand-held sequence. Halfway through, I realized that I have lowered the camera significantly; the mid-way compensation that I tried to make is pretty obvious.

 

 

4. Hand Held: Gas Works Park V2

panorama viewer!

Canon’s Stitch

The sequence for this stitch is taken from the same spot as the above. There is some misalignment.

 

 

5. Kaidan Head: Gas Works Park V2

panorama viewer!

This panorama is near perfect!!

 

 

Discussion

 

Proximity to Objects

My earlier panoramic picture sequences were all unsuccessful. I realized that when taking the picture sequence, it is important to be far away from objects that occludes large portions of your pictures. Objects (features) further away are less susceptible to excessive variations from a shot to the next, thereby making it easier for the feature matcher.

 

 

My Script

This is the sample content of the MS-DOS .bat files that I use to create my panoramas:

echo Camera Tag: CS30012716  f = 678.21239  k1 = -0.21001 k2 = 0.26169

echo off

 

Panorama sphrWarp gasworks_00.tga warp_gasworks_00.tga 678.21239 -0.21001 0.26169

Panorama sphrWarp gasworks_01.tga warp_gasworks_01.tga 678.21239 -0.21001 0.26169

                                                                                     \\

Panorama sphrWarp gasworks_20.tga warp_gasworks_20.tga 678.21239 -0.21001 0.26169

echo warping done

 

Features computeFeatures warp_gasworks_00.tga warp_gasworks_00.f

Features computeFeatures warp_gasworks_01.tga warp_gasworks_01.f

                                                                                     \\

Features computeFeatures warp_gasworks_20.tga warp_gasworks_20.f

echo feature computation done

 

Features matchFeatures warp_gasworks_00.f warp_gasworks_01.f 0.8 match0001.txt 2

Features matchFeatures warp_gasworks_01.f warp_gasworks_02.f 0.8 match0102.txt 2

                                                                                     \\

Features matchFeatures warp_gasworks_19.f warp_gasworks_20.f 0.8 match1920.txt 2

echo feature matching done

 

Panorama alignPair warp_gasworks_00.f warp_gasworks_01.f match0001.txt 200 1 > pairList_x.txt

Panorama alignPair warp_gasworks_01.f warp_gasworks_02.f match0102.txt 200 1 >> pairList_x.txt

                                                                                     \\

Panorama alignPair warp_gasworks_19.f warp_gasworks_20.f match1920.txt 200 1 >> pairList_x.txt

echo alignment done

 

Panorama blendPairs pairlist.txt stitch_gasworks.tga 200 > debug.txt

echo blend done

 

My default configuration is to use ratio-test matching (indicated by ‘2’ at the end of each matchFeatures command), and a RANSAC outlier threshold value of 1 pixel. For the most suitable of panoramic sequences, each command of alignPair will return two non-zero numbers. When a certain alignPair result is returned as (0.00, 0.00) it indicates that the program cannot find a valid alignment under the given outlier distance threshold.

 

For these pairs, I would then match their features using matchFeatures with the SSD option, for example:

 

Features matchFeatures warp_gasworks_01.f warp_gasworks_02.f 0.8 match0102.txt 1

 

The SSD feature matching algorithm predominantly returns a lot more feature matches than the ratio-test option, and gives the aligner a larger set of matches to work with. Should alignPair now return valid alignment information for the pair in question, I would then update the alignment values to pairlist.txt which is used to stitch and blend the images together. Should the alignment remain unsuccessful, I will incrementally increase the RANSAC outlier distance threshold value for the particular problem-pairing, for example:

 

Panorama alignPair warp_gasworks_01.f warp_gasworks_02.f match0102.txt 200 2 >> pairList_x.txt

 

In the case, the outlier threshold is increased to 2 pixels. I will increment this value until valid alignment information is provided by alignPair.

 

However, with incremental loosening of the restriction on the outlier distance threshold, one would eventually get a non-zero alignment pair, which is obviously inaccurate (by inspecting the two pictures), such as (-0.15, 0.00). At this juncture, the outlier threshold is probably set to large values such as 5 or 6 pixels, and is a good indicator that the software cannot successfully align this pair of images. One could at this point accept the bogus alignment information, update pairlist.txt and proceed with the blending, or manually make a guess at the correct alignment requirement; both options are as good.

 

I chose the former, and examples of such occurrences can be observed as blurry/misaligned regions of panoramas 3 and 4. Due to the effect of poor lighting conditions (it was drizzling), and shaky hands, problem picture-pairs usually have a lack of contrast (in possibly meaningful areas) as well as rotation (my feature matcher is not too resilient against rotation). I linked two commercial grade stitches made using Canon A10’s software for comparison.

 

**Blast from the Past** 8 MB CompactFlash!

Camera 1 (CS30012716) came with an 8MB CompactFlash which translates into ~ 40 pictures. When you see someone working out of the trunk of his car, he’s either at the cutting-edge of technology – where convenient commercial electronics is not yet available –, or totally not. : )