I am very new to opencv and deep learning using python. I am trying to remove watermark/logo from an image. I am able to find location of watermark by finding the location of cropped watermark image in the original image in the image which is constant for all the images. I need to remove found watermark.
Here is original image:[![original_image.jpeg][1]][1]
Original image2:[![enenter code here
ter image description here][2]][2]
Original image3:[![enter image description here][3]][3]
Cropped watermark image from original image: [![cropped_image.jpeg][4]][4]
Located watermark in the image: [![Located watermark][5]][5] I tried various code which uses tensorflow/deep learning below which din't generalise and given various error while running them.
For example I tried automatic-watermark-detection( https://github.com/rohitrango/automatic-watermark-detection) but it din't work. The crop_watermark() function in this library was not working for my image.It was cropping some other part of the image which is not water mark there was many other issue with code as well.
Similary I tried many other deep learning library with no luck.
I was also thinking to try cv2.inpaint(img,mask,3,cv2.INPAINT_TELEA)
but I don't have mask image. I have only one image with watermark on it as below so not able to use inpaint()
function as well.
Currently trying below simple code to find out exact location of the watermark in the image (by cropping the water mark manually and finding the location in the original image).
import numpy as np
import cv2
img = cv2.imread('original_image.jpeg')
print(img.shape)
h,w,c = img.shape
logo = cv2.imread("cropped_image.jpeg")
print(logo.shape)
hl,wl,cl = logo.shape
x1 = int(w/2-wl/2)
y1 = int(h/2-hl)
x2 = int(w/2+wl/2)
y2 = int(h/2)
cv2.rectangle(img, (x1, y1), (x2, y2), (255,0,0), 2)
cv2.imwrite("my.png",img)
cv2.imshow("lalala", img)
Above code is able to find correct coordinates of watermark. From here onwards I don't know how to proceed to remove watermark. It will be great if you can provide some sample code as well along with concept.
Thank you for help.