Processing Images from the 2009 FRC Game
In the FRC 2009 game, Lunacy, robots were required to put orbit balls into the trailers of opponents robots. To differentiate robots on each of the two alliances, a "flag" was attached to the center of the goal. The flag was a cylinder that was green on top and red on the bottom or red on top with green on the bottom. During the autonomous period, robots could look for opponent robots and shoot balls into their trailer using the vision targets.
Using the Find Contours operation to find targets
In this example the image, in this case a file, you can see the green and red halves of the vision target. The strategy is to:
- Look for objects that are either green or red using two different HSL Threshold operations, one for each color. Setting the appropriate parameters on the threshold allow it to detect the two halves of the target.
- Erode the images to get rid of any very small objects that slipped through
- Find contours in each of the resultant binary images
- Send the red and green contours lists to the robot, It will look for objects with the correct aspect ratio, proximity, and orientation with respect to each other. From this the robot program can determine which sets are targets.