从图像中删除(裁剪)文本

问题描述 投票:0回答:2

我正在尝试实现一个图像识别程序,我需要删除(或“裁剪”)图像上存在的所有文本,例如:

enter image description here

对此:

enter image description here

我已经尝试过Keras OCR方法,但首先我不需要背景模糊,我只需要删除文本,其次它需要大量的时间和CPU能力。有没有更简单的方法来检测这些文本区域并简单地将它们从图片中裁剪出来?

python opencv keras ocr
2个回答
0
投票

一种方法是使用 findContours 检测文本 - 具有区域的文本 < threshold are letters, then paint over these areas, or/and first find their bounding rectangle and paint a big one.

检测具有轮廓的文本区域后从图像中提取文本

还有 pytesseract 来检测字母及其区域,但我猜它会比轮廓重。

这是我使用 pytesseract 的一个示例项目:如何从 pytesseract 获得最佳结果?


0
投票

我只想从图像中删除示例文本我不想删除所有文本,只需从文本中删除示例

© www.soinside.com 2019 - 2024. All rights reserved.