#!/usr/bin/env python# _*_ coding:utf-8 _*_import cv2 as cvimport numpy as np def blur_demo(image): dst = cv.blur(image, (15, 1)) cv.imshow("blur_demo", dst) src = cv.imread("F:/miao3.png")cv.namedWindow("input image", cv.WINDOW_AUTOSIZE)cv.imshow("input image", src)blur_demo(src)cv.waitKey(0)cv.destroyAllWindows()
#!/usr/bin/env python# _*_ coding:utf-8 _*_import cv2 as cvimport numpy as np def custom_blur_demo(image): kernel = np.array([[0, -1, 0], [-1, 5, -1], [0, -1, 0]], np.float32) #锐化 dst = cv.filter2D(image, -1, kernel=kernel) cv.imshow("custom_blur_demo", dst) src = cv.imread("F:/miao3.png")cv.namedWindow("input image", cv.WINDOW_AUTOSIZE)cv.imshow("input image", src)custom_blur_demo(src)cv.waitKey(0)cv.destroyAllWindows()