Project 3 - Auto-Stitch

Ariel Schwartz (als364) & Luke Johnson (lrj34)

Design and issues

We ran into several issues while coding this project. We will try and break them down to give breif explanations of what we did, what went wrong, and what did work.

BlendImages:

When it came to testing our code crashed when trying to blend images using AccumulateBlend. Through debugging we found that inverse warping was calling pixels outside of the individual image boundaries. Looking further we saw this was caused by calculating the size of the acc image that was passed in. The bounding boxes were not calculated correctly for the entire mosaic. However, even after fixing this, we were having the same issue. After reading through the comments, we found that they were misleading. The acc image that was passed into AccumulateBlend was not a portion of the mosaic, it was the entire mosaic itself, the bounds being larger than the individual images. We confirmed this with the professor, but at that point we had very little time to try and fix it. We were able to get it working without crashing, but there were still some artifacts and unwanted visual effects.

AlignPair:

When calling alignPair from the commandline, the output homography was in the form of -1.IND000 throughout the homography. This is normally a division by 0 error and can result if incorrect or integer division isn't checked properly. We originally though the issue was caused by computeHomography not returning the correct values or calling the incorrect locations. We tried several versions of calling the VMatrix from svd, verifying that we were referencing the correct columns, the correct values, and that the values were not zero; none of these solved the problem.We did find something that may have attributed to it: The homography printed at the end of the call is the value of M after the alignPair function is called. This was never made apparant in the notes or comments that M was called outside of the function. Even so, changing the code to set the final value of M still resulted in the -1.IND000 error. We were unable to get this problem working despite having the professor and the TA verify the code with us. Because of this, our code was unable to create mosaics and we had to use the solution executable with our images (more on that later).

WarpImage:

Warpimage was the first function we coded that ended up working correctly. Working with the test files provided, we could warp the image to an identical copy. This didn't take much time and allowed us to focus on the rest of the code.


Example Panoramas

Test Sequence

This is the test sequence generated from the solution code. Note that this is how it is supposed to look. As stated above, our code does not work. We could not create panoramas because we could not get the alignPairs function to work correctly. This was generated using the Panorama solution code.

See full image here.

Custom Sequence

This is our custom sequence of photos taken from inside a room in Risley hall. It was generated with the solution executable provided for us. However, as you notice, there are blending errors and artifacts. Some of the images don't line up correctly or are missing all together. You may have to reload the webpage if the applet below does not load properly.

See full image here.

When we tried making this panorama using the solution code, calling alignPair would give us some strange values. Nothing too weird, except that for one set of pictures, it returned an identity matrix! We tried creating the warp, computing features, and creating the match files twice to make sure (on separate computers). We verified the focal length was correct for our blending by looking it up on the camera's website. For some reason, despite the images being completely different and overlapping slightly, calling alignPair produced an identity matrix with the matching file. We tried continuing on to make the panorama anyway, finding the values for the rest of the images and creating a pairslist.txt file out of them. However, calling blendPairs with this file cause the solution code to crash! We honestly don't know what happened here, we've tried doing everything as described on the webpage and in the instruction folders, sadly this was the best we were able to make. By removing the last three images from the pairslist.txt file, we were able to apply the blendPairs and create a semi-done panorama.

Test Sequence using Homographies

Finally, here is the first four images of the test sequence created using the original images and alignPairHomography. As you can see, it's not very effective to use this method as it results in some interesting..."warping"...