Computer Science 154
Short assignment #8, due Friday, May 9
Visual tracking

This page is at http://www.cs.hmc.edu/courses/2003/spring/cs154/assignments/short8.html .

This final written assignment consists of a single programming problem whose task is to track an object (a red frisbee in a video by Swarthmore College's Bruce Maxwell) through an image sequence.

Part 1 -- Tracking


Write a program that will locate and then track a target in a sequence of images. The target to be tracked is the red frisbee in the sequence of images available here in gzipped, tarred form. One of the frames is shown above. All of them are available at /cs/cs154/as/problemset4/redSequence, so unless you're planning to use your own machine rather than a graphics machine, you won't need to download the images yourself.

Program to start with...

There is a skeleton program to start you off in /cs/cs154/as/problemset4/track.cc with a makefile in the same directory. This starter program takes advantage of the graphics library OpenGL; as a result you must compile and run it from a machine with the OpenGL libraries. Any machine in the graphics lab will work, but turing won't! Remember that the graphics machines are in Parsons this term... .

The skeleton program allows you to display one frame at a time from the frisbee image sequence. You won't be able to meaningfully resize the window, so you'll be looking at the images at full size -- each is 160 pixels wide by 120 pixels high. Hitting the "n" key from within the program advances the frame by one; hitting the "p" key turns on or off continuous animation. (The speed of the continuous animation depends on the processing time of your tracking routine.) The original sampling rate of the images was about 5 Hz.

What to do...

At the moment, the program draws a white + sign in the center of each frame in the routine processTheImage(). Basically, the task of this assignment is to improve the performance of this "blind" tracker by writing an appropriate processTheImage() function that will be called on each frame. OpenGL stores most program state in global variables, so I would suggest you do so for this assignment (despite its bad style).

The primary factor to use in this problem is the color of the frisbee, but consider, too, that there is considerable variation in the frisbee's colors as it moves through the sequence. In addition, there is a distracting red object in some frames. Your choice of how to represent an appropriate "red" color will be important.

The goal is to build a tracking algorithm that will work on more than just this image sequence, once appropriate changes to the color model are made. One result of this is that your program would be "cheating" if you simply told it where the center of the frisbee was in each frame and it repeated that back. On the other hand, you will need to tune your frisbee model to get reasonable performance.

Part 2 -- Vision-based control

When you get your location and tracking system working on an image sequence, link it to the Nomad simulator so that the robot rotates in response to the input, attempting to always keep the tracked object in the center of its field of view. For the test images, assume the field of view is 50 degrees wide (25 degrees to the left and right of center). By lining up windows appropriately, you can create the effect of the robot "following" the frisbee.

What to Hand-In

Either set up a web page or e-mail the following items to me.