Object Recognition - northern-bites/nbites GitHub Wiki

Most of the code described here is in Context.cpp with the notable exception of goal posts which should be moved there soon. There are several kinds of objects we want to identify: 1) Goal posts (right or left), 2) Field Crosses (blue or yellow), and 3) Corners (which one of the many on the field).

Corner Identification

The first stage of identifying a corner is determining the corner's type. We currently support 4 types of corner, Ts, Inner Ls, Outer Ls, and Center Circles. In practice we ignore the Center Circles currently. A T corner is easily identified by its shape. One line terminates on another line. There are six T corners on the field. Center Circle corners occur where the center circle intersects the midline. All other corners are L corners. Whether a corner is an Inner or an Outer L is basically determined by its facing relative to the observing robot. If we think of L corners are being arrows, when the arrow is pointed away from us it is generally an Inner L and all other corners are Outer Ls. In practice we are moving away from that distinction and toward one based on the corners orientation as one of four quadrants (down, right, left, up).

The next stage of corner identification involves looking at the connections between corners. These connections highly constrain the identify of the individual corners. For example, a T corner whose stem is connected to an L indicates that the T is a goal T and that the L is a corner of the goal box. If the T is also connected to another L then that L is going to be a field corner. This is a common configuration and generally narrows all of the identities to two possibilities depending on whether they are next to the blue or the yellow goal. If a goal post can also be seen then we can exactly match those corners.

We often see single corners. We can still often infer a great deal about these corners by taking into account other contextual information, such as the presence of goal posts. Let's run through the important cases.

T Corners

There are only 6 possible T corners. The first thing to look at with a T is the length of its stem. If the stem is long then it must be one of the two Side T corners. Another thing to look at is how close the T is to any goal posts that can also be seen. The relation between goals and Ts usually makes it easy to positively identify the T.

L Corners

With L corners we start with Inner vs Outer Ls.

Inner Ls are usually either field corners or are seen when the goalie is looking out. It is fairly easy to distinguish these cases by looking at whether there are any field lines further away from the two that make up the corner. If there are, then we have the case that we are looking out of the goal box. From there we can often identify whether we are looking at a left or a right goal corner based on the lengths of the individual lines and some orientation information. If there aren't any lines further away and if the field edge is relatively close to the corner then we have one of the field corners.

Starting with the assumption that the robot is on the field, Outer L corners are normally goal corners. Again we can use context such as the presence of Goal Posts, as well as information on the lengths of the two lines and the orientation to narrow down the list of possibilities for these corners.

Field Crosses

Field Crosses can only be positively identified when we also see at least one Goal Post. At that point it is simply a matter of determining the distance between the two and comparing that distance to what you would expect based on the actual field dimensions.

Goal Posts

See Goal Posts.