简体   繁体   English

在Windows中使用Tesseract OCR Android

[英]Tesseract OCR Android in Windows

I've read all of questions forums and blogs about it but i still have a problem. 我已经阅读了有关它的所有问题论坛和博客,但我仍然有问题。 Firstly, i ticked tess-two as a library also my project's using tess-two as a library. 首先,我选择tess-two作为库,我的项目使用tess-two作为库。 I downloaded Android-NDK and from my project's properties i clicked Builders and then new -> Program then i choose ndk's ndk-build file. 我下载了Android-NDK,从我项目的属性中点击了Builders然后新建了 - > Program然后我选择了ndk的ndk-build文件。 By the way my project is Gautam Gupta's project. 顺便说一句,我的项目是Gautam Gupta的项目。 He'd given project. 他给了项目。 Link: https://github.com/GautamGupta/Simple-Android-OCR . 链接: https//github.com/GautamGupta/Simple-Android-OCR When i run that project in my phone, application starts and captures photo but when i press save then application gives error below. 当我在手机中运行该项目时,应用程序启动并捕获照片,但是当我按下保存时,应用程序会在下面给出错误。 http://t1307.hizliresim.com/1c/l/qg0rl.png http://t1307.hizliresim.com/1c/l/qg0rl.png

Looks like you need to download only TessTwo , make sure you have properly setup the environments variables (ANT_HOME, ANDROID_HOME and ANDROID_NDK) so these point to where you have Ant and Android SDKs . 看起来您只需要下载TessTwo ,确保您已正确设置环境变量(ANT_HOME,ANDROID_HOME和ANDROID_NDK),因此这些指向您拥有AntAndroid SDK的位置

Then it's a matter of building the project by following TessTwo guidance. 然后是按照TessTwo指导建立项目的问题。 That you set up the library-project that can be imported. 您设置了可以导入的库项目。

Don't forget that the line commands must be performed in CygWin. 不要忘记必须在CygWin中执行行命令。 Once the library project is built you should have correct .so files in libs/ *. 构建库项目后,你应该在libs / *中有正确的.so文件。 In order to actually use these, you could start with this link . 为了实际使用这些,您可以从这个链接开始。


@Burak: I have solved my problem. @Burak:我已经解决了我的问题。 For Windows; 对于Windows; Write the codes below to Cygwin 将以下代码写入Cygwin

a.cd <project-path'i>/tess-two
b.export TESSERACT_PATH=${PWD}/external/tesseract-3.01
c.export  LEPTONICA_PATH=${PWD}/external/leptonica-1.68
d.export LIBJPEG_PATH=${PWD}/external/libjpeg
e./cygdrive/<ndk-directory>/ndk-build

Write the codes below to CMD 将以下代码写入CMD

f.android update project --target 1 --path .
g. ant release 

Don't forget the "." 别忘了“。” at step f. 在步骤f。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM