如何检测图像中的单词

发布于 2024-08-10 13:56:09 字数 361 浏览 3 评论 0原文

我需要找出用户点击的图像中的单词。到目前为止,我已经成功对图像进行 OCR 处理。我的 C# 应用程序中有一个图片框控件。用户可以在任何文本周围绘制一个框并将其拖动到文本框以填充文本框。我已经完成了这个。但现在我有一个新的要求,说用户可以选择一个文本框,然后单击图像中的单词,以便将该单词填充到文本框中。

我不知道如何继续。如何从图像中单独剪切单词部分并将其提供给 OCR?用户可以单击单词的任何部分。

请给我任何指示。我应该遵循什么算法来找到用户点击的单词的边界。如果我找到了边界,我可以使用 copyfromscreen 方法将其从图像中剪切出来,并将其交给 ocr 引擎来获取文本。

希望我在这里说清楚了我的问题。

谢谢和问候, 迪内什。

I need to find out the word in an image where user has clicked. So far i have succeeded in OCRing the image. I have a picturebox control in my c# app. user can draw a box around any text and drag it to a textbox to fill the textbox with it. I have completed this. But now i have a new requirement saying user can select a textbox and then click on a word in the image so that the word is filled in the text box.

I have no clue on how to proceed. How can i cut the word portion alone from the image and give it to OCR. User can click on any part of the word.

Please give me any pointers. What algorithm should i follow to find the boundaries of the word on which user clicks. IF i found the boundaries i can cut it from the image using copyfromscreen method and will give it to ocr engine to get the text.

Hope i made my problem clear here.

Thanks and Regards,
Dinesh.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

撩心不撩汉 2024-08-17 13:56:09

如果您的 OCR 正常工作,我最初的方法是尝试以初始点击点为中心进行某种搜索。

IE。在用户点击的地方制作一个小框,OCR,如果有噪音,制作一个更大的框,OCR,重复,直到 OCR 结果命中。

If you have the OCR working, my initial approach would be to attempt some sort of search centering on the initial click point.

Ie. Make a small box around where the user clicked, OCR, if all noise, make a bigger box, OCR, repeat until the OCR results in a hit.

深府石板幽径 2024-08-17 13:56:09

如果您已获得 OCR 数据,根据 OCR 库,您也许能够执行反向查找并确定指定像素坐标处的字符。我使用过的 OCR 库为每个字符提供矩形坐标,然后可以将其分组为单词(组合矩形)。那么问题就是确定点击发生在哪个矩形内。

If you've got the OCR data, depending on the OCR library, you might be able to perform a reverse lookup and determine the character at the specified pixel coordinates. The OCR libraries I've worked with provide rectangle coordinates for each character, which in turn can be grouped into words (combining the rects). The problem then is simply to determine inside which rectangle the click occurred.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文