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

Tekkotsu Links:   Tutorial Resources 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

Create a project/images directory and download the file ttt5.png to that directory. (The image at right is an RGB version; click on it to see the YUV.) Since this is a PNG file, Tekkotsu expects it to be in YUV format instead of RGB. This provides more accurate color segmentation, and can be used with the standard threshold file 7general.tm.

Then, use the simulator to run the program from the visual routines lecture notes that finds the orange blob closest to the largest blue blob (examples 2 and 3), but change blue to green. You will need to type "make sim" in your project directory to compile for the simulator instead of the AIBO.

What does findMinPlus() do? Where can you find the documentation for it in the Tekkotsu Reference section? (Hint: go to the DualCoding library sub-documentation from the main Reference page, and then click on the Class Members tab, then select "f".)

Part III: Solving Problems with Sketch Primitives


For each problem, write code using only sketch primitives (not shape primitives) 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 project/ms/config/tekkotsu.xml to use these files instead of the default thresholds. See the Easytrain tutorial for instructions on how to do this.

Note: when you have multiple image files in your project/images directory, the simulator will cycle through them at 30 frames per second. To prevent this, use the simulator command "freeze". Then, when you want to advance to the next image, use the simulator command "advance". Stop your behavior and start it again to pick up the new image.

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

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::fillInterior to find the interior of the curve.

Between-ness

Find the yellow blob(s) that are "between" the two orange blobs. Here, between-ness could mean that the distances of the yellow blob to the two orange blobs are less than the distance from one orange blob to the other.



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