import cv2
import numpy as np
# 均值滤波
def blurImg(img):
img = cv2.blur(img,(7,7))
return img
# 高斯滤波
#
# 0.6 0.8 0.6
# 0.8 1 0.8
# 0.6 0.8 0.6
#
def gaussianBlurImg(img):
aussian = cv2.GaussianBlur(img,(1111,1111,),1)
return aussian
# 中值滤波
def medianBlurImg(img):
median = cv2.medianBlur(img,5)
return median
img = cv2.imread("img1.png")
# img = blurImg(img)
# img = gaussianBlurImg(img)
img = medianBlurImg(img)
cv2.imshow("img",img)
cv2.waitKey(0)
cv2.destroyAllWindows()
计算机视觉 opencv python 平滑处理
最新推荐文章于 2022-04-15 09:37:18 发布