Title: Blurring Images
Slug: blurring_images
Summary: How to blurring images using OpenCV in Python.
Date: 2017-09-11 12:00
Category: Machine Learning
Tags: Preprocessing Images
Authors: Chris Albon

Preliminaries


In [1]:
# Load image
import cv2
import numpy as np
from matplotlib import pyplot as plt

Load Image As Greyscale


In [2]:
# Load image as grayscale
image = cv2.imread('images/plane_256x256.jpg', cv2.IMREAD_GRAYSCALE)

Blur Image


In [3]:
# Blur image
image_blurry = cv2.blur(image, (5,5))

View Image


In [4]:
# Show image
plt.imshow(image_blurry, cmap='gray'), plt.xticks([]), plt.yticks([])
plt.show()