从图像中读取字符

发布于 2024-09-05 09:52:29 字数 282 浏览 2 评论 0原文

我正在开发一个应用程序,该应用程序需要将扫描图像文件中的数字与数据库条目进行匹配,并使用匹配结果更新数据库。

假设我有图像-employee1.jpg。该图像将有两个两个手写条目 - 员工编号和要支付给员工的金额。我必须从图像中读取员工编号,并在数据库中查询该编号,用从图像中获取的待支付金额更新员工。员工编号和要支付的金额都写在图像上指定位置的两个方框内。

有什么办法可以自动化这个操作吗?基本上我想要一个使用 c# 的 .net 解决方案。我知道这可以使用人工神经网络来完成。

任何想法将不胜感激。

I am working on an application which requires matching of numbers from a scanned image file to database entry and update the database with the match result.

Say I have image- employee1.jpg. This image will have two two handwritten entries - Employee number and the amount to be paid to the employee. I have to read the employee number from the image and query the database for the that number, update the employee with the amount to be paid as got from the image. Both the employee number and amount to be paid are written inside two boxes at a specified place on the image.

Is there any way to automate this. Basically I want a solution in .net using c#. I know this can be done using artificial neural networks.

Any ideas would be much appreciated.

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

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

发布评论

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

评论(5

柳絮泡泡 2024-09-12 09:52:29

您可以使用 Microsoft Office Document Imaging Library (MODI),它包含在 Office 2003/2007 中。

链接:

You can use Microsoft Office Document Imaging Library (MODI), which is contained in the Office 2003/2007.

Links:

我也只是我 2024-09-12 09:52:29

模式识别是研究神经网络时的一个基本例子。我不知道是否有任何库/框架可以在 C# 中使用 AI。如果你找到了,首先你要做的是训练网络(监督学习),为此你需要准备一个大的图像样本集;更多例子->结果更准确。另一方面,您可以使用 OpenCV(C/C++、Python 和 Java),它是一个专门用于计算机视觉的库,并且具有实现 AI 方法的模块。

祝你今天过得愉快!
奥斯卡.

Pattern recognition is a basic example when neural networks are studied. I don't know if is any library/framework to work with AI in C#. If you find one, first you have to do is to train the network (supervised learning) and for this you need to prepare a big sample set of images; more examples -> result more accurate. In the other hand you can use OpenCV (C/C++, Python and Java) that is a library specialized in computer vision and has a module to implement AI methods.

Have a nice day!
Oscar.

归途 2024-09-12 09:52:29

我认为这很难自动化。问题只是因为你需要某种非常好的 OCR 软件。即使你得到了这个,如果它读错了,因为某人的笔迹模糊怎么办?如果 ID 错误,付款就会记入错误的员工,如果金额错误,他就会得到错误的工资!

这两件事你都不会真正发生。只是为了向您展示找到一个好的 OCR 有多难,只需看看 captcha< /a> 有效。其原理只不过是难以阅读的文本的图像。

所以我的观点是,你不能真正自动化这个过程。至少您可以编写一个程序来通过手动输入值来帮助人类(另请查看 Amazon Mechanical Turk ):

  • 在右边显示带有手写值的图片,或者如果它们总是在同一位置或有专门标记(周围有一个框等),请尝试自动找到这些位置并将它们显示给用户。
  • 左侧提供两个文本框,用户可以在其中输入值。

为了实现快速流畅的过程,您必须非常注意用户如何仅使用键盘即可轻松输入值:

  • 显示新图片时,将焦点设置到 id 文本框
  • 如果用户 id 始终为特定长度,如果输入了所有数字,则切换到下一个框
    • (如果您允许这样做,则下一个空框中的退格键应将焦点返回到上一个框)
  • 否则允许通过按选项卡返回来更改下一个文本框
  • 通常这些文本框是排列的彼此之上(而不是并排),因此您应该支持使用向上向下箭头键在它们之间进行切换。
  • 完成最后一个文本框中的输入后,自动显示下一个图像。
    • 此外,在这种情况下,如果是全新条目(尚未输入任何内容),则可以使用退格键或向左箭头键轻松切换回旧条目

通过使用这样的过程,一个人可以在您的数据库,并且成本比事后在数据库中查找错误条目要便宜得多。

最后一个建议:
因为这对于人类来说是一个无聊的过程,很容易导致错误,也许让两个人输入这些值,并且只有当两个人输入相同的值时才认为该值已被批准。这应该会导致正确率高于 99%。如果您绝对需要 100%,请考虑让 4-5 个人检查一项条目,并且只有当所有人都输入相同的值时才将其视为已批准。为了比较您的 ocr 软件有多好,只需让它也运行您的图像并将此结果与人类输入的值进行比较以获得一个想法,而您实际上只能依赖您的 ocr。

I think this is very hard to automate. The problem is just because you need some kind of very good OCR software. And even if you got this, what if it reads something wrong, cause of the frouzy handwriting of someone? If the ID is wrong the paid is booked to the wrong employee and if the amount is wrong he got the wrong salary!

Both are things you won't really happen. Just to show you how hard a good ocr to find is, just take a look out there on how a captcha works. The principle is nothing more than an image of an hard to read text.

So my opinion would be, that you can't really automate this process. At least you can write a program to assist a human by entering the values manually (also take a look at Amazon Mechanical Turk):

  • Show on the right the picture with the handwritten values, or if they are always on the same position or specially marked (with a box around them, etc.), try to find these places automatically and show them to the user.
  • On the left offer two textboxes, where the user can enter the values.

To get this to a fast and fluent process, you have to take great care about how the user can enter easily the values by just using the keyboard:

  • When showing a new picture, set the focus to the id textbox
  • If the user id is always a specific length, switch to the next box if all numbers are entered
    • (If you allow this, a backspace in the empty next box should focus back to the previous one)
  • Otherwise allow a change to the next textbox by hitting tab or return
  • Normally these textboxes are arranged above each other (not side by side), thus you should support switching between them using the up down arrow keys.
  • After finishing the entry in the last textbox automatically show the next image.
    • Also in this case of a fresh new entry (nothing already entered) allow a easy switch back to the old entry by using the backspace or left arrow key)

