From Tekkotsu Wiki
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.tm files that are then used by CMVision to do image segmentation on the robot.
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
- 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.
- 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.
- 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.
- 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.
- 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.
- Control-click to deselect a region if it was selected by accident.
- 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.
- 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.
- Click the Save button to save your work.
- Choose a new color class and click (not Shift-click) on the first region to begin defining it.
- 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.tm files from your workstation into this directory, and restart Tekkotsu.