马赛克
img = cv2.imread('./bao.jpeg')
print(img.shape)
img2 = cv2.resize(img,(35,23))
img3 = cv2.resize(img2,(900,666))
cv2.imshow('bao',img3)
cv2.waitKey(0)
cv2.destroyAllWindows()
![](https://img-blog.csdnimg.cn/direct/54f520fc65fc4378b1ed4b2b1e8cd35b.png)
![](https://img-blog.csdnimg.cn/direct/9e2d8fe4e78949f9b44fce3111045234.png)
img2 = cv2.resize(img, (90,66))
img3 = np.repeat(img2, 10, axis= 0) # 重复行
img4 = np.repeat(img3, 10, axis=1) # 重复列
cv2.imshow('bao',img4)
cv2.waitKey(0)
cv2.destroyAllWindows()
![](https://img-blog.csdnimg.cn/direct/bcdd3c2cebcb43d999cadfca0228ac4f.png)
img2 = img[::10, ::10] # 每10个中取出一个像素
cv2.namedWindow('bao', flags=cv2.WINDOW_NORMAL)
cv2.resizeWindow('bao', 900, 666)
cv2.imshow('bao', img2)
cv2.waitKey(0)
cv2.destroyAllWindows()
![](https://img-blog.csdnimg.cn/direct/d35f9c23a1344c52a9082a57d8723418.png)