I have a image like below,
I would like to remove background watermark.
So far I tried, inpainting
method in opencv
. It didn't help me.
I tried following script:
edges = cv2.Canny(img,50,150,apertureSize = 3)
dst = cv2.inpaint(img,edges,3,cv2.INPAINT_TELEA)
I am new to image processing and opencv
. So, I don't know whether I'm doing in the correct way or not for performing inpainting. What method should I do for removing background watermarks.
I would like to remove green quoted watermark from my image.
any help would be more appreciable.
If the watermarks are added using a Shape class object then to remove the watermark from a document you have to set only the name of watermark shape during inserting and then remove watermark shape by an assigned name.
Text here has a different intensity than the watermark. You could play around with a simple brightness/contrast transformation, i.e. increasing gain/contrast until the watermark vanishes and reducing brightness to compensate.
See OpenCV docs for a simple tutorial.
Here's a quick attempt in Python, not really using OpenCV
because it's not needed IMHO for such a simple linear transformation. Play around with alpha
(contrast) and beta
(brightness) parameters until you get the result you want
import cv2
import numpy as np
img = cv2.imread("veidz.jpg")
alpha = 2.0
beta = -160
new = alpha * img + beta
new = np.clip(new, 0, 255).astype(np.uint8)
cv2.imwrite("cleaned.png", new)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With