答案 0 :(得分:0)
您可以使用图像修复删除这些线条。但需要先做一个面具。看看这个- http://docs.opencv.org/trunk/df/d3d/tutorial_py_inpainting.html
这段代码(python)帮助你制作一个面具:
import cv2
import numpy as np
imgg=cv2.imread("your_image.png")
flag = False
def draw(event,x,y,flags,param):
global flag
if event == cv2.EVENT_LBUTTONDOWN:
flag = True
elif event == cv2.EVENT_MOUSEMOVE:
if flag == True:
cv2.circle(img,(x,y),2,(255,255,255),-1)
elif event == cv2.EVENT_LBUTTONUP:
flag = False
img = np.zeros(imgg.shape[:2], np.uint8)
cv2.namedWindow('image')
cv2.setMouseCallback('image',draw)
while(1):
cv2.imshow('image',imgg)
cv2.imshow("mask",img)
if(cv2.waitKey(1))==27:
break
cv2.imwrite("mask.png",img)
cv2.destroyAllWindows()