从图像中读取字符
我正在开发一个应用程序,该应用程序需要将扫描图像文件中的数字与数据库条目进行匹配,并使用匹配结果更新数据库。
假设我有图像-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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用 Microsoft Office Document Imaging Library (MODI),它包含在 Office 2003/2007 中。
链接:
项目 - 使用 MODI
维基百科 - 包含一个简单的
VB.NET 中的示例
You can use Microsoft Office Document Imaging Library (MODI), which is contained in the Office 2003/2007.
Links:
Project - example of using MODI
Wikipedia - contains a simple
example in VB.NET
模式识别是研究神经网络时的一个基本例子。我不知道是否有任何库/框架可以在 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.
我认为这很难自动化。问题只是因为你需要某种非常好的 OCR 软件。即使你得到了这个,如果它读错了,因为某人的笔迹模糊怎么办?如果 ID 错误,付款就会记入错误的员工,如果金额错误,他就会得到错误的工资!
这两件事你都不会真正发生。只是为了向您展示找到一个好的 OCR 有多难,只需看看 captcha< /a> 有效。其原理只不过是难以阅读的文本的图像。
所以我的观点是,你不能真正自动化这个过程。至少您可以编写一个程序来通过手动输入值来帮助人类(另请查看 Amazon Mechanical Turk ):
为了实现快速流畅的过程,您必须非常注意用户如何仅使用键盘即可轻松输入值:
通过使用这样的过程,一个人可以在您的数据库,并且成本比事后在数据库中查找错误条目要便宜得多。
最后一个建议:
因为这对于人类来说是一个无聊的过程,很容易导致错误,也许让两个人输入这些值,并且只有当两个人输入相同的值时才认为该值已被批准。这应该会导致正确率高于 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):
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:
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.
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)
有用于 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=