View Single Post
  #5   Spotlight this post!  
Unread 20-01-2017, 07:21
YairZiv's Avatar
YairZiv YairZiv is offline
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 41
YairZiv is an unknown quantity at this point
Re: Multiple Vision Targets using GRIP

Quote:
Originally Posted by RileyC3826 View Post
Our team is relatively new to vision processing, as this is actually the first year we have gotten it to work. My question is, how would we go about looking for and using multiple targets in our code? So far we can pretty easily detect a single piece of retro reflective tape, but when we put two in front of the camera, it just chooses one or the other to base its values on. To get our values, we are basically just using the example code from WPILIB, here more specifically:
https://wpilib.screenstepslive.com/s...-robot-program
We tried adding a statement that defines a second rectangle, but both of them end up getting the same values.
What we've done (and I persume you guys use openCV directly and not through GRiP, but if you do then please excuse me), We've used the findContours() method and then used a function we created that sorts that list of contours from biggest to smallest, then we returned only the biggest 2. Using their data, you can do an avarage of their center Xs to check if your robot is centered on the rod of the gears or something like that.
Reply With Quote