In order to see the goals taped with the retro-reflective tape, we attached our robot with an IR LED and take a picture of the frame. Then, we take a picture with the LED off. By setting a specific threshold, we can find pixel with the difference between the 2 images being more than the specified region. Finally, we draw a box around these collection of pixel, and identify the center of the box.

This method allow us to detect a goal regardless of its color and shape. In addition to that, it provides us with a slightly better accuracy than a single-frame shape recognition algorithm. However, it does come with a couple of issues. First, the pixel-by-pixel operation in the OpenMV is really slow, making the FPS dropped whenever the function is called. Furthermore, this function would not work if there is 2 or more goals within the frame (which is very unlikely but would render the function inaccurate if it happen).

Next Post Previous Post