-
Notifications
You must be signed in to change notification settings - Fork 0
Field Horizon and Convex Hull
After color segmentation, the first thing we want to do is figure out where the field is. This is useful because it highly constrains everything else we do in vision. Lines, balls, and crosses can only be on the field. Goal posts rise up off the edges of the field. There are two major components to this effort: 1) Determine the general field horizon, and 2) find the convex hull of the field.
The robot's pose (which includes the position of the camera) gives us a pretty good idea of where the horizon line is. However, the field is generally smaller than the real horizon and of course the pose can have some errors, so we try to improve that estimate.
Our algorithm is pretty simple. We start with the idea that the pose estimate is pretty good and do what we can to improve it by scanning (horizontally) for green. We start at the pose horizon and scan every fourth line or so until we see enough green to conclude that the field is present in that scanline. That process gives us an initial estimate of the horizon. Then we refine this by going back up towards the horizon and scanning every line a little more carefully until we have enough evidence that we are done with the field. This horizon is a useful upper limit on where the field is in the image. These days we use a more refined process though, which is the convex hull.
We'd like a more accurate picture of where the field ends. To do this we find a convex hull defining the field. Again the process is relatively simple. We scan vertically in every 10th scanline to find where the top edge of the field is in that scanline. Those points are then simply processed with a Graham Scan. We then interpolate all of the points between the main scanlines in order to be able to provide a concrete number for other parts of vision that need to know where the field edge is in any given column.