Let's Implement a Gaussian Blur Algorithm in Python
Implementing an algorithm sounds scary, but in reality, we're just taking a recipe and translating it into a language the computer can understand (code). I thought it would be fun to make a tutorial on implementing a simple graphics algorithm. From the title, you'll know we're going to be implementing gaussian blur, with the help of OpenCV. OpenCV is a computer vision library you can use in Python to do lots of cool things, from face recognition to image segmentation. In fact, it has a gaussian blur implementation built in to it! We won't be using that though, of course - what we will use is its ability to easily read and write images, as well as comparing our implementation of gaussian blur to its implementation. Setup Before we dive into code, we need to get 2 things done: 1) Understand the gaussian blur algorithm (recipe) 2) Install OpenCV and numpy (if you don't have them) First, let's understand gaussian blur. Since we're implementing it in code, we can...