FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Rectangle Vision Tracking?

early in the season we were able to get the rectangular target processing example to see the target and give a distance from it, when we installed the leds.

now are wanting the camera to track the target using the servos to move the camera.

i can't see anywhere in this example where that is implemented. is this another example or it there a way to get track distance and camera tracking from this example??

www.team1912.com

0 Kudos
Message 11 of 13
(969 Views)

I don't have the example in front of me right now, but if I remember correctly, one of the outputs is an array of particles that were detected.  For each particle there is a distance and a position.  Once you identify which particle you want to track (you might get multiple particles if your camera can see more than one target), you can then use the position and distance information for tracking.

0 Kudos
Message 12 of 13
(969 Views)

You will need to load the example, camera with servos. It was written for a different game so it tracks colors not rectangles but you should get the general idea of how to link the image to the servo drives. THere is also a PDF tutorial on image tracking that documents how to compute distance and angles from the Axis camera so that you can build a cross-hairs and rotate or slide the robot until the camera servos are at the home position. The X,Y data in the target matrix show the center of the rectangle on the scale of the camera field of view. (-1 to +1, -1 to +1) so when the camera is at servo position (0,0) and the target center is at (0,0) the camera and the robot are aligned with the target.

0 Kudos
Message 13 of 13
(969 Views)