import cv2
import numpy as np
import random
img = cv2.imread("E:/code/conputer_visual/data/0.jpg", 1)
cv2.imshow("pre", img)
imginfo = img.shape
height = imginfo[0]
width = imginfo[1]
dst = np.zeros((height, width, 3), np.uint8)
mm = 4
for m in range(0, height):
for n in range(0, width):
if m > height-mm or n > width-mm:
(b,g,r) = img[m, n]
dst[m,n] = (b,g,r)
else:
index = int(random.random()*4)
(b,g,r) = img[m+index, n+index]
dst[m,n] = (b,g,r)
cv2.imshow("dst", dst)
cv2.waitKey()
すりガラスのOpencv画像効果
おすすめ
転載: blog.csdn.net/cyj5201314/article/details/114646608
おすすめ
ランキング