Quote:
Originally Posted by RileyC3826
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.