Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Team 2823 Raspberry Pi Experimental OpenCV C/C++ code (http://www.chiefdelphi.com/forums/showthread.php?t=131723)

jwhite 27-12-2014 12:01

Team 2823 Raspberry Pi Experimental OpenCV C/C++ code
 
Hi Folks,

Our team used a Raspberry Pi for vision processing last year. The student ended up with code that had pretty poor performance; about 1 frame per second. In the off season, I and a few students spent some time working up code to explore the performance and try to optimize the code.

We've got a body of code I thought I'd share. I'm afraid it's not complete, and it's really only suitable for someone with a strong C/C++ background.

The code is all on GitHub here:
https://github.com/Team-2823/vision2

It has one novel useful feature - I rewrote the OpenCV capture function in C, with a built in color filter capability, so in theory we can get a frame in more rapidly than any other way. (Although frame capture turns out not to take that much of the time; it's things like canny and finding contours that are expensive). It does have a lot of other features; timing of functions, configurable functions to perform (e.g. blur, canny, contours, fast, and so on), and tuning for color and camera filters.

But it's more of a toolbox; it's not at all a ready made set of vision code, and really suitable to someone who feels pretty comfortable in C and C++.

At any rate, I figured I'd share instead of just sitting here refreshing the kick off countdown timer... <grin>.

Cheers,

Jeremy

asid61 27-12-2014 22:49

Re: Team 2823 Raspberry Pi Experimental OpenCV C/C++ code
 
Very audacious. I will comb through this and see if my limited C/C++ experience can tell me what's happening. The electrical part of my team might find this interesting.

Sparkyshires 02-01-2015 10:48

Re: Team 2823 Raspberry Pi Experimental OpenCV C/C++ code
 
looks very clean. How do you plan to communicate between the roboRIO and the RPi?

jwhite 02-01-2015 10:52

Re: Team 2823 Raspberry Pi Experimental OpenCV C/C++ code
 
That's a different exercise <grin>. Last year, we just set a gpio pin to on/off if it was hot or not, although we did have a student write a network transport layer.

Cheers,

Jeremy

Sparkyshires 02-01-2015 11:59

Re: Team 2823 Raspberry Pi Experimental OpenCV C/C++ code
 
hmm, neat. If you're interested, I actually have some experience setting up a TCP/IP communication between an RPi and a linux PC. Albeit different from a roborio, but the similarities are there. I'd love to help you out on this if you want, I may try and convine my team to use an RPi this year. They are awesome :D

anthonyttu 02-01-2015 21:50

Re: Team 2823 Raspberry Pi Experimental OpenCV C/C++ code
 
Would it not be faster/more efficient to use SPI or I2C directly to the roboRIO instead of trying to use already in use TCP/IP.

Sparkyshires 02-01-2015 22:41

Re: Team 2823 Raspberry Pi Experimental OpenCV C/C++ code
 
Quote:

Originally Posted by anthonyttu (Post 1419391)
Would it not be faster/more efficient to use SPI or I2C directly to the roboRIO instead of trying to use already in use TCP/IP.

Very probably xD However, my electrical knowledge is much lesser than my software. TCP/IP would be my goto comm setup, but I2C would likely be more efficient.


All times are GMT -5. The time now is 02:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi