# 2016 Computer Vision System: Part 2 - Standard Filters

### Algorithm Sequence

Figure 1. Sequence of algorithms used for auto-aligning and auto-shooting with the high tower goal.

In order to identify and isolate the hightower goal, numerous filters must be applied. This post will cover the standard OpenCV filters that are used for isolating the target.

#### Gaussian Blur

Figure 2. Image before and after the Gaussian Blur is applied. Meaningless noise such as the wrinkles on the pants of the girl in the center are lost.

The image pulled from the camera is first processed through a Gaussian Blur in order to eliminate salt-and-pepper noise. The term “noise” refers to regions of the image that are highly detailed, but are not helpful in achieving the objective. For example, someone may be wearing a fabulous shirt with thousands of colorful dots, but that shirt will make any computer vision programmer cringe since it will slow filters that measure color consistency.

#### HSV Color Threshold

Figure 3. HSV color space, represented in a 3-D model. Each channel serves a different purpose.

The image is then converted into the HSV color space (split into three channels) because it is simple, yet still capable of storing information about light intensity. HSV is more suited for our task than the traditional RGB (red, green, blue) color space that most people are familiar with because of the fact that the retroreflective tape will shine with high intensity (since the light is an LED).

Figure 4. Retroreflective tape is made by combining such “corner reflectors” in order to consistently reflect light back towards the source.

Retroreflective tape shines light directly back at the source because it is covered by tiny L-shaped ridges that resemble corners (Figure 4). By placing a light source next to a camera, we can distinctly identify the retroreflective tape because it will shine incredibly brightly. For FRC, most teams place a ring of LED lights around a camera.

After tuning the parameters such that the retroreflective tape is clearly identified (at this point, a little surrounding noise is fine, but the tape should be isolated), the contours and minimally sized bounded rectangle are extracted from the image.