C# 在图像中定位文本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1848/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-07-31 12:59:52  来源:igfitidea点击:

Locating Text within image

提问by Pat

I am currently working on a project and my goal is to locate text in an image. OCR'ing the text is not my intention as of yet. I want to basically obtain the bounds of text within an image. I am using the AForge.Net imaging component for manipulation. Any assistance in some sense or another?

我目前正在做一个项目,我的目标是在图像中定位文本。到目前为止,对文本进行 OCR 处理并不是我的意图。我想基本上获得图像中文本的边界。我正在使用 AForge.Net 成像组件进行操作。在某种意义上有什么帮助吗?

Update 2/5/09: I've since went along another route in my project. However I did attempt to obtain text using MODI (Microsoft Office Document Imaging). It allows you to OCR an image and pull text from it with some ease.

2009 年 2 月 5 日更新:从那以后,我在我的项目中走了另一条路线。但是我确实尝试使用 MODI(Microsoft Office Document Imaging)获取文本。它允许您对图像进行 OCR 并轻松从中提取文本。

采纳答案by Louis Brandy

This is an active area of research. There are literally oodles of academic papers on the subject. It's going to be difficult to give you assistance especially w/o more deatails. Are you looking for specific types of text? Fonts? English-only? Are you familiar with the academic literature?

这是一个活跃的研究领域。有大量关于这个主题的学术论文。很难为您提供帮助,尤其是没有更多详细信息。您是否正在寻找特定类型的文本?字体?仅限英语?你熟悉学术文献吗?

"Text detection" is a standard problem in any OCR (optical character recognition) system and consequently there are lots of bits of code on the interwebs that deal with it.

“文本检测”是任何 OCR(光学字符识别)系统中的标准问题,因此互联网上有很多处理它的代码。

I could start listing piles of links from google but I suggest you just do a search for "text detection" and start reading :). There is ample example code available as well.

我可以开始从谷歌列出成堆的链接,但我建议你只搜索“文本检测”并开始阅读:)。还有大量的示例代码可用。

回答by sven

recognizing text inside an image is indeed a hot topic for researchers in that field, but only begun to grow out of control when captcha'sbecame the "norm" in terms of defense against spam bots. Why use captcha's as protection? well because it is/was very hard to locate (and read) text inside an image!

识别图像中的文本确实是该领域研究人员的热门话题,但直到验证成为防御垃圾邮件机器人的“规范”时才开始失控。为什么使用验证码作为保护?好吧,因为在图像中定位(和阅读)文本非常困难!

The reason why I mention captcha's is because the most advancement* is made within that tiny area, and I think that your solution could be best found there. especially because captcha's are indeed about locating text (or something that resembles text) inside a cluttered image and afterwards trying to read the letters correctly.

我之所以提到验证码,是因为在那个小区域内取得了最大的进步*,我认为最好在那里找到您的解决方案。特别是因为验证码确实是关于在杂乱的图像中定位文本(或类似于文本的东西),然后尝试正确阅读字母。

so if you can find yourself a good open source captcha breaking toolyou probably have all you need to continue your quest...
You could probably even throw away the most dificult code that handles the character recognition itself, because those OCR's are used to read distorted text, something you don't have to do.

所以如果你能找到一个很好的开源验证码破解工具,你可能拥有继续你的探索所需的一切......
你甚至可以扔掉处理字符识别本身的最困难的代码,因为这些 OCR 用于阅读扭曲的文本,你不必做的事情。

*: advancement in terms of visible, usable, and practicalinformation for a "non-researcher"

*:“非研究人员”在可见、可用和实用信息方面的进步

回答by Eugene Osovetsky

If you're ok with using an online API for this, the API at http://www.wisetrend.com/wisetrend_ocr_cloud.shtmlcan do text detection in addition to just OCR.

如果您同意为此使用在线 API,那么http://www.wisetrend.com/wisetrend_ocr_cloud.shtml 上的 API除了 OCR 之外还可以进行文本检测。

回答by Mathias

Stroke width transformcan do that for you. That's at least what MS developed for their mobile phone OS. A discussion on the implementation is here at https://stackoverflow.com/

笔画宽度变换可以为您做到这一点。这至少是微软为他们的手机操作系统开发的。关于实现的讨论在 https://stackoverflow.com/