EasierTrain tool

From Tekkotsu Wiki

Revision as of 08:42, 5 April 2015 by Touretzky (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

EasierTrain was written by Michael Gram and Nathan Heithoff at Rensselaer Polytechnic Institute. It is simpler to use than the EasyTrain tool because it segments the training images automatically and only requires the user to label the regions with their correct colors. The segmentation can be modified by adjusting a threshold slider. EasierTrain writes default.col and default.tm files that are then used by CMVision to do image segmentation on the robot.

Segmenting an image with the EasierTrain tool

The tool is written in Python and requires some libraries that are only available for 32-bit architectures, so you must build a 32-bit version of Python to use them. For more information, see the EasierTrain install instructions. Visit the EasierTrain project page for the latest updates.

How to Run EasierTrain

  1. Collect some images as either PNG or JPG files, and place them in a directory that contains nothing else. Let's assume the directory is ~/img1.
  2. Create a fresh directory to hold the segmentation files that will be created by EasierTrain. Since you might want to experiment with multiple versions of the segmentation settings, use a name like ~/img1-seg1 for the first version.
  3. Type the following to start the tool:
cd ~/img1-seg1
EasierTrain ~/img1

How to Segment Images

The current version of the tool requires you to choose all the regions you want to use for one color before you move on to the next color. This will be fixed in a later release.

  1. Choose the first color you want to train. Click on a region in the image, and the corresponding region in the segment outline should assume that color.
  2. Shift-click on additional regions that belong in the same color class. You don't have to click on all of them, just a representative sample.
  3. Control-click to deselect a region if it was selected by accident.
  4. Use the Next and Prev buttons to cycle through all the images in your images directory so you can select representative regions of the current color from these images as well.
  5. When you've selected all the regions you want to use, click on the Add button to create the color class, and then set its name in the Palette window.
  6. Click the Save button to save your work.
  7. Choose a new color class and click (not Shift-click) on the first region to begin defining it.
  8. When done, click Save and then Quit to exit.

How to Use Your Segmentation Files

On the robot, do the following:

cd ~/project/ms/config
mv default.col old-default.col
mv default.tm old-default.tm

Then copy the default.col and default.tm files from your workstation into this directory, and restart Tekkotsu.