15-494 Cognitive Robotics
Spring 2006
Course Links:  Main Lectures Labs Homeworks

Tekkotsu Links:  Tutorials Bugs CVS
Reference:

Cognitive Robotics: Lab 3/Homework 3


Part I: Tekkotsu Simulator

Re-read the Tekkotsu Simulator chapter of the Tekkotsu tutorial:
     http://www.cs.cmu.edu/~dst/Tekkotsu/Tutorial/
You can skip the last few sections about debugging with gdb.

Part II: Visual Routines in the Simulator

The example code in the Visual Routines lecture for finding the largest blue blob, and then finding the orange blob closest to the largest blue blob, has been simplified. Review the updated code in the lecture notes.

Make sure you understand the new code before proceeding further. What does findMinPlus() do? Where can you find the documentation for it in the Tekkotsu Reference section? (Hint: look at the DualCoding::SketchData<T> class.)

Create a project/images directory, save this sample image there, and run the code on it.

Part III: Solving Problems with Visual Routines


For each problem, write code using visual routines to solve it. You may want to review the documentation for the Sketch primitives and the visops namespace. Note: the images below appear dark because the camera gain was set low. This reduces specular reflection and makes the images easier to segment.

You can either segment the images yourself, or use these files: lab3.tm, lab3.col, lab3.spc. Remember to edit ms/config/tekkotsu.cfg to use these files instead of the default thresholds.

Your answers to this part should be turned in as Homework 3, due Friday, Feb. 10.

Counting

Figure out whether there are more blue blobs or more yellow blobs in each image, and display the blobs of the more numerous type. To "display" your result, construct a Sketch<bool> called result that contains only the desired blobs.



Containment

Which blue blob appears inside the closed curve in the images above? Note: you will want to use visops::seedfill to find the interior of the curve. Rather than trying to guess a seed point inside the curve, pick a point you know is outside it (such as the upper left corner, whose index is 0), and then invert the result.

Length

Each image below contains two orange lines: a fat one and a sknny one. Which line is longer? Note: you can't just count pixels, since the line widths aren't equal. But you could compare perimeters, which will give a reasonably close approximation to length. How can you do that using visual routines? Display the longer of the two lines.



Free Style

Make up an interesting geometic question of your own about any of the above images, and show how to solve it using visual routines.

Too Hard for Sketches?

Which two yellow blobs are on the same side of the long line? This appears to be too hard to solve using Sketch primitives alone. (It will be easy to solve using a mix of Shape and Sketch operations, which we'll look at in an upcoming lecture.) You're not required to solve this problem for homework. But if you come up with a good solution, let us know.



Dave Touretzky and Ethan Tira-Thompson