Team 3019 graciously presents their vision tracking program for everybody to use and borrow! Now instead of dreaming about the perils of computer vision YOU can bring your team the joy of having a robot that is capable of tracking the target with ease! No more Grip crashes or weird deploys, can calculate fun things such as: distance to target, and angle to target! to be used to auto align and auto aim!
if you are going to modify the code, all i ask is give me and my team credit in a comment at the top of the code and comment your suggestions and or your praise!
- download opencv 3.1 from here
- download Network table 3.0 jar
- make a new project in eclipse
- make opencv and networktables added as a user library to the build path of your new project
- copy opencv_ffmpeg310_64.dll from C:\Path o\opencv\build\bin
to C:\Windows\System32 - add the code in a class that is named TowerTracker.java
- when your ready to export
- export the .jar file as a runnable jar
- move the .jar to a folder similar to this
- run the .jar with “java -jar c:\Path o\TowerTracker.jar” on a command prompt window
the code is just an example of what it can do, i can add network table stuff soon but i thought i would publish it first!
want to see an example of what it can output?
here you go!
how it works: using an axis camera or a mjpeg streamer you can use a stream of a webcam to process images using an opencv program that runs on the driver station computer. This program can be modified to run on a coprocessor and directly input to the roborio for even better results because network tables can only go at 10hz vs the camera stream which is 30hz…this program can easily be ported over to c++ and python and would probably run better with those as c++ and python are way more supported then java with opencv.