We did vision for the first time last year, am looking at moving to Java this year.
One thing that was very helpful last year was an NI provided sample on the PC where you access the camera and manipulate the parameters for the recognition software via sliders in real time, and get a real time view of the scene with the recognized particles highlighted and numeric information overlaid. Made it very easy for the students to see what the various parameters actually do.
Looking at writing SmartDashBoard/OpenCV based detection, so I’d like to have something similar to make it easy for the students to visualize what the various pieces of Java code do. I’m looking at Team 341’s 2012 code, and it can optionally display intermediate results, but the adjustable parameters are not there.
Has anyone already seen/done this, or am I going to have to roll my own up? The interactive aspect is what’s missing.
It’s quite doable using SmartDashboard Properties. My team’s 2013 vision system used this, and it made calibrating thresholds wonderfully easy. I’ll be playing with our usage of these properties during this preseason to see if I can make the system nicer and more flexible, but the current version shows the basic concepts of it.
One thing you might notice is the obnoxiously large propertyChanged() method, and all the variables storing the values from each of the properties. This was a hack I made to avoid using the Property.getValue() method, which I had blamed for some previous performance problems. This hack got a bit out of hand however, and I’m not totally sure whether it had any positive effects. A big part of making this “nicer” is figuring out how to eliminate that obnoxiousness without causing any performance problems, which may be as simple as using getValue().
I’m working on that. I apologize that it’s a mess; I focused on making it work, not on making the code easily readable. I’ll be refactoring it significantly during this preseason.