We’d like to use vision tracking, but at our last regional the strength lights on the tower interfered with the tracking of the retro reflective tape. We were unable to replicate the field conditions in the pit so I was wondering how you would go about saving pictures (we use the Axis M1013 and Java) so I could use them after a match to help calibrate the tracking. Also if anyone knows how to save variables in the code to a text file so they could be reviewed after a match as well, that would also be appreciated. Thank you in advance for your replies.
If you are viewing video through the driver station during a match, you could take a screenshot and crop it.
If you are using openCV on a co-proccessor, you could try this:http://stackoverflow.com/questions/17119544/save-multiple-images-with-opencv-and-python
In Java you can put the variables in a text file and then read the text file to load the constants. I’m not exactly sure how to do it though, the programmer that did it on our team graduated and we switched to labview.
I have implemented saving images in labview but haven’t tested it. I just used IMAQ save and made the filepath a timestamp. I’ll let you know if it works when I test it tonight or thursday.
You can record the stream from your axis camera on your drive laptop using VLC. See the documentation here: https://wiki.videolan.org/Documentation:Streaming_HowTo_New/#Streaming_using_the_GUI
Then you can look at the recorded file and save relevant images from it.
There are also sample tower images taken with a green led ring that were released shortly after kickoff (located somewhere on usfirst.collab.net). You can use these to develop your vision if you also use a green led ring. It includes tower lights, so you can make sure you filter those out.
We prevented tower lights from interfering with vision by filtering out small particles (in NI vision - I’m sure grip and plain OpenCV allow something similar)
We have a button on the SmartDashboard so our drivers can save camera images to the roboRIO during practice matches. We then use ftp to download them for offline processing or read/process the saved images on the roboRIO and post the results.
To save images:
NIVision.RGBValue rgbValues = new NIVision.RGBValue();
NIVision.imaqWriteFile(currentImage, "/home/lvuser/image" + imageCounter + ".jpg", rgbValues);
To read images:
NIVision.imaqReadFile(currentImage, "/home/lvuser/image" + imageCounter + ".jpg");