- import cv2
- import numpy as np
- img = cv2.imread("./img/lena.jpg")
- img = cv2.resize(img, None, fx=0.5, fy=0.5) #为了完整显示,缩小一倍
- blur2 = cv2.blur(img, (2,2))#模糊处理
- blur3 = cv2.blur(img, (5,5))
- blur4 = cv2.blur(img, (10,10))
- htich = np.hstack((img,blur2))
- htich2 = np.hstack((blur3,blur4))
- vtich = np.vstack((htich, htich2))
- cv2.imshow("mergedDemo", vtich)
- cv2.waitKey(0)
- cv2.destroyAllWindows()
复制代码
|