Go to Post As Grandma used to say, "empirical data is better than no data at all." - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2012, 23:24
bakerjohn42's Avatar
bakerjohn42 bakerjohn42 is offline
Team 3171 - Co-Captain
AKA: John Baker
FRC #3171 (Hurricane P.R.I.D.E.)
Team Role: Driver
 
Join Date: Jan 2012
Rookie Year: 2009
Location: Westhampton Beach, NY
Posts: 10
bakerjohn42 is an unknown quantity at this point
Anyone able to track targets?

Has anyone had their robot track a target using a camera yet? if so, could you tell me what you called in your code to do so.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2012, 23:27
JewishDan18's Avatar
JewishDan18 JewishDan18 is offline
Registered User
FRC #1700
Team Role: Engineer
 
Join Date: Feb 2009
Rookie Year: 2007
Location: Sunnyvale, CA
Posts: 185
JewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to beholdJewishDan18 is a splendid one to behold
Re: Anyone able to track targets?

I have. I threshold the image and get the particles analysis reports, and do some math on them to determine the location of any targets in the image (you need to first determine which ones are rectangles, then figure out their location). I changed a bunch of the WPILib code to suit my needs, but that's the basic idea. I hope sample code is released soon, so I can see how my results compare.
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2012, 23:57
youxinche95 youxinche95 is offline
Registered User
AKA: Eugene Che
FRC #0649 (MSET)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Saratoga, CA
Posts: 18
youxinche95 is an unknown quantity at this point
Re: Anyone able to track targets?

Correct, you getImage().thresholdHSL(bla,bla,bla,bla,bla,bla)

then you take that binary image and getParticles or something like that...

Those particles give you the essentially the loops.

NOTE! the threshold is set to the color of the color hoop, so the binaryimage will only be on if it fits those requirements.

Good luck!
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2012, 00:09
Robby Unruh's Avatar
Robby Unruh Robby Unruh is offline
*insert random dial-up tone here*
FRC #3266 (Robots R Us)
Team Role: Coach
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Eaton, OH
Posts: 338
Robby Unruh will become famous soon enough
Re: Anyone able to track targets?

Yes, we have! In fact, there's a really good example on FIRST Forge to find reflective tape (or other?). It's one of the coolest thing's I've worked with to date, for sure. I couldn't be more excited about it.

Quote:
Originally Posted by youxinche95 View Post
Correct, you getImage().thresholdHSL(bla,bla,bla,bla,bla,bla)

then you take that binary image and getParticles or something like that...

Those particles give you the essentially the loops.

NOTE! the threshold is set to the color of the color hoop, so the binaryimage will only be on if it fits those requirements.

Good luck!
Sidenote: You can get these "bla bla bla" arguments from the NI Vision Assistant. Simply run an HSL threshold over your image (after acquiring one, of course) and mess with the cool sliders until it's only seeing the tape.
__________________
[Robots R Us #3266]
2015: Georgia Southern Classic (Winners / Thanks 1319 & 1648!), Queen City
2014: Crossroads, Queen City
2013: Buckeye, Queen City, Crossroads
2012: Buckeye, Queen City

2011: Buckeye
2010: Buckeye
Reply With Quote
  #5   Spotlight this post!  
Unread 23-01-2012, 20:18
xmendude217 xmendude217 is offline
Registered User
FRC #3851
 
Join Date: Jan 2011
Location: Canoga Park, California 91303
Posts: 7
xmendude217 is an unknown quantity at this point
Re: Anyone able to track targets?

what is supposed to be done to the image after it's processed?
Reply With Quote
  #6   Spotlight this post!  
Unread 23-01-2012, 22:42
nickpeq nickpeq is offline
Turing-complete
FRC #1255 (Blarglefish)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Baytown, TX
Posts: 60
nickpeq is an unknown quantity at this point
Re: Anyone able to track targets?

Quote:
Originally Posted by bakerjohn42 View Post
Has anyone had their robot track a target using a camera yet? if so, could you tell me what you called in your code to do so.
We just got our robot tracking today, using the new sample.
Still gotta work on a good PID though; the robot is too eager to center on the target and goes crazy.
Also, with the camera overexposed (I think it's technically a very low exposure...), it likes to change colors on me every time it restarts. -_- So, for now, I keep having to adjust the color criteria. However, switching to HSL criteria, instead of RGB, helped significantly. The hue is very constant for the target.
Reply With Quote
  #7   Spotlight this post!  
Unread 29-01-2012, 01:42
sng sng is offline
Registered User
FRC #0649
 
Join Date: Jan 2012
Location: Saratoga, CA
Posts: 2
sng is an unknown quantity at this point
Re: Anyone able to track targets?

Does the cRio have enough horsepower to track the targets? We're finding it takes about a second to analyze each image, but maybe we are doing something wrong....
Reply With Quote
  #8   Spotlight this post!  
Unread 29-01-2012, 08:30
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,752
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: Anyone able to track targets?

What is the resolution of the camera?

Greg McKaskle
Reply With Quote
Reply


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 13:29.

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