How to Make a Color Table - northern-bites/nbites GitHub Wiki

Color tables are now made in the QTool. To run the QTool you should first navigate to src/qtool. Once there you'll need to:

make run

This will bring up the tool. Next you'll need to load some data. Our data comes in the form of logs. If you pick the Data Loader tab of the QTool it will go to your logs directory and display whatever logs you have collected/downloaded. Double-click one to load it. Now switch over to the Color Creator tab of the tool.

Now that we have two cameras on the left you will see a tab for selecting between the top and the bottom image. For now, neither of these will display anything until you select a new frame (a good issue for anyone reading this to resolve). On the right you'll see a series of sliders and a few buttons. On the top of all of this you can select any of our colors to work on. The default is Orange. The sliders represent what part of the color cube we are defining as that particular color. Our goal is to find the minimum space in the cube that actually correctly colors our field objects. A good place to start is to load up some starter values for the sliders. If you have gone to the data/sliders directory of your code, you can ./sync up to get our saved sliders. One of these is named starter.sld this is what you want. You'll notice that the values it loads look odd - e.g. the min values are set to high numbers while the max values are set to low numbers. The reasons for this will become clear as you read on.

Obviously you can set the sliders manually, but these days we rarely do that (with the exception of the H sliders). The best way to set the sliders is to pick a good example of the color (i.e. a nice yellow goal post) and right-click it in the raw image. What the tool will do is figure out why the corresponding pixels don't work for the color cube you are defining and it will increase the range of the cube (by adjusting the sliders) automatically. With just a few clicks you should be able to define a relatively large range in the color space. If you left-click you will see the values of where you clicked and how that pixel would be classified. As you do this you'll want to save your sliders in case you make a mistake. You can keep saving them to the same file over and over. You'll also notice when you click (either right or left) that a little blue box will be drawn on the thresholded image on the left. That's just to help you hone in on the region you are working on. Ideally we will fix this to actually mirror the cursor on both images in the future so we can easily click exactly where we want.

Keep in mind that your goal is to find the minimum space in the color cube. A rookie mistake is to try and make everything colored on every frame. Sometimes the camera just doesn't provide a good enough image, or there is an overlap between colors, or . . . The bottom line is that you want the objects pretty well painted, but sometimes you need to let them be only marginally well painted so off field objects don't start getting painted too much. In general it is much better not to recognize an object that is there than to recognize one that isn't there.

Once you have got everything the way you like it you can go on to save your color table. If it then needs to go into the repository, navigate to data/tables in the terminal and

./sync up