opencv python版-lesson 16

2019-10-17  本文已影响0人  writ

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

# -*- 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()
上一篇下一篇

猜你喜欢

热点阅读