eclipse Android OCR 使用 tess-two a fork of tesseract

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14525004/
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-09-19 19:52:28  来源:igfitidea点击:

Android OCR using tess-two a fork of tesseract

androideclipseocrlogcattesseract

提问by Alfred

Am using OCR as a module in a project that am doing. After digging in deep for a week i thought that i should run a test application on eclipse just to see how accurately it works. i found tess-two a fork of tesseract as a support to my OCR. i downloaded tess-two from:

我在正在做的项目中使用 OCR 作为模块。在深入研究一周后,我认为我应该在 eclipse 上运行一个测试应用程序,看看它的工作准确度如何。我发现 tess-two 是 tesseract 的一个分支,作为对我的 OCR 的支持。我从以下位置下载了 tess-2:

https://github.com/rmtheis/tess-two/downloads

https://github.com/rmtheis/tess-two/downloads

I was all set i imported tess-two into my eclipse. I did set my eclipse for handling and building projects involving native code. I did build tess-two successfully after solving 1 or 2 build path errors. DONE!

我已经准备好将 tess-two 导入到我的日食中。我确实设置了我的 Eclipse 来处理和构建涉及本机代码的项目。在解决 1 或 2 个构建路径错误后,我确实成功构建了 tess-2。完毕!

Then i found a simple OCR application which was using the same tess-two. i download it from:

然后我发现了一个简单的 OCR 应用程序,它使用相同的 tess-two。我从以下地址下载:

https://github.com/GautamGupta/Simple-Android-OCR

https://github.com/GautamGupta/Simple-Android-OCR

I imported this project into my workspace. Corrected the build path i included tess-two as a supporting project in the build path. When i successfully build the two projects and run it on my target device the application runs successfully. when i run the camera with the button the camera opens but when i save the picture so that the ocr runs on it i get an exception:

我将这个项目导入到我的工作区。更正了我在构建路径中包含 tess-two 作为支持项目的构建路径。当我成功构建这两个项目并在我的目标设备上运行它时,应用程序成功运行。当我使用按钮运行相机时,相机会打开,但是当我保存图片以便在其上运行 ocr 时,出现异常:

could not find class 'com.googlecode.tesseract.android.TessBaseAPI' referenced from     method com.datumdroid.android.ocr.simple.SimpleAndroidOCRActicity.picturetaken'

This was the exception generated by the logcat on eclipse. Any idea how can i deal and remove this exception?? Tess-two was android target-8 and simple ocr application was target-10.

这是eclipse上logcat产生的异常。知道如何处理和删除此异常吗?Tess-2 是 android target-8,简单的 ocr 应用程序是 target-10。

回答by Dipin

  1. open the project properties
  2. add tess-twoin required projects
  3. tick the checkbox for tess-twoin order & export
  4. now clean & build your Simple-Android-OCR
  1. 打开项目属性
  2. 添加tess-two所需的项目
  3. 勾选按tess-two顺序和导出的复选框
  4. 现在清理并构建您的 Simple-Android-OCR

Hope this helps

希望这可以帮助

回答by samwel

make sure you marked tess-two as a library in the properties then right click your simple ocr and in the properties add tess two library and apply

确保您在属性中将 tess-two 标记为库,然后右键单击您的简单 ocr 并在属性中添加 tess 两个库并应用