an original image
1 code
from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是测试图像之一
plt.figure()#创建图形
plt.imshow(face)#绘制测试图像
plt.show()#原始图像
2 Running results
![](http://dl2.iteye.com/upload/attachment/0126/4169/44f078b1-df7a-3ede-a7ad-6a1495e4709a.png)
Two Gaussian filter
1 code
from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是测试图像之一
plt.figure()#创建图形
blurred_face = ndimage.gaussian_filter(face, sigma=7)#高斯滤波
plt.imshow(blurred_face)
plt.show()
2 Running results
![](http://dl2.iteye.com/upload/attachment/0126/4171/244b9c8c-a97b-3e64-94f0-9635abada7e4.png)
Three edge sharpening
1 code
from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是测试图像之一
plt.figure()#创建图形
blurred_face1 = ndimage.gaussian_filter(face, sigma=1)#边缘锐化
blurred_face3 = ndimage.gaussian_filter(face, sigma=3)
sharp_face = blurred_face3 +6*(blurred_face3-blurred_face1)
plt.imshow(sharp_face)
plt.show()
2 Running results
![](http://dl2.iteye.com/upload/attachment/0126/4173/aca13b33-838b-3725-9aee-dc7d487b582a.png)
Four median filter
1 code
from scipy import misc
from scipy import ndimage
import matplotlib.pyplot as plt
face = misc.face()#face是测试图像之一
plt.figure()#创建图形
median_face = ndimage.median_filter(face,7)#中值滤波
plt.imshow(median_face)
plt.show()
2 Running results
![](http://dl2.iteye.com/upload/attachment/0126/4175/364db0ac-1b29-397e-9c03-59b091d8bc34.png)