如何从一组相似的图像中删除虚线的水印?

编程入门 行业动态 更新时间:2024-10-14 06:18:48
本文介绍了如何从一组相似的图像中删除虚线的水印?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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()

更多推荐

如何从一组相似的图像中删除虚线的水印?

本文发布于:2023-11-30 16:54:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1650775.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:虚线   水印   图像

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!