I am working on a project to translate comics completely. One of the steps requires me to remove all of the text from the image. I have tried using OpenCV's inpainting method, but it's not giving me a good result.
Note: The background can be dynamic, ranging from solid colors to designs. That's why I went with inpainting.
What can I do to fix this? If not, a new approach will also work.
My current approach:
Using the word level bounding boxes from Google Cloud Vision, I inpaint each of them using OpenCV's inpaint method
def remove_text(imagePath, bounds):
img = cv2.imread(imagePath)
mask = np.zeros(img.shape[:2],dtype="uint8")
for box in bounds:
points=np.array(box)
cv2.fillPoly(mask, np.int32([points]),(255,255,255))
img = cv2.inpaint(img,mask,1,cv2.INPAINT_TELEA)
return img
Original Image:

Text Removed:
