|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
||||
|
||||
|
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!
|
|
#3
|
||||
|
||||
|
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.
|
|
#4
|
||||
|
||||
|
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! |
|
#5
|
||||
|
||||
|
Re: How to make Axis Follow a 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. Last edited by otherguy : 15-01-2014 at 21:00. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
Re: How to make Axis Follow a color
Quote:
As Greg said, there are vision examples in Labview that are pretty useful and should get you going. |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|