%matplotlib inline
Some simple usage of Scipy.ndimage
Bluring image
from PIL import Image
import numpy as np
from scipy.ndimage import filters
from matplotlib import pyplot as plt
blur gray image
im = np.array(Image.open(u'测试图片集/1.jpg').convert('L'))
im2 = filters.gaussian_filter(im,3)
im3 = filters.gaussian_filter(im,5)
plt.subplot(1,3,1)
plt.axis('off')
plt.imshow(im,cmap='gray')
plt.title('original')
plt.subplot(1,3,2)
plt.axis('off')
plt.imshow(im2,cmap='gray')
plt.title('gaussian(kernel 3)')
plt.subplot(1,3,3)
plt.axis('off')
plt.imshow(im3,cmap='gray')
plt.title('gaussian(kernel 5)')
<matplotlib.text.Text at 0x837a1d0>
blur color image
To blur color images, simply