Vision Tracking With Color

Some teams are using led’s to make the reflective tape shine a different color. How are you doing that? shining a light right on it? or a light next to the camera?

To be honest, and color processing will probably be harder than just gray scale with white light.

The strip is a retroreflective material. It reflects light preferentially right back at the source. So you want to put a light as close to the camera lens as practical. When you use a colored light source, the reflection is shockingly obvious.

so would it be easier to use color or gray scale or shapes?

Using gray scale has two main advantages:

  • Smaller image size by setting the colour level to 0 in the camera
  • Easier to find a threshold

The great thing with a uniquely coloured LED is you can have a smaller threshold range and therefore less particles that aren’t the actual vision targets you’re looking for.

Depending on what your goal with the camera is, you will likely do shape detection in either case.

We purchased the Ring Light from AndyMark as part of our FIRST Choice order. When we got it we epoxied it to the Axis camera with the lens in the center and hooked up the Ring Light to a 12V connection on the PD Board. We took a bunch of pictures at 320x240 resolution with the camera/LED with our Target and even in fairly bright ambient lighting the reflective tape is very bright. We started experimenting with the Vision Assistant using the method described here (Thanks Greg!) and after some tuning of the color parameters we found very good results with tracking the center of the Target with an execution time of approximately 12 mS. True, this was measured on the Laptop we were using and we have no testing yet on the cRIO itself but I am very impressed so far.

I am now a firm believer in the method described in Greg’s paper rather than performing shape recognition. Earlier testing with the picture from the FRC manual (shrunk down to 320x240) required almost a full second per image to process, using the Performance Meter in Vision Assistant.

What are you using to program?

If you choose to go with the monochrome/grayscale approach, you may want to try setting the camera to have color disabled. This is a bit different from setting color level to 0. If you truly set the color enable to false, it will speed the decoding and avoid the cost of color altogether.

Greg McKaskle

Quick question, how do I initialize the axis camera after delcaring it with “AxisCamera axis;”

Since it’s a singleton and the get function returns a reference, you need to declare it as “AxisCamera& axis;”

Then, you use the GetInstance method in the initialization list.


class MyRobot : public SimpleRobot {
    AxisCamera& axis;
public:
    MyRobot() 
        : axis(AxisCamera::GetInstance(/*ipaddress*/))
        {
        // Constructor stuff
        }
// rest of class
};

Alternatively, you could just call GetInstance whenever you want to call the AxisCamera methods and not have an instance variable for it at all.

We are using Labview but nothing in my original post requires that. Vision Assistant can create Labview vi’s, Java and C++ code (I believe).

how would i create c++ stuff and where do you get the license for it. Off the labview install files?

This has everything in it:
http://www.usfirst.org/sites/default/files/uploadedFiles/Robotics_Programs/FRC/Game_and_Season__Info/2012_Assets/Getting%20Started%20with%20the%202012%20FRC%20Control%20System_2.pdf