Other Vision Stuff - northern-bites/nbites GitHub Wiki

The vision system does some things other than object identification. Here's a rundown.

Ball Heat

When we see a ball the vision system tries to identify whether or not it is likely to be kicked soon. There are two ways to do this. The first relies on robot recognition. If a robot is identified at nearly the same distance as the ball and the robot is aligned over the ball or next to the ball, then a "heat" index is assigned based on an assessment of how ready the robot is to kick the ball. If no robot fits this criteria we still try and do this. This is because robot recognition is not completely reliable (and breaks down completely when more than about 2 meters away). Essentially in this case we scan the area above the ball for white (indicating a possible robot) or for the colors of robot uniforms. Again these provide a "heat" index, though not generally as high as when robots are definitively identified. The code for this can be found in Context.cpp.

Field Edge Distances

As part of our convex hull assessment we provide three numbers to the behavior system. These numbers represent the distance the observer is from the field edge at three points in the visual image (IMAGE_WIDTH / 4, IMAGE_WIDTH / 2, 3 *IMAGE_WIDTH / 4). These can be used in behavior to provide a quick assessment of whether or not the robot is actually looking at the field, or a direction to turn to start looking at the main field. The code for this can be found in Field.cpp.

Open Field Detection

As we do our scans to find balls and whatnot, we also assess how open the field is in front of us. In other words are we looking at the field, or are we blocked by robots and other things. We divide the field into three quadrants, left, center, and right. During our scans we look for runs that might indicate blockages (a long run of white that isn't part of a line, a robot uniform, lots of undefined color, etc.). We track where those blockages begin. For each quadrant we assign a value which is the lowest value found in any of the individual columns. The code for this can be found in Threshold.cpp.

Shot Decisions

When we have identified the goal we try and assess whether it is a good time to shoot or whether we should align to either side. This is closely related to the open field detection problem above. Essentially we look at the likelihood of blockages in the goal and where the best opening seems to be. The code for this can be found in Threshold.cpp.