如何从一组相似的图像中删除虚线的水印? [英] How to erase the dotted watermark from set of similar images?

查看:233
本文介绍了如何从一组相似的图像中删除虚线的水印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要自动完成将一组图像输入到数字生成系统中的任务.在此之前,我想删除在这些图像中很常见的虚线水印.

I want to automate the task of entering set of images into a number generating system & before that i like to remove a dotted watermark which is common across these images.

我尝试使用Google,tesseract&经验丰富的读者,但是我发现不包含水印的图像部分可以被很好地识别,但是带有水印的部分几乎是无法识别的.

I tried using google, tesseract & abby reader, but I found that the image part that does not contain the watermark is recognized well, but the part that is watermarked is almost impossible to recognize.

我想使用图像处理删除水印.我已经尝试过一些opencv,python,matlab等示例代码,但都不符合我的要求...

I would like to remove the watermark using image processing. I already tried few sample codes of opencv, python, matlab etc but none matching my requirements...

这是我尝试过的Python示例代码,它可以更改亮度&黑暗:

Here is a sample code in Python that I tried which changes the brightness & darkness:

import cv2
import numpy as np
img = cv2.imread("d:\\Docs\\WFH_Work\\test.png")
alpha = 2.5
beta = -250
new = alpha * img + beta
new = np.clip(new, 0, 255).astype(np.uint8)
cv2.imshow("my window", new)

通常,我不知道该图像的水印包括多少个像素.有没有办法摆脱此水印或通过代码使数字变暗并降低水印的暗度?

Unusually, i dont know the watermark of this image consists how many pixels. Is there a way to get rid of this watermark OR make digits dark and lower the darkness of watermark via code?

这是水印图像

推荐答案

我正在使用dilate删除图形,然后找到边缘以检测水印.通过水印内的主要灰色将其删除

I am using dilate to remove the figures, then find the edge to detect watermark. Remove it by main gray inside watermark

import cv2
import numpy as np
from matplotlib import pyplot as plt

img = cv2.imread('test.png', 0)

kernel = np.ones((10,10),np.uint8)

dilation = cv2.dilate(img,kernel,iterations = 1) 
erosion = cv2.erode(dilation,kernel,iterations = 1)


plt.imshow(erosion, cmap='gray')
plt.show()

#contour
gray = cv2.bilateralFilter(erosion, 11, 17, 17)
edged = cv2.Canny(gray, 30, 200)

plt.imshow(edged, cmap='gray')
plt.show()

这篇关于如何从一组相似的图像中删除虚线的水印?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