Computer Vision (CSE 455), Autumn 2012

Project 2: Panoramic Mosaic Stitching

Assigned: Thursday, October 11th, 2012

Due: Wednesday, October 24th, 2012 (by 11:59 pm)

Artifact Due: Thursday, October 25th, 2012 (by 11:59 pm)

Project Head TA: James Gray (send your questions here first!)

Project Secondary TA: Avanish Kushal

Before you start

  • Sign up to borrow a panorama kit - equipment and slots are limited. Pick-up and return in CSE 266.
  • Since this is a group project, use comments to document who wrote which portion of the code.

Turn-in Details

  • See the turn-in procedure for info how to upload your submissions. Be aware of the code and artifact deadlines.
  • You must nominate one of your panoramas for voting by placing a high-resolution copy at artifact/voting.jpg.
  • To claim extra credit, your write-up should list and explain each item that you want to be credited for.

The only files you should put in your turnin folder are files that you created or modified. Do not turn in any skeleton files, Visual Studio files, or provided image sets.


The expected structure is:


    student-folder
              |
              ----turnin
                      |
                      |-----source  
    contains only: .cpp and .h files which you modified or created
                      |
                      |-----binary  
    contains only: your .exe file(s), compiled in Release
                      |
                      `-----artifact
    contains one image file named voting.jpg for artifact voting
                                        contains one hypertext file index.html documenting your project, and optionally a .css file
                                        contains any image files needed in .png, .jpg, or .gif format
                                        contains any other project-specific files (e.g. the panorama viewer applet)


You can add a README file to any of the above if there is information we should know for grading - but consider whether it is better addressed via comments in your source code or via your write-up in the artifact.


There should be no other folders present beyond those above, which are created for you.


Some WYSIWYG HTML generators (Microsoft Word) will add an extra folder of "resource" files. These are permissible, but we strongly recommend that you look at other editors. As a CS student, you can get a free copy of Microsoft Expression Studio through the department's Dreamspark membership ("Expression Web" is the relevant component). If you need a non-Windows editor, try KompoZer (open source, runs on Linux and Mac OS, less refined GUI, not as good at producing clean and compatible source). See your TAs during office hours if you need additional help with web authoring.


If you do extra credit extensions:

  • Consider turning in multiple binaries, one "basic" and one or more which add the extra credit item(s).
  • If we need to do extra tests of your binary to confirm that the extra credit works, add a README to that folder.
  • In your write-up, have a header / sub-section for each extra credit item you want to claim.
  • For each, explain what you did and show off any image or data artifacts which it produced.

Common Problems

  • Coordinate with your partner early and often. Both project components must work in order to complete your panoramas.
  • When taking photographs, be aware of potential issues like lighting differences or regions which won't generate good image features.
  • Make sure the camera is set to panorama mode, that the Kaidan tripod head is centered, and that you have sufficient overlap between frames.
  • Bring a laptop and attempt panorama stitching at or near your shoot location, so you can determine right away if you need to take more pictures.

Artifact Voting

  • A link to the voting page will be posted after the artifact deadline. For now, take a look at some previous winners for inspiration.

Overview

In this project, you will write software which combines a series of photographs into a 360° panorama. Your software will detect useful features in the images, find the best matching features in your other images, align the photographs, then warp and blend the photos to create a seamless panorama. You will be able to view the resulting panorama inside an interactive web viewer.

"The Ave Panorama" by David Tepper and Jeremy Kallman, CSE 455 Winter 2008 (full size, 360° viewer)

This project can be thought of as two major components:

  1. Feature Detection and Matching
  2. Panorama Mosaic Stitching

To start your project, you will be supplied with some test images and skeleton code you can use as the basis of your project. Because this project is more extensive you can work in groups of two. Each component will result in an executable which you will use via the command line and appropriate arguments (features.exe and panorama.exe). Calling these in the correct order with reasonable arguments will allow you to generate your panorama. More detailed descriptions of these can be found in the Features and Panorama sections.

Project Files

The following files are available for download. Alternately, you can have one with everything.

We have also added a .bat script which demonstrates running all commands except blendPairs for the test set, and a pairlist.txt file for the same set which includes the expected alignPairs results for the pano test set. Note that the .bat script assumes that it, features.exe, panorama.exe, and the target images are all present in the same folder. Here is a second .bat script (one command) that demonstrates using blendPairs, for which the pairlist file must also be present.

If you're unfamiliar with .bat scripts, it's a text file containing line-delimited console commands. You can open it in Notepad or another text editor to see what's going on. It can be helpful to execute them from within a terminal session so that the execution window stays open after the script runs (Start+R, enter cmd).

You may also want to install IrfanView. This program is very helpful for opening and transcoding image formats (among other things). This article on its batch conversion feature may be helpful when converting your photographs to .tga format. (Photoshop users: be aware that it does some sanity checking when opening files which may fool you while debugging, specifically about whether your alpha channel is correct.)

Getting Things to Run

The steps required to complete the panorama are listed below:

Step EXE
1. Take pictures on a tripod (or handheld)
2. Warp to spherical coordinates Panorama
3. Extract features Features
4. Match features Features
5. Align neighboring pairs using RANSAC Panorama
6. Write out list of neighboring translations Panorama
7. Correct for drift Panorama
8. Read in warped images and blend them Panorama
9. Crop the result and import into a viewer

Although this is the final order of operations, you can complete Features.exe and Panorama.exe in parallel and test on other images.

Running the sample solution

Features.exe and Panorama.exe are command line programs that requires arguments to work properly. Thus you need to run it from the command line, or from a shortcut to the executable that has the arguments specified in the "Target" field of the shortcut properties. The one exception to this is that running Features.exe without command line arguments opens up the UI.

Running from the command line

To run from the command line, click the Windows Start button and select "Run". Then enter "cmd" in the "Run" dialog and click "OK". A command window will pop up where you can type DOS commands. Use the DOS "cd" (change directory) command to navigate to the directory where Features.exe or Panorama.exe is located. Then type "Features" or "Panorama" followed by your arguments. If you do not supply any arguments, the program will print out information on what arguments it expects or open the UI in the case of Features.exe.

Running from a shortcut

Another way to pass arguments to a program is to create a shortcut to it. To create a shortcut, right-click on the executable and drag to the location where you wish to place the shortcut. A menu will pop up when you let go of the mouse button. From the menu, select "Create Shortcut Here". Now right-click on the short-cut you've created and select "Properties". In the properties dialog select the "Shortcut" tab and add your arguments after the text in the "Target" field. Your arguments must be outside of the quotation marks and separated with spaces.

Running the skeleton program

You can run the skeleton program from inside Visual Studio. However, you will need to tell Visual Studio what arguments to pass. Here's how:

  1. Select the "ImageLib" project in the Solution Explorer (do NOT select the "Panorama" project).
  2. From the "Project" menu choose "Properties" to bring up the "Property Pages" dialog.
  3. Select the "Debugging" Property page.
  4. Enter your arguments in the "Command Arguments" field.
  5. Click "Ok".
  6. Now when you execute your program from within Visual Studio the arguments you entered will be passed to it automatically.
  7. Repeat the above steps for the solution for the Features component.

What to Turn In

In addition to your source code and executables, turn in a web page describing your approach and results. In particular:

Feature Detection and Matching

Panorama Mosaic Stitching

This portion of the web page should containin the following:

The web-page should be placed in the project2/artifact directory along with all the images in JPEG format. If you are unfamiliar with HTML you can use WYSIWYG-style editor such as Microsoft Word. It may be easiest to modify our template.

Panorama Links