import cv2
import numpy as np

path = 'image.jpg'
img = cv2.imread(path)

hight,width,depth = img.shape[0:3]

thresh = cv2.inRange(img,np.array([240,240,240]),
                     np.array([255,255,255]))
kernel = np.ones((3,3),np.uint8)

hi_mask = cv2.dilate(thresh,kernel,iterations = 1)
specular = cv2.inpaint(img,hi_mask,5,flags = cv2.INPAINT_TELEA)

cv2.namedWindow("Image",0)
cv2.resizeWindow("Image",int(width/2),int(hight/2))
cv2.imshow("Image",img)

cv2.namedWindow("newImage",0)
cv2.resizeWindow("newImage",int(width/2),int(hight/2))
cv2.imshow("newImage",specular)
cv2.waitKey(0)
cv2.destroyAllWindows()

python去除马赛克,网上的

修改名称为 英文名称

2021-01-05

相关文章:

  • 2022-01-17
  • 2021-06-02
  • 2021-09-21
  • 2022-12-23
  • 2021-11-17
  • 2021-05-20
  • 2021-12-31
  • 2021-12-20
猜你喜欢
  • 2021-12-10
  • 2021-07-30
  • 2021-09-18
  • 2021-11-17
  • 2022-12-23
  • 2021-04-27
  • 2021-08-22
相关资源
相似解决方案