平均滤波器
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import matplotlib.pyplot as mp
img = cv2.imread('opencv.jpg')
kernel = np.ones((5,5),np.float32)/25
dst=cv2.filter2D(img,-1,kernel)
mp.subplot(121),mp.imshow(img),mp.title('original')
mp.xticks([]),mp.yticks([])
mp.subplot(122),mp.imshow(dst),mp.title('aver')
mp.xticks([]),mp.yticks([])
mp.show()