|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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.
|
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||
|
|||
|
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! |
|
#4
|
|||||
|
|||||
|
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:
|
|
#5
|
|||
|
|||
|
Re: Anyone able to track targets?
what is supposed to be done to the image after it's processed?
|
|
#6
|
|||
|
|||
|
Re: Anyone able to track targets?
Quote:
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. |
|
#7
|
|||
|
|||
|
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....
|
|
#8
|
|||
|
|||
|
Re: Anyone able to track targets?
What is the resolution of the camera?
Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|