Log in

View Full Version : Image processing?


wildefriend1
07-02-2015, 17:34
We were wondering where we could get started for image processing/ tracking for command based java. We want to be able to track the toats is autonomous mode.

Fauge7
08-02-2015, 22:47
You will run into problems. I would recommend getting a coprocessor or using the driver station with something such as my solution which should be good enough. With my solution I was able to get a robot to align to a tote and run into it, I will also be coming out with a vision library soon that makes vision stupidly simple to do basic stuff with. Pm me if you have questions about any of the java stuff, I looked into all of this week 1...

GeeTwo
09-02-2015, 10:51
You will run into problems.

Problems getting the vision software itself to work, problems with the rest of the robot because so much CPU is tied up in vision processing, or something else?

Ozuru
09-02-2015, 11:12
Problems getting the vision software itself to work, problems with the rest of the robot because so much CPU is tied up in vision processing, or something else?

I'm not him or her but I'm willing to wager that they were suggesting there will be issues with the rest of the robot due to the intensity and resources used during vision processing on the rather meager RoboRIO, for which that I agree with.

I recommend you check out DaisyCV from 2012 or 2013 as they have been an incredibly useful resource for me (and other programmers) regarding vision tracking. Storm (2729) also publishes their code on GitHub each year and has a well-documented OpenCV driver-based solution from last year they published. If you run into any specific issues, let me know -- the documentation for OpenCV is greatly lacking and getting started was the hard part.

Fauge7
09-02-2015, 13:42
I'm not him but I'm willing to wager that they were suggesting there will be issues with the rest of the robot due to the intensity and resources used during vision processing on the rather meager RoboRIO, for which that I agree with.

yes, not only does it take a good amount of processing power which might lag the robot controls, but it also is almost impossible to do in java. The NIVision libraries are not documented and dont event work. The only option is using opencv java bindings which are also poorly documented. Your best option is using a coprocessor or driverstation computer with C++,C, or python, Python is relatively easy to learn.

weaversam8
09-02-2015, 14:13
Our team uses a Jetson TK1 we got from first choice to process along side the RoboRIO. They communicate using serial

cstelter
09-02-2015, 15:04
Has this changed much this year?

I was hoping to have the kids install the camera at our next practice and play with the axisCamera sample code as well as the vision processing examples. Do they just not work? Or are the problems encountered the same as the past 3 years?

We had some success 2 years ago with NI Vision libs running on the cRIO-- we had a separate thread running at low priority to do all the vision and once a pic was done it would update a global value that we could read each time through a pid loop. Essentially we used the global var to set our gyro setpoint and the image processing updated it about once every 0.3s maybe iirc. It wasn't great, but it kept us on track. We eventually went to dashboard side processing, but those involved with that part have left the team. I figured I'd start with the on-RIO solution and the separate thread idea which I can teach to the students how it fully works. But if things are broken this year with respect to past years, I want to try a different direction from the start.

But if the concerns raised are the same old issues, then I think I'll try the old approach as it was pretty easy to get up and running. And if the roboRIO is truly 100x faster than the cRIO as I thought I saw advertised, then that update every 0.3s could be every 3ms which is more than fast enough. I also thought I'd investigate roboRealm as that looked like it had good how-to info to incorperate it, and it looks like it did what our previous solution was doing.

Fauge7
09-02-2015, 18:37
its not at all 100x times faster

RufflesRidge
09-02-2015, 19:08
yes, not only does it take a good amount of processing power which might lag the robot controls, but it also is almost impossible to do in java. The NIVision libraries are not documented and dont event work.

That's an interesting assertion given that the plugins contain not one but two different examples to find auto totes.

Just because you didn't have success or found a bug doesn't mean that everything is broken and the sky is falling.

Fauge7
09-02-2015, 19:27
I have not tried them yet but I know the documentation is horrible. To effectively do vision processing you should use a better processor and not java. Yes you can do some basic processing.

faust1706
09-02-2015, 19:29
Eh. Java is doable with vision. It is definitely not the more common language, but I know that people in my lab, when they implement, they do it in java sometimes.

For example, opencv is incredibly biased for c++.

cstelter
09-02-2015, 19:39
I have not tried them yet but I know the documentation is horrible. To effectively do vision processing you should use a better processor and not java. Yes you can do some basic processing.

In the past years the NIVision code ran in c as a foreign language interface to java and java only had to process the resulting particle tables of data which are small (width, height, etc.). At lest that was my understanding-- I'm a C/C++ guy but that's how my co-mentor described it to me so I assumed he was right.

So exactly how much faster does the roboRIO operate than the cRIO? We went from single core 400MHZ to dual core 667 MHz but that doesn't necessarily tell much of a tale by itself. I could have sworn I heard 100x faster at St. Louis last year, but can't find any such reference on the web, so I must have misunderstood or heard wrong.
--
Craig

zDrakon
09-02-2015, 21:52
Can anyone refer me to a link or help my team through this forums?

We are using the ODROID (external coprocessor) to receive images from a usb camera. We ran into the problem of not being able to run it directly from the roborio for whatever reason.

I am searching over the interwebs and cheif delphi FRC forums for a solution in how to make the Roborio actually receive the image input from the usb camera. We are using BOOFCV similar to OPENCV but apparently in java instead of C++. Thanks so much please reply asap as we would love to get vision working!