python去除视频水印_如何删除图像Python中的水印背景

1586010002-jmsa.png

I have a image like below,

veidz.jpg

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.

BWBU3.png

any help would be more appreciable.

解决方案

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)

al6n1.png

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值