CANNY’S ALGORITHM

JPPPPP
UCL-COMP0016–2020-Team13
3 min readNov 30, 2020

--

To grade every move by the player, we need to first recognize the player. We found that applying Canny’s Algorithm, we can create a new image showing the edge of a person from the input image. Canny’s algorithm is a multi-stage algorithm consists of four stages.

The first step of Canny’s Algorithm is to remove noise with a 5x5 Gaussian filter. Gaussian filter is a linear filtering which can reduce Gaussian Noise. Generally, Gaussian filter is a process of doing weighted average to the whole image. Every pixel value in the image is obtained by doing weighted average to the value of the pixel value and the pixel value around the pixel. In practice, Gaussian filter uses a template to scan every pixel in the image and using template to determine the weighted average gray value in the domain to replace the original value at the center pixel of the template.

Before
After

https://blog.csdn.net/sunmc1204953974/article/details/50634652

https://docs.opencv.org/master/da/d22/tutorial_py_canny.html

And the final step:

https://docs.opencv.org/master/da/d22/tutorial_py_canny.html

OpenCV puts all of above into a single function cv.Canny() and here is the code:

OpenCV: Canny Edge Detection

Let’s test it on some images!

Before (London Bridge)
After
Before
After

As we can see, cv.Canny() has drawn an image with white colour showing edges of the input image. However, it shows too much detail that is not needed. For example, from the result of the second input picture, we could not see where the person is. However, it does outlined the edges of other things in the picture, but did poorly outlining persons in the picture. To sum up, Canny’s Algorithm might not be the best solution to this, more research needs to be done for a better algorithm.

--

--