Go to Post In theory, we do not need teachers in this world because we have the written word, but in reality, teachers are one of the most valuable resources, if not the most valuable resource, we have. - Natchez [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 25-02-2012, 21:56
Lalaland1125 Lalaland1125 is offline
Registered User
AKA: Ethan Steinberg
FRC #2429
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: La Canada
Posts: 29
Lalaland1125 is an unknown quantity at this point
Code for beaglebone and network camera

Thought I might as well share our team's starting code for the beaglebone and the network camera.

It is not quite done yet, we still have to deal with multiple targets, add in more filters, correct the measurements of the targets, etc.

But it should provide a base to those who want to get started.

Some gotchas to the beaglebone:
1. If your model is A4, then you will have to remove a resistor in order to get the ethernet to work. Here is a video randomly found on the internet showing you how to remove the resistor: http://www.youtube.com/watch?v=Ak30G-shiYY

2. Sometimes the file system gets a tad corrupted and the beaglebone will neither connect to a network or pop up as a usb drive when connected to the computer. The solution is simple, plug the microsd into a desktop computer and run fsck on it.

3. Opencv did not seem to work with the network camera on our beaglebone. We ended up just going directly with ffmpeg.

4. Ffmpeg was claiming that it did not have the mjpeg codec (even though it had mjpeg). Building ffmpeg from scratch fixed this.

5. We compiled everything on the beaglebone. Cross compiling was too much of a pain.


This is how we are finding the angle to the target.
1. Use findContours to find the contours.
2. Use approxpolydp to find the points of the rectangles.
3. Use a filter that tosses out misshapen rectangles.
4. Use solvePnP to obtain the location of the target.
5. Use atan2 to obtain our angle to the target in the x-z plane.

As for controlling the beaglebone we are going to have the beaglebone act as a TCP server and send messages back and forth with boost::asio.

Hope that this is useful for some teams.
Attached Files
File Type: zip asioSingle.zip (64.5 KB, 131 views)
 


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 20:18.

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