Go to Post If you guys ever need anything, just let us know. Just remember you have the FIRST family behind you.<3 - hayleybayley217 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-12-2014, 12:01
jwhite jwhite is offline
Registered User
FRC #2823
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Saint Paul, MN
Posts: 69
jwhite is an unknown quantity at this point
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
  #2   Spotlight this post!  
Unread 27-12-2014, 22:49
asid61's Avatar
asid61 asid61 is offline
Registered User
AKA: Anand Rajamani
FRC #0115 (MVRT)
Team Role: Mechanical
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Cupertino, CA
Posts: 2,223
asid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond reputeasid61 has a reputation beyond repute
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.
  #3   Spotlight this post!  
Unread 02-01-2015, 10:48
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
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?
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
  #4   Spotlight this post!  
Unread 02-01-2015, 10:52
jwhite jwhite is offline
Registered User
FRC #2823
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Saint Paul, MN
Posts: 69
jwhite is an unknown quantity at this point
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
  #5   Spotlight this post!  
Unread 02-01-2015, 11:59
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
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
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
  #6   Spotlight this post!  
Unread 02-01-2015, 21:50
anthonyttu anthonyttu is offline
Texas Instruments Engineer
AKA: Master Chief
FRC #5417 (Eagle Robotics)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Dallas
Posts: 61
anthonyttu has a spectacular aura aboutanthonyttu has a spectacular aura about
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.
  #7   Spotlight this post!  
Unread 02-01-2015, 22:41
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Team 2823 Raspberry Pi Experimental OpenCV C/C++ code

Quote:
Originally Posted by anthonyttu View Post
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.
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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