Using camera to track rectangles

I know there are a lot of threads about this, but I wanted to get the opinion of you all if this was worth my time. I’m a new java programmer this year and still getting the hang of everything, but I managed to program our entire robot and get everything up and running.

Now that I have everything critical programmed, I would like to take a shot at tracking the rectangles. Realistically, I am not going to be able to implement this into our robot, but getting a readout on the dashboard of the distance from the hoop could be helpful (this is my main goal for the tracking). If I can’t get that to work, I want to at least have a basic understanding of tracking so I can better implement it next year.

Realistically, how complicated is attempting to track the squares with java, and what all is involved? I only have about a week and a half to do this, and really no way to test until I get to competition. Is it worth my time to try it, or should I just wait until the off season?

It’s not too hard to get some basic functionality. One warning though - at this late date you want to be very careful about adding image processing code to your robot. If not done well, it can introduce significant lag issues.

That being said…you want to start by making sure you have the latest update for the FRC libraries in your Netbeans. A new sample program was added part way into the build season. Create a new project, go to Samples, then FRC Java, and choose the “CameraTestProject”. This will give you a sample program that has the key image processing routines in it.
It also includes sample images to test with and a Vision Assistant script to experiment with.
Using Vision Assistant (which should be on your Drivers Station) is hugely helpful in testing and tuning your image processing routines. Vision Assistant can also be used to acquire your own real images to test with.

Hopefully that will get you started! It’s some pretty neat stuff.

Dale Van Voorst