Go to Post I don't mind being odd...I like to - listen - to Dean Kamen's speeches. They make sense. I don't get to listen to a lot of sense in the world, just a lot of noise. - JaneYoung [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 15-01-2014, 20:19
MechaKnight996 MechaKnight996 is offline
Registered User
FRC #0996
 
Join Date: Jan 2014
Location: Casa Grande, AZ
Posts: 16
MechaKnight996 is an unknown quantity at this point
Exclamation How to make Axis Follow a color

So i am trying to figure out how to make the axis camera make the robot follow a specific color. If anyone could help at all please post an answer or even an example.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2014, 20:43
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: How to make Axis Follow a color

Try OpenCV color tracking. It is towards some of the easier stuff you could do with OpenCV. However, what do you need it for? There may be a better way of doing what you want, that will offer a better precision/accuracy!
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2014, 20:48
CalTran's Avatar
CalTran CalTran is online now
MST Rolla Senior
FRC #2410 (BV CAPS Metal Mustang Robotics)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: Overland Park, Kansas
Posts: 2,386
CalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond reputeCalTran has a reputation beyond repute
Re: How to make Axis Follow a color

Given he wants to track a robot of a certain color, I would imagine the OP is attempting to write code for an Axis camera to track the bumper color of a robot and then he plans on extrapolating from there to either decide where to launch the ball or position his robot to catch a ball.
__________________
Team 2410 thinks KISSing is amazing! Keep It Super Safe!
  • "You know you've been in robotics too long when you start talking to your tools." "Well, you've been in robotics CLEARLY too long when they start talking back"
  • Theory is when you know everything but nothing works. Practice is when everything works but you don't know why. On our team, theory and practice comes together - nothing works and nobody knows why.
MMR 2410 Student (2010 - 2013) | MMR 2410 Mentor (2013 - Present)
FTC Game Announcer / EmCee (2014 - Present) | FRC EmCee (2015 - Present) | FRC Referee (2016) | FTC Referee (2017)
Academic Student (Forever)
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2014, 20:50
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: How to make Axis Follow a color

You could use CV to threshold a specific color. It will require a bit of work, but shouldn't be too crazy!

Just grab the image, in any way you prefer, and run the inRange() function!
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2014, 20:58
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 432
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: How to make Axis Follow a color

Quote:
Originally Posted by CalTran View Post
Given he wants to track a robot of a certain color...
The OP said they wanted a robot to track a color, not track a robots color. Maybe he wants to track a ball...


There are quite a few different options depending on what it is you want to do.

Some places to start...
If you are programming in C++ or Java, when you installed wpilib you should have gotten a few different sample projects.
There's a sample project from 2009 called TrackerDemoProject. This program tracked targets based on color, and turned the robot to keep the target in the center of the camera frame.
There's another sample project, from 2010 called CircleTrackerDemoProject. This program looks for a circular target and rotates the chassis to center the target in the cameras view.
If you are programming in Java, these sample projects are accessed from File --> New Project --> Samples --> FRC Java.

Roborealm is a piece of software you get for free (there's a code in the KOP). They have a long list of guides for filtering images in different ways.
This program can run on your driver station to offload some of the processing required (so it doesn't slow down your cRIO).
If you're trying to track a ball you could threshold the image based on known ball colors, then try to detect an ellipse.

OpenCV can be used, you'll need to run this on your driverstation laptop. One way is as a widget in the smart dashboard. See the vision paper that 341 posted here on CD. Another option is to run a co-processor (like a beaglebone on board your robot) on board your robot, which connects to the camera and sends processed data to the cRIO over ethernet.

If you couldn't tell, there's lots of options. If you give us more information about your setup (what language you're programming in, where you want to do your image processing, what software you want to use, etc.) we can help narrow things down. Info on what you're trying to detect would be helpful to in describing what algorithm you might be able to use to detect the colored object.
__________________
http://team2168.org

Last edited by otherguy : 15-01-2014 at 21:00.
Reply With Quote
  #6   Spotlight this post!  
Unread 16-01-2014, 06:27
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: How to make Axis Follow a color

And if you are using LabVIEW, Help>>Find Examples will list Vision Examples, and inside there is one that determines the position of a colored object. It won't drive the robot, since that is relatively specific to your team's construction choices, but you just need to map between the returned values and joystick inputs with a bit of scaling.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 16-01-2014, 11:02
Brandon_L Brandon_L is offline
Back @ it again with the white vans
AKA: Brandon Liatys
FRC #2180 (Zero Gravity)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,207
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
Re: How to make Axis Follow a color

Quote:
Originally Posted by otherguy View Post
The OP said they wanted a robot to track a color, not track a robots color. Maybe he wants to track a ball...
Um, vision target anyone?

As Greg said, there are vision examples in Labview that are pretty useful and should get you going.
__________________
FRC 2495 - Hamilton West Robotics [2007-2014] - whats a..."hive mind"?
FRC 3929 - Atomic Dragons [2012-2013]
FRC 2180 - Zero Gravity [2017-]

Just trying to collect all the possible team colors
Reply With Quote
  #8   Spotlight this post!  
Unread 16-01-2014, 11:11
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: How to make Axis Follow a color

The WPI ScreenStepsLive stuff has a bunch of tutorials on finding the vision target, too

http://wpilib.screenstepslive.com/s/3120/m/8731
Reply With Quote
  #9   Spotlight this post!  
Unread 16-01-2014, 17:20
MechaKnight996 MechaKnight996 is offline
Registered User
FRC #0996
 
Join Date: Jan 2014
Location: Casa Grande, AZ
Posts: 16
MechaKnight996 is an unknown quantity at this point
Re: How to make Axis Follow a color

Thank you all for your help i will try these options, sorry for late responce just got back into a new meeting
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 14:41.

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