By using such a process a single person can enter many entries into your database and the costs are much cheaper than finding wrong entries in your database afterwards.

Just a last suggestion:
Cause this is a boring process for a human which can easily leads to errors, maybe let two people enter these values and only if both are entering the same than take this value as approved. This should lead to a correct rate somewhere above 99%. If you need absolutely 100% think about letting 4-5 people checking one entry and only if all of them enter the same values take it as approved. To get also a comparsion about how good your ocr software would be, just let it also run over your images and compare this results to the human entered values to get an idea, when you can really rely on your ocr only.

爱她像谁 2024-09-12 09:52:29

OCR 引擎未经过训练来读取手写文本,因此您可能会在使用 MODI 时遇到问题。您想尝试找到一个 ICR 引擎。即便如此,其中最好的模型在良好输入的情况下准确率也只有 80%。您可能会变得更好,因为您知道您的文本始终是数字。

这个 SO 问题/答案说 OCROpus 具有 ICR

FOSS 智能字符识别 (ICR)

OCR engines are not trained to read handwritten text, so you might have trouble with MODI. You want to try to find an ICR engine. Even so, the best ones of these are only 80% accurate on good inputs. You might get better because you know that your text is always numbers.

This SO question/answer says that OCROpus has ICR

FOSS Intelligent Character Recognition (ICR)

差↓一点笑了 2024-09-12 09:52:29

有用于 OCR/ICR 的 LeadTools SDK。这对于识别手写字符非常方便。我正在对此进行可行性研究,到目前为止我认为它会成功。 LeadTools 提供了可在您的应用程序中使用的组件,它支持 C、C++、C#、VB.Net 等。

您可以访问以下链接:
http://www.leadtools.com/downloads/default.htm?category=< /a>

There is LeadTools SDK for OCR/ICR. This is very handy in recognising the handwritten characters. I am doing a feasibilty study with this, and till now I think it will work out. leadTools have provided components which can be used in your application, it supports C, C++, C#, VB.Net etc.

You can visit the following link for this:
http://www.leadtools.com/downloads/default.htm?category=

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