其他分享
首页 > 其他分享> > 19_毛玻璃效果

19_毛玻璃效果

作者:互联网

import cv2
import numpy as np
import random
img = cv2.imread('ruonan.jpg',1)
Info = img.shape
height = Info[0]
width = Info[1]
dst = np.zeros((height,width,3),np.uint8)
mm = 8
for i in range(mm,height):
 for j in range(mm,width):
  index = int(random.random()*8)
  (b,g,r) = img[i-index,j-index]
  dst[i,j] = (b,g,r)
cv2.imshow('dst',dst)
cv2.waitKey(0)

标签:index,img,效果,19,dst,random,cv2,height,毛玻璃
来源: https://blog.51cto.com/u_14229365/2923894