OpenCV-马赛克算法
规定
m,n 变量为所取马赛克范围
1. 马赛克算法
import cv2
import numpy as np
img = cv2.imread("../01_Img/01.jpg", 1)
imgInfo = img.shape
for m in range(100, 150):
for n in range(100, 150):
if m%10 == 0 and n%10 == 0:
for i in range(0, 10):
for j in range(0, 10):
(b, g, r) = img[m, n]
img[i+m, j+n] = (b, g, r)
cv2.imshow("dst", img)
cv2.waitKey(0)
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Panzer_Jack の 博客!
评论