Go to Post Adaptability is the key folks. Your job will not be the same 10 years from now (when I retire), or 20 years or 30 years from now. The tools and systems you use will change, and you must be able to adapt along with them. - Bill Moore [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 05-02-2011, 15:38
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
2011 Camera Code on Driver Station

So I have been working on camera code all day. Currently I am able to track targets based off of color and determine weather or not they are in a line.

Currently the most limiting factor is network speed which is keeping the FPS to about 15.

So if I were to release this to you guys how would you want the data returned to the cRio?

Example of ways data could be returned

1) Raw centroids and sizes
2) Pole positions (calculated based off the difference in x position)
3) Raw frame difference
4)??

I plan on (once it works well enough) releasing the application and the source code.

General rules on the usage of the source:

1) You may modify and redistribute at will.
2) You should be nice and credit me for the use
3) If you make improvements that helps tracking send the modifications to me so other teams can use it as well (Remember Gracious Professionalism)
  #2   Spotlight this post!  
Unread 05-02-2011, 15:50
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2011 Camera Code on Driver Station

PS here is a low-res teaser of what I have at the moment
Attached Thumbnails
Click image for larger version

Name:	cam_teaser.jpg
Views:	321
Size:	36.9 KB
ID:	9982  
  #3   Spotlight this post!  
Unread 05-02-2011, 16:43
kinganu123 kinganu123 is offline
Registered User
FRC #1747
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Piscataway, NJ
Posts: 243
kinganu123 is on a distinguished road
Re: 2011 Camera Code on Driver Station

What language would this be in?
__________________
  #4   Spotlight this post!  
Unread 05-02-2011, 17:05
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2011 Camera Code on Driver Station

The core is java over processing which would be able to send data to the cRIO via udp
  #5   Spotlight this post!  
Unread 05-02-2011, 17:13
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: 2011 Camera Code on Driver Station

I plan on using reflection from infrared if possible, if not LED off of the reflection tape on the scoring peg. The Camera will detect this. I have set the camera to grey-scale since full color is unnecessary and take up more space. Maybe use the reflection detected to also detect a circle with some help from the occlusion feature. This can further be used possibly to calculate distance from that circle or help align the robot to the column.
  #6   Spotlight this post!  
Unread 05-02-2011, 17:46
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2011 Camera Code on Driver Station

Quote:
Originally Posted by ZonChau View Post
I plan on using reflection from infrared if possible, if not LED off of the reflection tape on the scoring peg. The Camera will detect this. I have set the camera to grey-scale since full color is unnecessary and take up more space. Maybe use the reflection detected to also detect a circle with some help from the occlusion feature. This can further be used possibly to calculate distance from that circle or help align the robot to the column.
This software runs on the driver station with the camera plugged into the netgear router. The program does all of the calculations to determine where the reflective tape is and then subtracts the background (the green and red area) then the frame is run through openCV to detect the blobs and do those calculations. Finally the blobs are compared to each other to determine which ones are in a column. Other calculations coming would be angle and distance to targets.

The software then returns the target information (not the image) to the cRio where you would then do your own processing.
  #7   Spotlight this post!  
Unread 06-02-2011, 10:45
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: 2011 Camera Code on Driver Station

The latest LabVIEW update also contains an example under the vision category that shows how to statistically locate the columns. It runs on the development computer and uses a folder of images as inputs, so even if you are going to code in Java or C++, you can use it to tune colors, adjust lighting, etc.

Post any questions you have about how it operates.

Greg McKaskle
  #8   Spotlight this post!  
Unread 07-02-2011, 22:34
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2011 Camera Code on Driver Station

I will be releasing the alpha before mid-day tomorrow. Keep your eyes pealed.
  #9   Spotlight this post!  
Unread 08-02-2011, 10:14
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: 2011 Camera Code on Driver Station

Quote:
Originally Posted by ZonChau View Post
I plan on using reflection from infrared if possible, if not LED off of the reflection tape on the scoring peg. The Camera will detect this. I have set the camera to grey-scale since full color is unnecessary and take up more space. Maybe use the reflection detected to also detect a circle with some help from the occlusion feature. This can further be used possibly to calculate distance from that circle or help align the robot to the column.
also note that the tape on the circle peg is not actually circular,
on the kickoff field it was square. So personally I would not plan on using the circle in your processing, because it very well may not be a circle at competition
__________________
"Never let your schooling interfere with your education" -Mark Twain
  #10   Spotlight this post!  
Unread 09-02-2011, 00:24
divixsoft's Avatar
divixsoft divixsoft is offline
Registered User
FRC #0835
 
Join Date: Feb 2011
Location: MI
Posts: 29
divixsoft is an unknown quantity at this point
Re: 2011 Camera Code on Driver Station

Could you make the output the pole positions? Also, I admire your effort, the camera code is incredibly complex and hard. When and where will you post this code?
  #11   Spotlight this post!  
Unread 09-02-2011, 12:32
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2011 Camera Code on Driver Station

Ok everyone.

The alpha can be found on my site at http://www.satanicspider.com/frc.php

You will need to do the following to get it running

I have not tested the networking end very much (lack of time) if you run into problems let me know

*************
**IMPORTANT**
*************
Do this in this order or it wont be installed properly

1 Install openCV version 1.0 (not 1.1 pre)
2 Install openCV version 2.1
3 Make sure that .\lib\ is added to the PATH system environment variable

**For people running vista or 7**
4 copy all of the DLL files from the bin directories of BOTH openCV directories into the lib subfolder in the Axis Tracking folder.

Known issues:The pole tracking isn't finished yet but it works as it is. As you approach the poles the upper points will converge towards the middle of the image. I did not compensate for that but it is on my list of things to do.

Let me know if you have issues.

Last edited by drakesword : 09-02-2011 at 12:40.
  #12   Spotlight this post!  
Unread 09-02-2011, 12:36
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2011 Camera Code on Driver Station

Quote:
Originally Posted by divixsoft View Post
Could you make the output the pole positions? Also, I admire your effort, the camera code is incredibly complex and hard. When and where will you post this code?
I will consider that for the next release. At the moment it reports each point in each pole (x, y, size) the poles are divided by 2 bytes with a value of 255
  #13   Spotlight this post!  
Unread 09-02-2011, 12:57
divixsoft's Avatar
divixsoft divixsoft is offline
Registered User
FRC #0835
 
Join Date: Feb 2011
Location: MI
Posts: 29
divixsoft is an unknown quantity at this point
Re: 2011 Camera Code on Driver Station

Where is the source code?
  #14   Spotlight this post!  
Unread 09-02-2011, 12:59
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: 2011 Camera Code on Driver Station

Quote:
Originally Posted by divixsoft View Post
Where is the source code?
Good observation. It will be available in the same place after I clean it up a bit ^_^

[EDIT]

Its up

Last edited by drakesword : 09-02-2011 at 13:25.
  #15   Spotlight this post!  
Unread 09-02-2011, 13:53
divixsoft's Avatar
divixsoft divixsoft is offline
Registered User
FRC #0835
 
Join Date: Feb 2011
Location: MI
Posts: 29
divixsoft is an unknown quantity at this point
Re: 2011 Camera Code on Driver Station

what do you guys think of this code? and how do you transfer the processing from the crio to the classmate using the classes from frc?
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 23:30.

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