Good java vision tutorial walkthrough


I’m trying to do vision processing for this years game, but not sure how. I’ve read a lot of vision tutorials, but none really give any example code.

Are there any good vision tutorials/walk throughs?

Thanks for any help,
Team 3090 programmer

Two questions:

  • By vision do you mean tracking the vision tape targets or something else like game pieces?
  • If you’re tracking the vision tape, are you using a Limelight or another camera (and LED ring)?

microsoft lifecam hd 3000 and a led ring

Do you have a separate processor for doing vision, like a Raspberry Pi or a Jetson? Or are you planning on running the code directly on the RoboRio?

Directly on the roborio

You’ll want to look into OpenCV - that’s the code library that lets you manipulate pictures from your camera to detect the targets.

With it you can perform operations like eroding and thresholding to extract the useful parts of the image (green reflections from the vision targets usually). Once the targets are the only thing remaining in the picture, you can figure out where they are in your field of view and information like how far away you are.

There’s a step by step walkthrough (from what I remember a pretty good one) that explains the process of writing code for detecting targets in FRC here:

Edit: While it can be done on the Rio, you might want to look into a coprocessor if you’re doing vision, since it can be a drain on the main processor that other stuff is running on

You’re going to have a hard time doing vision on the Rio. It simply isn’t powerful enough to do anything anywhere near real-time. Your best bet is to use a coprocessor like a Raspberry Pi 4, and pair it with software like Chameleon Vision

1 Like

I second the chameleon Vision, very simple to use.

For starting out, my team originally was attempting OpenCV and Grip with python, the beginning of this year we were using a raspberry pi and ChameleonVision, now we bought a Limelight. The only thing we’re able to get working perfectly was ChameleonVision with no help from anyone. ChameleonVision has great documentation and we were able to get it working within an hour.

Thanks for all the replies. I have a raspi3 but not the new 4. Ill try that. thanks

Limelight and chameleonVision both use Raspberry Pi 3. I don’t think there is anyone using a Pi4 yet

OpenSight runs on a Pi 4 just fine.
Anything that runs on a Pi 3 should run fine on a Pi 4. It’s pretty much the same system, just with a faster clock and way more memory.

Chameleon Vision is hardware agnostic. Pi 3, Pi 4, Jetson Nano, Kangaroo, old laptop from your dads closet. All fine.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.