opencv python版-lesson 16

均值滤波,高斯滤波,双边滤波

# -*- coding: utf-8 -*-
import cv2
import numpy as np
import matplotlib.pyplot as mp

img = cv2.imread('opencv.jpg')

blur = cv2.blur(img,(50,50))
gaussian_blur = cv2.GaussianBlur(img,(5,5),0)
median =cv2.medianBlur(img,5)
biblur=cv2.bilateralFilter(img,9,75,75)

mp.subplot(231),mp.imshow(img),mp.title('original')
mp.xticks([]),mp.yticks([])

mp.subplot(232),mp.imshow(blur),mp.title('aver')
mp.xticks([]),mp.yticks([])

mp.subplot(233),mp.imshow(gaussian_blur),mp.title('aver')
mp.xticks([]),mp.yticks([])

mp.subplot(234),mp.imshow(blur),mp.title('aver')
mp.xticks([]),mp.yticks([])

mp.subplot(235),mp.imshow(blur),mp.title('aver')
mp.xticks([]),mp.yticks([])

mp.show()

你可能感兴趣的:(opencv python版-lesson 16)