标签:python
#encoding:utf-8
import numpy as np
import cv2
image = cv2.imread("H:\\img\\lena.jpg")
cv2.imshow("Original",image)
cv2.waitKey(0)
#领域均值滤波
blurred = np.hstack([cv2.blur(image,(3,3)),
cv2.blur(image,(5,5)),
cv2.blur(image,(7,7))
])
cv2.imshow("Averaged",blurred)
cv2.waitKey(0)
#encoding:utf-8
import numpy as np
import cv2
image = cv2.imread("H:\\img\\lena.jpg")
cv2.imshow("Original",image)
cv2.waitKey(0)
#高斯滤波
blurred = np.hstack([cv2.GaussianBlur(image,(3,3),0),
cv2.GaussianBlur(image,(5,5),0),
cv2.GaussianBlur(image,(7,7),0)
])
cv2.imshow("Gaussian",blurred)
cv2.waitKey(0)
#encoding:utf-8
import numpy as np
import cv2
image = cv2.imread("H:\\img\\lena.jpg")
cv2.imshow("Original",image)
cv2.waitKey(0)
#中值滤波
blurred = np.hstack([cv2.medianBlur(image,3),
cv2.medianBlur(image,5),
cv2.medianBlur(image,7)
])
cv2.imshow("Median",blurred)
cv2.waitKey(0)
#encoding:utf-8
import numpy as np
import cv2
image = cv2.imread("H:\\img\\lena.jpg")
cv2.imshow("Original",image)
cv2.waitKey(0)
#双边滤波
blurred = np.hstack([cv2.bilateralFilter(image,5,21,21),
cv2.bilateralFilter(image,7, 31, 31),
cv2.bilateralFilter(image,9, 41, 41)
])
cv2.imshow("Bilateral",blurred)
cv2.waitKey(0)
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:python
原文地址:http://blog.csdn.net/jnulzl/article/details/47751983