如何使用 PHP 在网站上实现 OCR?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2170271/
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
How can I implement OCR on a website using PHP?
提问by Moshe
Are there any free OCR libraries that work with PHP or Python on a Linux server? The idea is to be able to upload an image and pull out characters from it, or allow users to "draw characters", and parse them out of said image.
是否有任何免费的 OCR 库可以在 Linux 服务器上与 PHP 或 Python 一起使用?这个想法是能够上传图像并从中提取字符,或者允许用户“绘制字符”,并从所述图像中解析它们。
采纳答案by nategood
Since you're on a Linux box, I would highly recommend Google's open source project ocropus.
由于您使用的是 Linux 机器,我强烈推荐 Google 的开源项目ocropus。
It's not PHP, but I think it will be your best option. Of course you can call it from within PHP via exec. Its mature and has a lot of options. From the project site:
它不是 PHP,但我认为它将是您最好的选择。当然,您可以在 PHP 中通过exec. 它成熟并且有很多选择。从项目现场:
The OCRopus engine is based on two research projects: a high-performance handwriting recognizer developed in the mid-90's and deployed by the US Census bureau, and novel high-performance layout analysis methods.
OCRopus 引擎基于两个研究项目:90 年代中期开发并由美国人口普查局部署的高性能手写识别器,以及新颖的高性能布局分析方法。
There is also another open source project, tesseract. I've used this in the past as well and have been pleased with the results. Includes training, limiting your alphabet, etc.
还有另一个开源项目tesseract。我过去也使用过它,并且对结果感到满意。包括培训、限制您的字母表等。
回答by Daniel D
Have you seen phpOCR classes of Andrey Kucherenko ? http://www.phpclasses.org/package/2874-PHP-Recognize-text-objects-in-graphical-images.htmlIt's an old article but may help you.
你看过 Andrey Kucherenko 的 phpOCR 课程吗? http://www.phpclasses.org/package/2874-PHP-Recognize-text-objects-in-graphical-images.html这是一篇旧文章,但可能对您有所帮助。

