Software Projects

Using Tesseract Tools for Android to Create a Basic OCR App

Posted in Uncategorized by rmt on August 6, 2011

Jan. 24, 2012 UPDATE: This tutorial is out of date. The tesseract-android-tools build files and the Android SDK Tools have both been updated, so the build should now succeed without requiring the modifications shown below. There’s an up-to-date tutorial available here.

I’ve published a project that combines the tesseract-android-tools project code with the source code for the Tesseract/Leptonica dependencies in a single project that’s intended to be easier to build here.


 
 
Note: The below instructions were written for the Android SDK Tools r12. To compile using r14+, after ndk-build do rm build.xml, then android update project --path . , then ant release (without modifying build.xml). Running the test cases on new versions of the SDK Tools will require other modifications.

These instructions assume you have already installed the Android SDK and NDK along with Eclipse and Subversion on Ubuntu.

Overall, what you need to do is to set up the tesseract-android-tools project as a library project in Eclipse, and tell your project to refer to the library project. So you’ll need two projects in Eclipse, whereas for an ordinary app you would have just one.

Step-by-step:

Check out the latest tesseract-android-tools source code using Subversion (don’t use the outdated code from “Downloads”):

git clone https://code.google.com/p/tesseract-android-tools/

Build the project according to the instructions in the readme file. Make sure that ndk-build successfully creates the .so object files, and that you get “BUILD SUCCESSFUL” when ant finishes. You may need to make three modifications:
Modification 1. Apparently the kernel.org site is unavailable for the libjpeg download, and it’s been pointed out elsewhere that using an alternative repository works, so use the following command instead of the existing git clone command:

git clone git://github.com/android/platform_external_jpeg.git libjpeg

Modification 2. Before running ant, edit the existing build.xml as a workaround for Android bug #13024. Put the following lines immediately before the ending </project> tag:

<!-- beginning of modification -->
  <path id="android.libraries.src"><path refid="project.libraries.src" /></path>
  <path id="android.libraries.jars"><path refid="project.libraries.jars" /></path>
<!-- end of modification -->

Modification 3. Do ant compile instead of ant release.

Create an AVD running Android 2.2 or higher, and with an SD card.

Import the tesseract-android-tools project into Eclipse:

File->Import->Existing Projects Into Workspace->Choose tesseract-android-tools->Finish

If you get an error complaining about a compiler level 5.0 compatibility problem, right-click the project name for tesseract-android-tools and do Properties->Java Compiler->Enable project specific settings and Uncheck “Use default compliance settings,” then set “Generated .class files compatibility” to 1.5, and set “Source compatibility” to 1.5. Answer yes if asked to rebuild.

Add tesseract-android-tools as a library project:

Right-click tesseract-android-tools project name->Properties->Android->check “Is Library”.

[Optional] Install the built-in test case package by importing the tesseract-android-tools-test project:

File->Import->Existing Projects Into Workspace->Choose tesseract-android-tools-test->Finish

[Optional] Start the AVD, wait for it to boot, and install the traineddata file required by the test cases:

wget http://tesseract-ocr.googlecode.com/files/eng.traineddata.gz

gunzip eng.traineddata.gz

adb shell mkdir /mnt/sdcard/tesseract

adb shell mkdir /mnt/sdcard/tesseract/tessdata

adb push eng.traineddata /mnt/sdcard/tesseract/tessdata

[Optional] Run the test cases–the test cases should pass, saying “OK (3 tests)”:

adb install tesseract-android-tools-test/bin/tesseract-android-tools-test.apk

adb shell am instrument -w -e package com.googlecode.tesseract.android.test \
com.googlecode.tesseract.android.test/android.test.InstrumentationTestRunner

Create your new app as a new Android project.

Configure your project to use the tesseract-android-tools project as a library project: Right click your new project name, do Properties->Android->Library->Add, and choose tesseract-android-tools.
You can now create a TessBaseAPI object in your app’s onCreate():

File myDir = getExternalFilesDir(Environment.MEDIA_MOUNTED);

TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(myDir.toString(), "eng"); // myDir + "/tessdata/eng.traineddata" must be present
baseApi.setImage(myImage);

String recognizedText = baseApi.getUTF8Text(); // Log or otherwise display this string...
baseApi.end();

Run your project on the AVD.
Other basic examples can be found in the TessBaseAPITest.java file in the tesseract-android-tools-test project.

About these ads

228 Responses

Subscribe to comments with RSS.

  1. wanyao said, on August 18, 2011 at 6:55 PM

    Will it work as well on windows xp?

    • rmt said, on August 18, 2011 at 7:11 PM

      I haven’t tried it on Windows/Cygwin.

    • John said, on August 28, 2011 at 1:34 PM

      Tried on XP & Cygwin. I had no success after a full-day of searching and debugging. Same exact process attempted on cygwin works perfectly fine on Ubuntu and took maybe roughly 5 minutes.

  2. jon said, on August 29, 2011 at 3:03 PM

    Once you have set up the tesseract-android-tools library with Ubuntu (I’m using a VM), can you transfer the library files (the 3 .so files, I presume) to Mac and Windows? If yes, do you also need the NDK for those platforms as well?

    • rmt said, on August 29, 2011 at 3:20 PM

      I routinely build the libraries on an Ubuntu VirtualBox VM that runs on top of Windows 7, and it works great. I have a shared folder set up between the VM and Windows. I’m not really sure beyond that. I think you still need the NDK on both.

  3. Rafael Favaro said, on October 7, 2011 at 9:46 AM

    anyone know how to pass a image from camera??
    i have tryed to put Bitmap bitmap = (Bitmap) data.getExtras().get(“data”);
    the image works fine, but when i try to baseApi.setImage(bitmap);
    Its come up with error

    • rmt said, on October 7, 2011 at 8:54 PM

      Try loading it using Bitmap.Config.ARGB_8888.

      • Rafael Favaro said, on October 15, 2011 at 11:07 AM

        tnks, but how can I use Bitmap.Config.ARGB_8888???

      • Rafael Favaro said, on November 22, 2011 at 2:17 PM

        I’m trying to build now on Ubuntu, hope to get better results =]

        when I follow those steps from README after ndk-build
        I have tryed the command “android update project –path .”
        but it doest work
        how I use this command ???

        my app is on /home/rafael/tesseract

      • rmt said, on November 22, 2011 at 2:59 PM

        Do this:

        rm build.xml
        android update project --path .
        ant release

      • Rafael Favaro said, on November 23, 2011 at 5:20 AM

        rafael@rafael:~/tesseract$ rm build.xml
        rafael@rafael:~/tesseract$ android update project –path .
        Updated local.properties
        No project name specified, using project folder name ‘tesseract’.
        If you wish to change it, edit the first line of build.xml.
        Added file ./build.xml
        Error: Could not access ./proguard.cfg: ./proguard.cfg (Permission denied)
        rafael@rafael:~/tesseract$

        What do I have to do??
        and thnks for helping me =]

      • rmt said, on November 23, 2011 at 1:41 PM

        If there’s an existing proguard.cfg file in the directory, you may need to remove that first too.

      • Rafael Favaro said, on November 25, 2011 at 5:56 AM

        after I got a BUILD SUCESS from “ant release”, when I try to
        add the project into eclipse I get a error “Specified buildfile does not contain a javac task”

        my build.xml code is:

        <!–

        /* This is typically used for code obfuscation.
        Compiled code location: ${out.classes.absolute.dir}
        If this is not done in place, override ${out.dex.input.absolute.dir} */

        –>

        <!– Import the actual build file.

        To customize existing targets, there are two options:
        – Customize only one target:
        – copy/paste the target into this file, *before* the
        task.
        – customize it to your needs.
        – Customize the whole content of build.xml
        – copy/paste the content of the rules files (minus the top node)
        into this file, replacing the task.
        – customize to your needs.

        ***********************
        ****** IMPORTANT ******
        ***********************
        In all cases you must update the value of version-tag below to read ‘custom’ instead of an integer,
        in order to avoid having your file be overridden by tools such as “android update project”
        –>

      • Rafael Favaro said, on November 25, 2011 at 6:02 AM

      • rmt said, on November 25, 2011 at 5:30 PM

        Don’t modify the build.xml, just use the one that gets generated.

      • Rafael Favaro said, on November 29, 2011 at 11:46 AM

        But I always get this mensage ““Specified buildfile does not contain a javac task” when I open with eclipse after I run “ant release”

      • rmt said, on November 29, 2011 at 7:27 PM

        Do you get “BUILD SUCCESSFUL”? Is this when doing File->Import->Existing Project in Eclipse? Are you using SDK Tools r15?

  4. Pallavi said, on October 10, 2011 at 3:19 AM

    for the “ndk-build” step it gave me the following error. The .SO file is not prepared…

    “Install : libjpeg.so => libs/armeabi/libjpeg.so
    make: *** No rule to make target `//cygdrive/e/AndroidReference/VisitingCardTess
    eract/tesseract-android-tools/external/leptonlib-1.66/src/adaptmap.c’, needed by
    `/cygdrive/e/AndroidReference/VisitingCardTesseract/tesseract-android-tools/obj
    /local/armeabi/objs/lept//cygdrive/e/AndroidReference/VisitingCardTesseract/tess
    eract-android-tools/external/leptonlib-1.66/src/adaptmap.o’. Stop.”

    • rmt said, on October 10, 2011 at 1:33 PM

      Have you tried the suggestions at http://stackoverflow.com/questions/7334040/compiling-tesseract-through-android-ndk ?

      I’d like to know if the suggestions at that link work well–please leave a follow up message to help other people.

      • cardim (@cardim) said, on October 12, 2011 at 7:12 PM

        I answer this question on stackoverflow, and I’ḿ using this solution on windows 7 and windows xp, with you need I can share my modified Android.mk files with you.

      • rmt said, on October 12, 2011 at 8:05 PM

        That would be helpful, if it works on both Linux and Cygwin. I’ll test it and include it in my fork of tesseract-android-tools, which I’ll be posting to Github. Please email to app.ocr@gmail, or just wait for my tesseract fork project to be posted and issue a pull request on Github. Thank you!

      • Pallavi said, on October 14, 2011 at 2:38 AM

        I did use that but it isn’t a solution for me :(

    • Pallavi said, on October 14, 2011 at 3:16 AM

      I am not getting the “libjpeg” folder coz of the error.

    • gravitas_shortfall said, on December 7, 2011 at 2:59 PM

      I also had something similar to this, ubuntu 11.10 sdk 14.
      Tried the hack on stack overflow, didn’t work.
      Fixed the two google android.mk files instead :
      LOCAL_PATH := $(call my-dir)/../..
      i.e. (call my-dir) must return the current build folder in the hierarchy, as it moves around.
      Seems to build ok now.

      • wnafee said, on January 1, 2012 at 10:58 AM

        Thanks that worked for me!

        I needed to change that in both the leptonica and tesseract google dirs to get it to work

  5. cardim (@cardim) said, on October 11, 2011 at 6:55 AM

    First, I would like to congratulate the excellent work in Test OCR application and would like to tell you what is happening to me.
    I compiled tesseract-android-tools and tested using the Android test project, and is working normally, no errors. I created another project in order to use images from the real world, but my OCR failure in 80% of the tests and your program have fewer failures using the same library. Do you have any tips to give me?

    Do you say on android market codes will be on github, so can you send me the code?

    • rmt said, on October 11, 2011 at 10:05 PM

      My only suggestion is to allow the user to pass a subset of the camera view to the OCR engine. In the OCR Test app I just use setImage() in TessBaseAPI–I’m not doing any additional image processing.

      I’ll post on Android Market when the code is available on Github–it should be available in a few weeks.

      • cardim (@cardim) said, on October 12, 2011 at 7:09 PM

        Ok, I have better results using zxing Camera code, like you did, but I need to do a customized View, like google goggles, like you did too, Did you get this part of code from other project?

      • rmt said, on October 12, 2011 at 8:04 PM

        No, I just added some new code to parse getX/getY touch events in CaptureActivity.java in onTouch, case MotionEvent.ACTION_MOVE.

  6. Sarah Oudin said, on October 12, 2011 at 10:18 AM

    Okay, so any suggestions on how to create an OCR app using AppInventor? I am a web developer and haven’t used Eclipse because I am not familiar with the coding. However, I have done hours of research and finally ended up here. This app would be basic and is a “niche” so the users would only be taking a picture of one particular object. The picture would contain digital numeral characters (same as used in digital alarm clocks) I need the app to recognize the characters and output them to a text, pdf, or perhaps even and email or word file. Any suggestions? Also, what method do barcode scanners use on mobile phones to scan the barcode? Whew, thanks!

    • rmt said, on October 12, 2011 at 8:16 PM

      I haven’t tried AppInventor but I would guess that it’s probably better suited to simpler projects than what you have in mind.

      For recognizing the digital-style characters, you might want to ask on the tesseract-ocr mailing list, and post an example of an actual image that you want to recognize. I think getting the OCR to work properly will be a lot more challenging than the outputting to text and emailing, etc. On Tesseract, I know it’s possible to create a custom “traineddata” file (see http://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3) to recognize your specific style of characters, but I’m not sure of the difficulty or effectiveness.

      Barcode scanners repeatedly scan the captured image data for barcodes using a fast algorithm. My “OCR Test” app does the same thing, but looks for text instead of bar codes. I made it by modifying an open source barcode scanner app (ZXing).

      • sheetal89 said, on November 8, 2011 at 5:27 AM

        Hello, I am developing an android application named ‘Barcode Scanner’. Can u help me out regarding how can I send my images captured from Camera to the OCR for Image processing?

      • rmt said, on November 9, 2011 at 8:42 PM

        Try forking my project at https://github.com/rmtheis/android-ocr.

      • Jay said, on November 16, 2011 at 1:21 PM

        Rmt,

        Could you possible share with me the source code of your modified ZXing scanner. I have been trying to use an OCR method to recognize bar codes for a school project that I am trying to finish. I have not had any luck so far. If you could help me out I would really appreciate it.

      • rmt said, on November 16, 2011 at 2:20 PM

        Sure–it’s at https://github.com/rmtheis/android-ocr.

      • Jay said, on November 16, 2011 at 2:46 PM

        Rmt,

        What I need to do is take OCR extracted images that I created using an OCR program and have my barcodes be recognized when a picture is taken in my app. I just need to link the OCR file of each barcode to my database of products (I have 100 products embedded into app). Could you tell me how I would write the code so the OCR file is recognized?

        Thank you,

        Jay

      • rmt said, on November 16, 2011 at 9:24 PM

        Are you trying to recognize characters, or barcodes? What are you taking a picture of?

      • Jay said, on November 17, 2011 at 2:58 AM

        I am taking a picture of upc barcodes. I just want to read the numerical digits on the bottom of the UPC. I want to then link each barcode with a database that I have created. Could you give your email and I.could send you the code I have so far?

        Thank you for your help,

        Jay

      • rmt said, on November 17, 2011 at 4:22 PM

        I don’t have time to look at your code, but I can point you in the direction of a barcode scanner project. Google ZXing if you want to scan the barcode itself, that would be faster than OCR-ing the characters. For OCR of the numbers, you’d need to have some way to separate the characters from the barcode itself, because the OCR engine tends to interpret the barcode as characters.

  7. HCM said, on October 18, 2011 at 6:23 PM

    I had no success on this step:
    export TESSERACT_PATH=${PWD}/tesseract-3.00
    export LEPTONICA_PATH=${PWD}/leptonlib-1.66
    export LIBJPEG_PATH=${PWD}/libjpeg

    nothing happen when I typing that command

    Help me!

    • rmt said, on October 18, 2011 at 10:14 PM

      Those commands set environment variables, so there’s no output.

      • HCM said, on October 19, 2011 at 4:18 AM

        Thank mate!
        after command ndk-build have been done, I run command: android update project –path and getting error: android command not found.

        so what can I do?

        sorry for my English!

      • rmt said, on October 19, 2011 at 1:15 PM

        Add the Android SDK to your PATH in your .bashrc:

        PATH=$PATH:/home/$USER/android-sdk-linux_x86/tools
        PATH=$PATH:/home/$USER/android-sdk-linux_x86/platform-tools
        PATH=$PATH:/home/$USER/android-ndk-r6b
        export PATH

  8. HCM said, on October 21, 2011 at 9:08 AM

    Finally I have complied successful tesseract-android-tools but tesseract-android-tools-test was not.

    I run test cases by create new Android project and here is my code

    TessBaseAPI api = new TessBaseAPI();
    api.init(“/mnt/sdcard/tesseract/tessdata/”, “eng”);

    File f = new File(Environment.getExternalStorageDirectory() + “”/mnt/sdcard/tesseract/digits.jpg”); // test image file including path.
    if (f == null || !f.canRead() || f.length()>>” + text + “<<<");

    It's getting error Force close when running.

    Logcat

    10-21 23:54:58.361: D/dalvikvm(7304): Trying to load lib /data/data/com.google.tesseract.android/lib/liblept.so 0×40515228
    10-21 23:54:58.381: D/dalvikvm(7304): Added shared lib /data/data/com.google.tesseract.android/lib/liblept.so 0×40515228
    10-21 23:54:58.391: D/dalvikvm(7304): Trying to load lib /data/data/com.google.tesseract.android/lib/libtess.so 0×40515228
    10-21 23:54:58.571: D/dalvikvm(7304): Added shared lib /data/data/com.google.tesseract.android/lib/libtess.so 0×40515228
    10-21 23:54:58.581: V/Tesseract(native)(7304): Java_com_googlecode_tesseract_android_TessBaseAPI_nativeClassInit
    10-21 23:54:58.581: V/Tesseract(native)(7304): Java_com_googlecode_tesseract_android_TessBaseAPI_nativeConstruct
    10-21 23:54:58.591: D/AndroidRuntime(7304): Shutting down VM
    10-21 23:54:58.591: W/dalvikvm(7304): threadid=1: thread exiting with uncaught exception (group=0×40015560)
    10-21 23:54:58.622: E/AndroidRuntime(7304): FATAL EXCEPTION: main
    10-21 23:54:58.622: E/AndroidRuntime(7304): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.tesseract.android/com.google.tesseract.android.OCRandroid233Activity}: java.lang.IllegalArgumentException: Data path must contain subfolder tessdata!
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.os.Handler.dispatchMessage(Handler.java:99)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.os.Looper.loop(Looper.java:123)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.app.ActivityThread.main(ActivityThread.java:3683)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at java.lang.reflect.Method.invokeNative(Native Method)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at java.lang.reflect.Method.invoke(Method.java:507)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at dalvik.system.NativeStart.main(Native Method)
    10-21 23:54:58.622: E/AndroidRuntime(7304): Caused by: java.lang.IllegalArgumentException: Data path must contain subfolder tessdata!
    10-21 23:54:58.622: E/AndroidRuntime(7304): at com.googlecode.tesseract.android.TessBaseAPI.init(TessBaseAPI.java:139)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at com.google.tesseract.android.OCRandroid233Activity.onCreate(OCRandroid233Activity.java:25)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    10-21 23:54:58.622: E/AndroidRuntime(7304): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
    10-21 23:54:58.622: E/AndroidRuntime(7304): … 11 more

    Help me!

    • HCM said, on October 21, 2011 at 9:20 AM

      sr, this is full code
      TessBaseAPI api = new TessBaseAPI();
      api.init(“/mnt/sdcard/tesseract/tessdata/”, “eng”);
      File f = new File(Environment.getExternalStorageDirectory() + “/mnt/sdcard/tesseract/digits.jpg”); // test image file including path.
      if (f == null || !f.canRead() || f.length()>>” + text + “<<<");

      • rmt said, on October 21, 2011 at 7:31 PM

        Did the built-in test cases pass? Did you install eng.traineddata?

  9. HCM said, on October 21, 2011 at 9:27 AM

    Huh, I can not send full of my code in above comment :(
    sorry for inconvenient!

  10. Hasan said, on October 22, 2011 at 6:03 AM

    Hi I am new on this subject and I need your help.I am having some problems with installation.It is good until the comment “ndk-build” when I wirte it ndk-build it gives that error. what must I do?

    hasan@hasan:~/workspace$ /home/hasan/Desktop/opencv-android/android-ndk-r6/ndk-build
    Android NDK: Could not find application project directory !
    Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
    /home/hasan/Desktop/opencv-android/android-ndk-r6/build/core/build-local.mk:85: *** Android NDK: Aborting . Stop.

    Thanks.

    • rmt said, on October 22, 2011 at 11:57 AM

      Change into the tesseract-android-tools project directory before running ndk-build.

  11. HCM said, on October 22, 2011 at 6:12 AM

    Yes, I have download eng.traineddata and copy to /mnt/sdcard/tesseract/tessdata on ADV

  12. Priska Aprilia said, on October 22, 2011 at 11:00 AM

    Hi all,

    I have some questions.
    The first 1, in the readme tutorial, it says:
    cd

    what does project-directory mean?
    Must I create an android project using eclipse first before building tesseract library?

    I have tried both tutorials here and on http://code.google.com/p/tesseract-android-tools/source/browse/trunk/tesseract-android-tools/README

    But it seems that doesn’t work for me. Im working on windows 7 platform and use cygwin to do linux command line. But when I run ndk-build, it creates .so file for my another existing project instead of libjpeg.so. And then when I run “android” command, an error occurred “bash : android: command not found”

    My android-sdk located in C:/android-sdk
    android-ndk located in C:/android-ndk-r6b
    and usually my workspace is beneath my android-ndk-r6b directory

    • rmt said, on October 22, 2011 at 12:00 PM

      You need to build it using Linux, not Cygwin. I use Ubuntu running on VirtualBox.

      The project directory is the directory where you downloaded tesseract-android-tools. You need to add the Android SDK to your PATH in your .bashrc in order to be able to run it from another directory.

      • Priska Aprilia said, on October 22, 2011 at 9:21 PM

        Oke. I have only win7 and now Im trying to download Ubuntu and VirtualBox.

        After creating .so files I just need to import that file into my android project or full android-tesseract directory?
        I also can use the .so files for developing in win7 right?

      • Priska Aprilia said, on October 22, 2011 at 10:23 PM

        I almost build the libjpeg.so using cygwin, but at the rest an error occurred like this:

        Compile arm : jpeg <= jidctint.c
        Compile arm : jpeg libs/armeabi/libjpeg.so
        make: *** No rule to make target `//cygdrive/c/android-ndk-r6b/external/leptonli
        b-1.66/src/adaptmap.c’, needed by `/cygdrive/c/android-ndk-r6b/external/tesserac
        t-android-tools-1.00/obj/local/armeabi/objs/lept//cygdrive/c/android-ndk-r6b/ext
        ernal/leptonlib-1.66/src/adaptmap.o’. Stop.

        what should i do with this issue?

    • rmt said, on October 22, 2011 at 10:33 PM

      The “no rule to make target” problem is due to the build file not working on Cygwin.

      After you make the .so files, just follow the directions above for setting up tesseract-android-tools as a library project, and make sure your project is set to use tesseract-android-tools as a library project like described in the instructions. That will take care of the “importing.” It will work in Windows 7 after building in Ubuntu–that’s how I do it.

  13. Priska Aprilia said, on October 22, 2011 at 11:02 AM

    I need you who understands these problems to help me out.

    Thanks you a bunch

    Regards,

    Priska

  14. Hasan Kara said, on October 22, 2011 at 12:54 PM

    Hi again,
    I am getting a new error while running tesseract-android-tools-test.
    I did everything on command line so files are created. I imported tesseract-android-tools to workspace on eclipse and after that I imported tesseract-android-tools-test into workspace.I chose tesseract-android-tools to use as library.
    When I run the tesseract-android-tools-test it doesn’t give any error but it writes in console
    tesseract-android-tools] Could not find tesseract-android-tools.apk!
    and continues but nothing happens on emulator.
    if you can help I will be glad.

    • rmt said, on October 22, 2011 at 12:58 PM

      You can’t run the test cases directly from Eclipse, as far as I know, but you can run them using the instructions marked “Optional” above.

  15. Priska Aprilia said, on October 22, 2011 at 9:01 PM

    btw how about the result for recognizing hangul korean characters ?

    Im going to make an android application for Korean and then translate them into English or Bahasa.
    Does Tesseract include dictionary for translating? or I have to create my own database to save all the translation based on Korean character utf-16 encoding?

    How can i get the utf-16 codes of each character from tesseract and compare them with data stored in database for translating?

    • rmt said, on October 22, 2011 at 10:36 PM

      No, Tesseract just does the OCR. You’d need a separate solution for doing the translation. You can get the UTF-8 character codes from Tesseract using getUTF8Text().

  16. Priska Aprilia said, on October 22, 2011 at 10:57 PM

    Thank you very much for your all reply, I really appreciate :D.

    Finally, the VirtualBox and ubuntu downloading process is just done.

    First I will try to build the .so file using ubuntu first.

    If I have any problem with it I will post it here.

    Once again, Thank you a bunch :D

  17. Hasan Kara said, on October 23, 2011 at 2:40 AM

    Hi again
    I am getting closer to end but there is a new problem.

    until
    “adb install tesseract-android-tools-test/bin/tesseract-android-tools-test.apk”

    everything is ok but when I run this on console it says

    can’t find ‘tesseract-android-tools-test/bin/tesseract-android-tools-test.apk’ to install

    what’s wrong with that ?,please help.
    Thanks.

    • rmt said, on October 23, 2011 at 11:23 PM

      You need to import the tesseract-android-tools-test project into Eclipse to build the APK.

  18. priskaaprilia said, on October 24, 2011 at 7:33 AM

    problem again :(

    an error occurred when i run ./ndk-build

    priska@PriskAprilia:~/android-ndk$ NDK_PROJECT_PATH=”/home/priska/android-ndk/external/tesseract-3.00″
    priska@PriskAprilia:~/android-ndk$ export=NDK_PROJECT_PATH
    priska@PriskAprilia:~/android-ndk$ ./ndk-build
    Android NDK: Could not find application project directory !
    Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
    /home/priska/android-ndk/build/core/build-local.mk:85: *** Android NDK: Aborting . Stop.

    what my ndk_project_path should be?

    Can I build tesseract-3.00 ?

    When I try on cygwin :
    “Compile arm : jpeg <= jidctint.c
    Compile arm : jpeg libs/armeabi/libjpeg.so
    make: *** No rule to make target `//cygdrive/c/android-ndk-r6b/external/leptonli
    b-1.66/src/adaptmap.c’, needed by `/cygdrive/c/android-ndk-r6b/external/tesserac
    t-android-tools-1.00/obj/local/armeabi/objs/lept//cygdrive/c/android-ndk-r6b/ext
    ernal/leptonlib-1.66/src/adaptmap.o’. Stop."

    I build tesseract-android-1.00 not tesseract-3.00. Tesseract-3.00 doesnt have jni file

    Need help!

    Thank you

  19. priskaaprilia said, on October 24, 2011 at 8:09 AM

    I try this one : priska@PriskAprilia:~/android-ndk/tesseract-android$ /home/priska/android-ndk/ndk-build

    instead of set my NDK_PROJECT_PATH

    and it works now

    I think something wrong with the read me file, it is tesseract-3.00 (i think this one is not for android, it doesn’t contain any jni folder, android.mk file). So I build Tesseract-android-tools-1.00

    Does this version already include korean traindata?

    • rmt said, on October 24, 2011 at 12:48 PM

      Does it work, or not? I haven’t tried Tesseract v1, and I don’t recommend it.

      • priskaaprilia said, on October 24, 2011 at 4:57 PM

        I haven’t tried to create project. Last night I just succeeded in building the library.
        I don’t know why i succeeded in building Tesseract-android-tools-1.00 instead of Tesseract-3.00.

        Can I really use tesseract-3.00 for creating android app even though there is no any android name in it ?

      • rmt said, on October 24, 2011 at 7:26 PM

        Tesseract Tools for Android (tesseract-android-tools) is an Android API for Tesseract OCR v3.00.

    • priskaaprilia said, on October 24, 2011 at 4:59 PM

      i can open this link : http://tesseract-android-tools.googlecode.com/svn/trunk/ tesseract-android-tools

      The page not found :(

      • rmt said, on October 24, 2011 at 5:38 PM

        That’s a parameter for svn, not a web link.

  20. hacana said, on October 24, 2011 at 9:21 AM

    Hi,
    Tesseract V3.01 has been released on Oct 21 2011
    Can I use it to build project on android?

  21. Charles said, on October 25, 2011 at 1:50 AM

    If your network setup blocks git’s port 9148, it worked for me to replace git:// with http:// in modification #1.

  22. priskaaprilia said, on October 25, 2011 at 4:30 AM

    android update project –path

    What project path that i should update?

    • rmt said, on October 25, 2011 at 10:49 PM

      You should run that command as shown in the instructions, “android update project –path .” in your tesseract-android-tools directory.

  23. priskaaprilia said, on October 25, 2011 at 4:34 AM

    by the way, where is the build.xml location?

    • rmt said, on October 25, 2011 at 10:50 PM

      In the tesseract-android-tools directory.

  24. PC said, on November 6, 2011 at 10:37 AM

    Any help will be appreciated. Thank you

  25. MG said, on November 6, 2011 at 12:32 PM

    Hi I need help. I got this error while update android project path:
    C:/android-ndk-r6b/external/tesseract-android-tools/tesseract-android-tools$ android update project -p /media/00B42E57B42E5008/android-ndk-r6b/external/tesseract-android-tools/tesseract-android-tools
    Error: The project either has no target set or the target is invalid.
    Please provide a –target to the ‘android update’ command.

    • rmt said, on November 6, 2011 at 1:22 PM

      Yep, I think you get that if you build with SDK Tools r14+. Try –target 12 or –target 14.

      Then I think you’ll need to delete the build.xml and do “ant release”.

      • Rob C said, on November 10, 2011 at 5:03 PM

        I think you need to do

        android list target

        first, and find the number for the target AVD you want, to use in the “–target” param. It’s not the same number as an ADK rev number, like 12 or 14. In my case, there are only ids 1 through 4 (but maybe I’m unusual).

      • rmt said, on November 22, 2011 at 3:48 PM

        That’s right–thanks–the target is the API level. Use 8, to indicate Android 2.2+.

  26. MG said, on November 7, 2011 at 4:19 AM

    another error :
    priska@PriskAprilia:/media/00B42E57B42E5008/android-ndk-r6b/tesseract-android-tools/tesseract-android-tools$ android update project -t 12 -p /media/00B42E57B42E5008/android-ndk-r6b/tesseract-android-tools/tesseract-android-tools
    Error: Target id ’12′ is not valid. Use ‘android list targets’ to get the target ids.
    priska@PriskAprilia:/media/00B42E57B42E5008/android-ndk-r6b/tesseract-android-tools/tesseract-android-tools$ android list targets
    Available Android targets:
    priska@PriskAprilia:/media/00B42E57B42E5008/android-ndk-r6b/tesseract-android-tools/tesseract-android-tools$

    My android targets are empty. I have installed android-sdk and eclipse on my Ubuntu 11.10.
    I’m trying to build Tesseract on windows 7 using ndk-build on Ubuntu 11.10

  27. Priska Aprilia said, on November 7, 2011 at 10:51 AM

    Finally I successfully built it by combining linux terminal and windows command prompt. But while exporting tesseract-android-tools-tests many errors appear

    [2011-11-08 01:44:45 - tesseract-android-tools-test] ERROR: Unknown option ‘–no-crunch’
    [2011-11-08 01:44:45 - tesseract-android-tools-test] Android Asset Packaging Tool
    [2011-11-08 01:44:45 - tesseract-android-tools-test]
    [2011-11-08 01:44:45 - tesseract-android-tools-test] Usage:
    [2011-11-08 01:44:45 - tesseract-android-tools-test] aapt l[ist] [-v] [-a] file.{zip,jar,apk}
    [2011-11-08 01:44:45 - tesseract-android-tools-test] List contents of Zip-compatible archive.
    [2011-11-08 01:44:45 - tesseract-android-tools-test]
    [2011-11-08 01:44:45 - tesseract-android-tools-test] aapt d[ump] [--values] WHAT file.{apk} [asset [asset ...]]
    [2011-11-08 01:44:45 - tesseract-android-tools-test] badging Print the label and icon for the app declared in APK.
    [2011-11-08 01:44:45 - tesseract-android-tools-test] permissions Print the permissions from the APK.
    [2011-11-08 01:44:45 - tesseract-android-tools-test] resources Print the resource table from the APK.
    [2011-11-08 01:44:45 - tesseract-android-tools-test] configurations Print the configurations in the APK.
    [2011-11-08 01:44:45 - tesseract-android-tools-test] xmltree Print the compiled xmls in the given assets.
    [2011-11-08 01:44:45 - tesseract-android-tools-test] xmlstrings Print the strings of the given compiled xml assets.
    [2011-11-08 01:44:45 - tesseract-android-tools-test]
    [2011-11-08 01:44:45 - tesseract-android-tools-test] aapt p[ackage] [-d][-f][-m][-u][-v][-x][-z][-M AndroidManifest.xml] \
    [2011-11-08 01:44:45 - tesseract-android-tools-test] [-0 extension [-0 extension ...]] [-g tolerance] [-j jarfile] \
    [2011-11-08 01:44:45 - tesseract-android-tools-test] [--debug-mode] [--min-sdk-version VAL] [–target-

    What should i do with those errors?

    • rmt said, on November 7, 2011 at 6:54 PM

      Exporting? Which step of the instructions are you on? Where are you seeing this error?

      • Priska Aprilia said, on November 8, 2011 at 12:33 AM

        while importing tesseract-androids-tools and tesseract-android-tools-test into eclipsse but it had been resolved now. I Copy android-support-4 to my eclipse folder. it was about android compatibility issue

  28. Priska Aprilia said, on November 7, 2011 at 10:06 PM

    Resolved I copy android-support-4 to my eclipse folder.

    Well, can I download korean.tessdata and place it in a folder under my android project (not inside the SDcard) ?

    How can I print the string of getUTF8Text(); into android view ?

    I do this

    final String outputText = baseApi.getUTF8Text();
    TextView v = new TextView(this);

    but the string didn’t appear when running android’s emulator
    ((TextView)v).setText(outputText);

  29. [...] checkout Robert Theis’s Android OCR application on Github too (for intermediate+)!References:Using Tesseract Tools for Android to Create a Basic OCR App by Robert TheisSimple Android Photo Capture by MakeMachine.tess-two READMELeave a Reply Cancel [...]

  30. drito7 said, on November 10, 2011 at 4:48 AM

    Hello, I’ve made ​​the process smooth but I have an error in the line “ant release”, the output of the error is:

    Dritan @ drito7: ~ / android-tools tesseract-$ ant release
    BuildFile: build.xml

    BUILD FAILED
    / home / Dritan / tesseract-android-tools / build.xml: 77: The Android Ant-based build system Requires Ant 1.8.0 or later. Current version is 1.7.1

    Total time: 0 seconds

    Can anyone help me? Thanks..

    • rmt said, on November 10, 2011 at 11:44 PM

      If you’re using Ubuntu, try:

      sudo apt-get upgrade ant

  31. Rob C said, on November 10, 2011 at 9:02 AM

    I think something happened to the text of the original post. I now see

    — start of quote

    Modification 2. Before running ant, edit the existing build.xml as a workaround for Android bug #13024. Put the following lines immediately before the ending tag:

    1
    2

    — end quote

    There’s nothing between those two comments!

    • Rob C said, on November 10, 2011 at 9:04 AM

      Well, dang – the XML comments got eaten by the blog! Perhaps I should have said

      Modification 2. Before running ant, edit the existing build.xml as a workaround for Android bug #13024. Put the following lines immediately before the ending tag:

      1 <!– beginning of modification –>
      2 <!– end of modification –>

      How’s that?

      • Priska Aprilia said, on November 11, 2011 at 1:40 AM

        lol you’re funny—>”Well, dang – the XML comments got eaten by the blog!”

    • rmt said, on November 10, 2011 at 11:40 PM

      Thanks for noticing that–it’s fixed now.

  32. Priska Aprilia said, on November 10, 2011 at 6:57 PM

    Please refer to http://code.google.com/p/android/issues/detail?id=13024

    there are two lines modification for your build.xml as the writer said above. Place it after before

  33. silav said, on November 12, 2011 at 1:57 PM

    hi, i got the following error when i try ndk-build on ubuntu. any help? thanks..

    user@user-pc:~/tesseract-android-tools$ ndk-build
    /home/user/android-ndk-r7/prebuilt/linux-x86/bin/awk: 1: ELF: not found
    /home/user/android-ndk-r7/prebuilt/linux-x86/bin/awk: 4: Syntax error: word unexpected (expecting “)”)
    Android NDK: Host ‘awk’ tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !
    /home/user/android-ndk-r7/build/core/init.mk:258: *** Android NDK: Aborting. . Stop.

  34. Charles said, on November 22, 2011 at 4:42 AM

    Hi RMT,
    Thanks for the work. My basic application is working fine, but I’d like to move on to using some of the more sophisticated features of Tesseract like retrieving bounding boxes. TessBaseAPI.java doesn’t seem to have them. Are you planning on implementing the wrappers? I wouldn’t want to do duplicate work.

    • rmt said, on November 22, 2011 at 1:48 PM

      I’ve added some bounding box retrieval methods to my fork of tesseract-android-tools at https://github.com/rmtheis/tess-two.

      If you end up implementing the JNI for additional features from Tesseract, it would be great if you’d consider contributing your code to the project.

      • Charles said, on November 23, 2011 at 9:00 AM

        I’ve added the wrapper, built it and put it in my Eclipse project, but it looks like a simple wrapper of the existing code is not enough. How did you debug errors in C++ like the one below? Is it likely to be a problem like removing STL code as I see in the comments for other functions? (Should I be doing this on Tesseract 3.0.1?)


        I/DEBUG ( 1032): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        I/DEBUG ( 1032): Build fingerprint: 'lge/lge_star/p990_EUR-xx:2.3.4/GRJ22/lgp990-V20l.422C563E:user/release-keys'
        I/DEBUG ( 1032): pid: 13611, tid: 13611 >>> adchange.fbk.eu <<<
        I/DEBUG ( 1032): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
        I/DEBUG ( 1032): r0 00000000 r1 00000000 r2 fffffff1 r3 00000031

      • rmt said, on November 23, 2011 at 1:40 PM

        I’m not sure there’s any STL in Tesseract that needs to be removed. I’ve gotten good (good, as in “it doesn’t blow up”) results without making modifications to the Tesseract code.

        You can try to debug these segmentation faults using the debug tool that came with the NDK, but I only saw these errors when I tried to OCR an image in an unsupported format.

  35. Moe Greene said, on December 6, 2011 at 1:32 PM

    If you have problems in building, you might try this:
    http://code.google.com/p/tesseract-android-tools/issues/detail?id=4#c16

  36. phraellyn said, on December 30, 2011 at 10:21 AM

    the command:

    > git clone git://github.com/android/platform_external_jpeg.git libjpeg

    fails for me (in windows 7). My cmd throws the message:

    error: cannot run index-pack: No such a file or directory

    • rmt said, on December 30, 2011 at 12:12 PM

      Something may be wrong with your local git installation–I’d try reinstalling git.

  37. Arun Singh said, on January 18, 2012 at 12:39 PM

    I get an error stating:
    “tesseract-android-tools] Could not find tesseract-android-tools.apk!”

    I have added the tesseract-android-tools project as a Library project in Eclipse and included it in the build path of the test project. When I try to run the test project, after installing the test project apk on the emulator, I get this error.

    Console Output Log:
    [2012-01-19 01:46:02 - AndroidOCR] ——————————
    [2012-01-19 01:46:02 - AndroidOCR] Android Launch!
    [2012-01-19 01:46:02 - AndroidOCR] adb is running normally.
    [2012-01-19 01:46:02 - AndroidOCR] Performing android.ocr.Main activity launch
    [2012-01-19 01:46:03 - AndroidOCR] Automatic Target Mode: using existing emulator ‘emulator-5554′ running compatible AVD ‘Test’
    [2012-01-19 01:46:03 - AndroidOCR] Uploading tess-test.apk onto device ‘emulator-5554′
    [2012-01-19 01:46:08 - AndroidOCR] Installing tess-test.apk…
    [2012-01-19 01:46:25 - AndroidOCR] Success!
    [2012-01-19 01:46:25 - tesseract-android-tools] Could not find tesseract-android-tools.apk!

    • rmt said, on January 23, 2012 at 7:33 AM

      Add the tesseract-android-tools project as a library project. Don’t manually add it to the build path.

  38. rundmp said, on January 24, 2012 at 9:16 AM

    dear rmt

    i have followed step by step instructions from tesseract android tools’ readme file. until the “ndk-build” command it doesn’t work and the error message said “ndk-build: command not found”

    please help me fix this thing

  39. Bipin Sharma said, on February 7, 2012 at 4:13 AM

    Hi sir!!
    why this is happening to me? Please i tried diffrent way but couldn’t got success in any case.. what could be the problem?

    I got this Error while ndk-build
    Install : libjpeg.so => libs/armeabi/libjpeg.so
    make: *** No rule to make target `/home/funfil/external/rmtheis-esrect/tess-two/jni/com_googlecode_leptonica_android/../..//home/funfil/external/rmtheis-esrect/tess-two/jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/funfil/external/rmtheis-esrect/tess-two/obj/local/armeabi/objs/lept//home/funfil/external/rmtheis-esrect/tess-two/jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

    • rmt said, on February 7, 2012 at 9:30 AM

      I can’t reproduce this–I’m able to build the current version of the tess-two project successfully. Which NDK version and which SDK Tools version are you using? What operating system are you using?

      • Bipin Sharma said, on February 7, 2012 at 7:55 PM

        Sir!!
        m using ndk7 and sdkr16, and ubuntu 11.10..

  40. Sumit said, on February 12, 2012 at 10:12 AM

    hello,
    can anyone provide me trained data from kannada language (kan.trainneddata file) or atleast tell me where i can find it..

    Appreciate any help on that. Thanks in advance

  41. Bipin Sharma said, on February 15, 2012 at 1:36 AM

    Sir!!
    With your gr8 tutorial i am able to compile and run the projects,,,,Thanx for all your efforts ..

    Kindly, provide me the solution for digital Font detection,,,It is not recognizing.
    Do you have any guidance for me so i can detect Digital Fonts ex–Like digital

    numbers in calculator.

  42. Kashif said, on February 15, 2012 at 5:40 AM

    i was trying to build the project using tess-two. it produces a error

    nstall : libjpeg.so => libs/armeabi/libjpeg.so
    make: *** No rule to make target `/home/funfil/external/rmtheis-esrect/tess-two/jni/com_googlecode_leptonica_android/../..//home/funfil/external/rmtheis-esrect/tess-two/jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/funfil/external/rmtheis-esrect/tess-two/obj/local/armeabi/objs/lept//home/funfil/external/rmtheis-esrect/tess-two/jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

    when i build the project tesseract-tool and run the project then it will forced closed and error in logcat is

    unsatisfied linked error: library lept not found…..

    i am using ubuntu…..

    please help me,

    • rmt said, on February 15, 2012 at 10:47 AM

      The unsatisfied link error is because the build was unsuccessful. It looks like the path is a little weird. How did you clone the project? Exactly what did you type?

  43. Kashif said, on February 15, 2012 at 5:49 AM

    when i build the project using tesseract-android-tool using ndk-build command then following error message shows

    No rule to make target `/home/kashif/tesseract-android-tools/tesseract-android-tools//jni/../external/libjpeg/jidctfst.S’, needed by `/home/kashif/tesseract-android-tools/tesseract-android-tools//obj/local/armeabi/objs/jpeg/jidctfst.o’. Stop.

    please help anyone…….

  44. Kashif said, on February 16, 2012 at 2:01 AM

    sir i download the project from the link you mention above

    svn checkout http://tesseract-android-tools.googlecode.com/svn/trunk/ tesseract-android-tools

    then i follow the step of readme open the project folder after setting the project path in ubuntu.

    and simple type the commands

    ndk-build

    then it will display the error

    No rule to make target `/home/kashif/tesseract-android-tools/tesseract-android-tools//jni/../external/libjpeg/jidctfst.S’, needed by `/home/kashif/tesseract-android-tools/tesseract-android-tools//obj/local/armeabi/objs/jpeg/jidctfst.o’. Stop.

    and after i type the command android update project –path command and release ant

    there is no error in the commands and sucessfully build the file….

    after complete the all step application is forced closed and unsatisfied linked error.

    i try the project tess-two

    but it will also display an error when i type ndk-build command after all steps perform sucessfully.

    i am totally stuck for a couple of week.

    please help me what i do?????

    • rmt said, on February 16, 2012 at 10:32 AM

      Tell me what you typed so I can try to reproduce your build error for the tess-two project.

  45. Kashif said, on February 16, 2012 at 10:32 PM

    sir i am using ndk-r5b, and i only follow these steps to build the project.

    git clone git://github.com/rmtheis/tess-two tess
    cd tess/tess-two
    ndk-build
    android update project –path .
    ant release

    when i typed ndk-build command then it display error

    make: *** No rule to make target `/home/kashif/tess/tess-two//jni/com_googlecode_leptonica_android/../..//home/kashif/tess/tess-two//jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/kashif/tess/tess-two//obj/local/armeabi/objs/lept//home/kashif/tess/tess-two//jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

  46. Andrea said, on February 17, 2012 at 2:36 AM

    hi
    i’ve an issue:
    my program failed at TessBaseAPI initializing

    W/dalvikvm(11691): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/googlecode/tesseract/android/TessBaseAPI;

    this is the error.

    how can i solve it?

    • rmt said, on February 23, 2012 at 11:19 AM

      Is your project properly pointing to the library project?

  47. Kashif said, on February 17, 2012 at 4:21 AM

    sir, now i also try on NDK r7. and when i build tess-two then it will display this error

    make: *** No rule to make target `/home/kashif/tess/tess-two/jni/com_googlecode_leptonica_android/../..//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/kashif/tess/tess-two/obj/local/armeabi/objs/lept//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

    what i do????

  48. Kashif said, on February 17, 2012 at 4:23 AM

    now i try on NDK-r7 and using ubuntu linux operating system

    Install : libjpeg.so => libs/armeabi/libjpeg.so
    make: *** No rule to make target `/home/kashif/tess/tess-two/jni/com_googlecode_leptonica_android/../..//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/kashif/tess/tess-two/obj/local/armeabi/objs/lept//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

  49. Kashif said, on February 17, 2012 at 4:33 AM

    sir when i do command android update project –path
    and ant release

    then i will update the build.xml sucessfully…………

    sir, i only stuck when i type ndk-build the it will display

    Install : libjpeg.so => libs/armeabi/libjpeg.so
    make: *** No rule to make target `/home/kashif/tess/tess-two/jni/com_googlecode_leptonica_android/../..//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/kashif/tess/tess-two/obj/local/armeabi/objs/lept//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

    and when compile the project then its gives

    unsatisfied linked error, and lept library not found

    please help me

    • rmt said, on February 17, 2012 at 9:45 AM

      I can’t reproduce this on Ubuntu 11.04. Which version of Ubuntu are you using? Did you try building with NDK r7b?

  50. Kashif said, on February 17, 2012 at 4:35 AM

    i also follow the following link but i am useless efforts and not reached at end point

    http://gaut.am/making-an-ocr-android-app-using-tesseract/

  51. Kashif said, on February 17, 2012 at 4:47 AM

    02-17 17:42:57.369: E/AndroidRuntime(330): FATAL EXCEPTION: main

    02-17 17:42:57.369: E/AndroidRuntime(330): java.lang.ExceptionInInitializerError

    02-17 17:42:57.369: E/AndroidRuntime(330): Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load lept: findLibrary returned null

    02-17 17:42:57.369: E/AndroidRuntime(330): java.lang.ExceptionInInitializerError

    when i compile the project this is the error display in the logcat.

  52. Kashif said, on February 19, 2012 at 10:03 PM

    sir i am using 11.10 version is using and Android ndkr7 not r7b.

  53. Kashif said, on February 19, 2012 at 10:05 PM

    sir what i do???

  54. Kashif said, on February 19, 2012 at 11:03 PM

    now i again tess-two using android ndk-r7b….

    same issue…..

    make: *** No rule to make target `/home/kashif/tess/tess-two/jni/com_googlecode_leptonica_android/../..//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/kashif/tess/tess-two/obj/local/armeabi/objs/lept//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

  55. Kashif said, on February 19, 2012 at 11:05 PM

    i have build ndk r5b, ndk r7 and now ndkr7b, but problem is same.

    make: *** No rule to make target `/home/kashif/tess/tess-two/jni/com_googlecode_leptonica_android/../..//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.c’, needed by `/home/kashif/tess/tess-two/obj/local/armeabi/objs/lept//home/kashif/tess/tess-two/jni/../external/leptonica-1.68/src/adaptmap.o’. Stop.

    please help me out.

  56. Kashif said, on February 19, 2012 at 11:11 PM

    sir this is kernal issue how can i resolve, can you help me ????

    • rmt said, on February 20, 2012 at 11:42 AM

      A kernel issue? I’m able to build on a VM running Ubuntu 11.04–why don’t you try that.

      I don’t have time to try to reproduce this issue and debug on Ubuntu 11.10 right now.

  57. Kashif said, on February 23, 2012 at 6:43 AM

    Thank you rmt sir, i sucessfully build app using ubuntu 11.04 and android Android ndk-r7.
    Thanks a lot again.

  58. mitesh said, on February 23, 2012 at 9:28 AM

    baseApi.setImage(myImage);…i am getting error on argument myImage….please help me….

    • rmt said, on February 23, 2012 at 11:20 AM

      Can you be more specific? What error message did you see in LogCat?

      • mitesh said, on February 24, 2012 at 12:37 AM

        I have successfully done all the steps…when i have create a new project on eclipse and add tess-two as a library project…on my new project onCreate() method….i paste this code:

        File myDir = getExternalFilesDir(Environment.MEDIA_MOUNTED);
        2
        3 TessBaseAPI baseApi = new TessBaseAPI();
        4 baseApi.init(myDir.toString(), “eng”); // myDir + “/tessdata/eng.traineddata” must be present
        5 baseApi.setImage(myImage);
        6
        7 String recognizedText = baseApi.getUTF8Text(); // Log or otherwise display this string…
        8 baseApi.end();

        and i got error at line 5…myImage not found…???
        plz help me…

      • rmt said, on February 24, 2012 at 1:07 AM

        Look at the documentation. You have to pass an image as the myImage parameter.

  59. mitesh said, on February 23, 2012 at 9:30 AM

    I’ve been looking into getting a live camera preview working in the Android emulator. Currently the Android emulator just gives a black and white chess board animation. ..plz help me ?

    • rmt said, on February 23, 2012 at 11:21 AM

      I don’t have experience with this. Try asking your question on Stack Overflow.

      • mitesh said, on February 24, 2012 at 12:39 AM

        when clicking on camera in android emulator….an error message occurs “unfortunately camera stop working”….help me??/

      • rmt said, on February 24, 2012 at 1:09 AM

        What do you mean? The camera button? What were you doing before you clicked on it?

  60. aminalzanki said, on February 23, 2012 at 10:17 AM

    Good day Sir,

    Currently, i am doing my Final Year Project. My question is : How can i export the resulting text for another purpose? For example, i wanna use the resulting text to search in my server’s database. What function do i need to satisfy that?

    Newbie.

    • rmt said, on February 23, 2012 at 11:26 AM

      The OCR quality can be poor, especially with bad lighting conditions, so you may want to do some data validation before searching a database, but the OCR result is a String so you can pretty much do whatever with it.

      • aminalzanki said, on February 24, 2012 at 9:20 AM

        Sir, do you have any suggestion website for me to refer to starting compiling in Linux VM, because i tried to research before, but cant find. I need no start compiling this source code from scratch. Really need your attention and help.

      • rmt said, on February 24, 2012 at 9:38 AM

        https://www.virtualbox.org/

  61. aminalzanki said, on February 24, 2012 at 11:01 AM

    how to install eclipse, ndk, etc on Linux VM (Oracle VM)? Do you have any reference regarding this? why cant just sompile it in window 7? I need your help. Greetings.

  62. aminalzanki said, on February 27, 2012 at 10:39 PM

    i have installed already NDK r6b before. i want to install NDK r7b, can i just download NDK r7b and install it? or it will overlapped the NDK r6b? Or can i just update from NDK r6b?

    • rmt said, on February 27, 2012 at 11:10 PM

      You can install the new NDK and add it to your Path (and you should remove the old NDK from your Path to avoid a conflict).

  63. mekala said, on March 15, 2012 at 4:47 AM

    hi i’m getting error at this step
    adb shell am instrument -w -e package com.googlecode.tesseract.android.test \
    com.googlecode.tesseract.android.test/android.test.InstrumentationTestRunner

    Errors :2
    Error in testGetUTF8Text
    Error in testSetImage

    Please help me

    • rmt said, on March 15, 2012 at 9:43 PM

      Did the project build successfully? I’m not sure how up to date the test cases are–you’ll need to track down the problem yourself on this.

  64. Bad said, on March 18, 2012 at 8:59 AM

    aminalzanki@aminalzanki-VirtualBox:~/rmtheis-tess-two-071820a/tess-two$ /home/aminalzanki/android-sdk-linux/tools/
    bash: /home/aminalzanki/android-sdk-linux/tools/: Is a directory
    aminalzanki@aminalzanki-VirtualBox:~/rmtheis-tess-two-071820a/tess-two$ ant release
    Buildfile: build.xml

    BUILD FAILED
    /home/aminalzanki/rmtheis-tess-two-071820a/tess-two/build.xml:7: Source resource does not exist: /home/aminalzanki/rmtheis-tess-two-071820a/tess-two/local.properties

    Total time: 0 seconds
    aminalzanki@aminalzanki-VirtualBox:~/rmtheis-tess-two-071820a/tess-two$

    what should i do sir?

    • rmt said, on March 19, 2012 at 10:59 AM

      I don’t know–you need to give more information. Are you trying to compile tess-two? Have you seen the instructions? What did you type before this? What OS, SDK, and NDK version are you using?

  65. kalag said, on March 25, 2012 at 7:50 PM

    Hi, thanks for your sharing.
    I have a problem.
    How do you implement whitelist function?
    Could you give me some point or code?
    Thanks again.

  66. aminalzanki said, on April 2, 2012 at 5:52 AM

    Sir,

    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/googlecode/leptonica/android/AdaptiveMap;
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.command.dexer.Main.processClass(Main.java:486)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.command.dexer.Main.processOne(Main.java:418)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.dx.command.dexer.Main.run(Main.java:206)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at java.lang.reflect.Method.invoke(Method.java:616)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:745)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:634)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.resources.Project.build(Project.java:124)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:961)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:146)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:937)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1141)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Dx 1 error; aborting
    [2012-04-02 21:48:19 - com_googlecode_tesseract_android] Conversion to Dalvik format failed with error 1

    see the last message. Conversion to Dalvik format failed with error 1. Help me !!

  67. Hatsu said, on April 10, 2012 at 9:23 AM

    Thanks, Robert. One thing– is it possible to get the latest source version (0.5.11)? I grabbed and built the version you have on github and it was 0.5.10, but the latest in the Android Market Place is 0.5.11. Thanks.

  68. Mike said, on June 1, 2012 at 3:16 PM

    Hi,

    After update tess-two to tesseract 3.02 and rebuild I have error like below in my app:

    06-02 01:13:36.220: D/dalvikvm(4897): Trying to load lib /data/data/com.ocr/lib/liblept.so 0x40d823a0
    06-02 01:13:36.220: D/dalvikvm(4897): Added shared lib /data/data/com.ocr/lib/liblept.so 0x40d823a0
    06-02 01:13:36.220: D/dalvikvm(4897): Trying to load lib /data/data/com.ocr/lib/libtess.so 0x40d823a0
    06-02 01:13:36.255: D/dalvikvm(4897): Added shared lib /data/data/com.ocr/lib/libtess.so 0x40d823a0
    06-02 01:13:36.465: I/Tesseract(native)(4897): Initialized Tesseract API with language=eng
    06-02 01:13:36.490: D/dalvikvm(4897): Trying to load lib /data/data/com.ocr/lib/liblept.so 0x40d823a0
    06-02 01:13:36.490: D/dalvikvm(4897): Shared lib ‘/data/data/com.ocr/lib/liblept.so’ already loaded in same CL 0x40d823a0
    06-02 01:13:36.495: D/dalvikvm(4897): Trying to load lib /data/data/com.ocr/lib/liblept.so 0x40d823a0
    06-02 01:13:36.495: D/dalvikvm(4897): Shared lib ‘/data/data/com.ocr/lib/liblept.so’ already loaded in same CL 0x40d823a0
    06-02 01:13:36.625: A/libc(4897): Fatal signal 11 (SIGSEGV) at 0×00000000 (code=1)

    what can be the problem?

    • rmt said, on June 1, 2012 at 4:21 PM

      I don’t know offhand. Did it crash at baseApi.init()?

      • Mike said, on June 2, 2012 at 12:58 AM

        Some more debug info:

        06-02 10:55:06.145: I/OCR(6478): Last line: 5168. 31.05.2012 5,29,32,33,38,41
        06-02 10:55:25.385: D/dalvikvm(6478): Trying to load lib /data/data/com.ocr/lib/liblept.so 0x40d83ec8
        06-02 10:55:25.390: D/dalvikvm(6478): Added shared lib /data/data/com.ocr/lib/liblept.so 0x40d83ec8
        06-02 10:55:25.390: D/dalvikvm(6478): Trying to load lib /data/data/com.ocr/lib/libtess.so 0x40d83ec8
        06-02 10:55:25.440: D/dalvikvm(6478): Added shared lib /data/data/com.ocr/lib/libtess.so 0x40d83ec8
        06-02 10:55:25.440: I/OCR(6478): TessBaseAPI instace
        06-02 10:55:25.635: I/Tesseract(native)(6478): Initialized Tesseract API with language=eng
        06-02 10:55:25.635: I/OCR(6478): baseApi after init
        06-02 10:55:25.670: I/OCR(6478): baseApi set image
        06-02 10:55:25.675: D/dalvikvm(6478): Trying to load lib /data/data/com.ocr/lib/liblept.so 0x40d83ec8
        06-02 10:55:25.675: D/dalvikvm(6478): Shared lib ‘/data/data/com.ocr/lib/liblept.so’ already loaded in same CL 0x40d83ec8
        06-02 10:55:25.685: D/dalvikvm(6478): Trying to load lib /data/data/com.ocr/lib/liblept.so 0x40d83ec8
        06-02 10:55:25.685: D/dalvikvm(6478): Shared lib ‘/data/data/com.ocr/lib/liblept.so’ already loaded in same CL 0x40d83ec8
        06-02 10:55:25.685: I/OCR(6478): baseApi getUTF8Text
        06-02 10:55:25.825: A/libc(6478): Fatal signal 11 (SIGSEGV) at 0×00000000 (code=1)

        So its looks like it crashes on getUTF8Text :/

    • rmt said, on June 2, 2012 at 9:37 AM

      Is your image formatted as ARGB_8888?

      • Mike said, on June 2, 2012 at 9:53 AM

        // Convert to ARGB_8888, required by tess
        bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
        I have this so it is.
        The same image worked with 3.01.

      • rmt said, on June 2, 2012 at 9:57 AM

        Do other images work properly? For example, do the test cases pass?

  69. Mike said, on June 2, 2012 at 10:06 AM

    OK. Some images works and some doesnt :/
    There is no exception I cant catch it :/ I havent this before.
    Maybe this depend on resolution of image?

    • rmt said, on June 2, 2012 at 10:09 AM

      If you think it’s a memory problem, try running it on an emulator with a large amount of RAM defined.

      • Mike said, on June 2, 2012 at 10:40 AM

        My device is Galaxy S2 so can RAM be a problem?

        some more debug from logcat http://pastebin.com/75BxyBTP

        When I took image from device to emulator it works

      • rmt said, on June 2, 2012 at 3:40 PM

        Well, if it works on the emulator, then it’s not a problem with the library project, so you can rule that out. Unfortunately the log information from the SIGSEGV is not really helpful, so you have to use trial and error to find the source of the problem.

        Can you post a link to the image?

      • Mike said, on June 3, 2012 at 2:43 AM

        Link to image:
        http://imageshack.us/photo/my-images/525/croppedp.jpg/

    • rmt said, on June 7, 2012 at 8:41 PM

      This image scans fine for me using Tesseract 3.02 via tess-two. There’s no crash.

  70. Mike said, on June 7, 2012 at 4:37 AM

    I build code from https://code.google.com/p/tesseract-android-tools/ with tesseract 3.01 and leptonica 1.68 and problem dissapeared.

    • rmt said, on June 7, 2012 at 8:42 PM

      Thanks for the update. Maybe some other problem had crept into your setup, and rebuilding your code solved the problem.

  71. kalag said, on June 9, 2012 at 7:30 PM

    hello
    I import your ocr-test source into eclipse and want to compile it.
    But there are many error in code like below:
    ===================================================================================
    Multiple markers at this line
    - The method onShutterButtonClick(ShutterButton) of type CaptureActivity must override a superclass
    method
    - implements
    edu.sfsu.cs.orange.ocr.camera.ShutterButton.OnShutterButtonListener.onShutterButtonClick
    ===================================================================================

    always appear the section include @Override.

    How to fix it?
    Thank you.

    • rmt said, on June 9, 2012 at 9:58 PM

      Make sure your Java compliance level is set to 1.6 under Project->Properties->Java Compiler.

  72. Ricki Lambert said, on June 10, 2012 at 8:29 AM

    I am so desperate for some help :D I have no idea how to use linux and am sturggling my way through this guide in hope that I can get it to work! I am using ubuntu and have followed the guide in this order.

    I created 2 android projects in eclipse
    On the command line i checked out the tess source code
    built all the files according to the read me

    at this stage i got an error, it said build failed when doing ant release the error was

    ricki@ubuntu:~/tesseract-android-tools/tesseract-android-tools$ ant release Buildfile: build.xml

    BUILD FAILED /home/ricki/tesseract-android-tools/tesseract-android-tools/build.xml:46: sdk.dir is missing. Make sure to generate local.properties using ‘android update project’

    at this stage i thought maybe i had missed something, so i proceeded to go back to the guide and do the modifications you suggest. I did all 3 and then went back to try and do an ant release. I still got the same error. I do not know what more infromation to provide you with but if there is anything I can do in order to help you help me then please let me know.

    KInd regards

  73. ANT Build error said, on June 10, 2012 at 8:59 AM

    [...] guide I am using is from here http://rmtheis.wordpress.com/2011/08/06/using-tesseract-tools-for-android-to-create-a-basic-ocr-app/ and I am following the instructions word for [...]

    • Ricki Lambert said, on June 10, 2012 at 10:26 AM

      hi there,

      i have fixed the issue above and now at the stage where i need to try and compile the code. As it stands, i am getting an exception being thrown at baseApi.init(myDir.toString(), “eng”); even though the folder called tessdata has already been written.

      Any idea what could be the cause of this?

      • rmt said, on June 10, 2012 at 11:14 AM

        What exception do you get? Did you put the traineddata in the folder?

  74. Ricki Lambert said, on June 10, 2012 at 11:25 AM

    sorry yes i have fixed it all now- now it is just a battle to get it to recognise number plates. any tips on how to improve the accuracy, any tips on types of photographs etc? im making this in to an android app you see :p

  75. kalag said, on June 13, 2012 at 3:46 AM

    hello,
    I found that the older version android-ocr that using tesseract 3.0 have better accuracy for digit.
    Could you provide old version of android-ocr (or tess-two) to download?
    Could I just replcae source code of tesseract to compile tess-two?
    Thank you again.

    • rmt said, on June 13, 2012 at 6:13 AM

      Currently you can use v3.01 or v3.02 via tess-two. If you wanted to use v3.00 you would probably need to change the NDK makefiles somewhat to accommodate the differences in the source code. I am doubtful that accuracy is really better using v3.00, though.

  76. Ricki said, on June 13, 2012 at 4:21 AM

    hi, I am having some problems with the copying of the charachters.

    I have set my white list, yet sometimes i still get output such as
    “recognizedText” -l\n_li\n_*-2

    TessBaseAPI baseApi = new TessBaseAPI();
    baseApi.setVariable(TessBaseAPI.VAR_CHAR_WHITELIST, “1234567890ABCDEFGHJKLMNPRSTVWXYZ”);
    baseApi.init(myDir.toString(), “eng”);
    baseApi.setImage(img);
    recognizedText = baseApi.getUTF8Text();
    baseApi.end();

    • rmt said, on June 13, 2012 at 6:10 AM

      Do the setVariable() after the init().

  77. kalag said, on June 17, 2012 at 9:54 AM

    Is it possible to implement auto capture when mean confidence is higher than 70?

    • rmt said, on June 17, 2012 at 6:55 PM

      Yes.

      • kalag said, on June 17, 2012 at 9:57 PM

        wow, could you give me some tips when you have time?
        thank you very much.

    • rmt said, on June 19, 2012 at 9:17 AM

      Just comparing against the mean confidence integer, and re-capturing if it’s too low, works OK. For a commercial product you would need a more capable approach, though.

  78. mohamed ali said, on July 3, 2012 at 12:37 PM

    Your tutorial was great it helped me greatly but I have a request I am trying to make tesseract read arabic digit it has the same decimal system as english but the program just shuts every time i try to recognize them.
    If you can help me please tell me how read arabic or how to make training data for digits only because that is all i need

    • rmt said, on August 29, 2012 at 4:35 PM

      It could be a RAM problem. Try it on a device with a lot of RAM, or create a new AVD with a lot of RAM (>1GB). Also, be sure you’re using TessBaseAPI.OEM_CUBE_ONLY and not TessBaseAPI.OEM_TESSERACT_CUBE_COMBINED.

      • Reham said, on February 13, 2014 at 5:17 AM

        Hi mohamed
        if you have a solution for this problem please help me … I have the same problem

  79. Murali said, on August 20, 2012 at 6:20 AM

    Hi rmt,
    Thanks for your tutorial. For me TessBaseAPI returns wrong value. how can I resolve this error. Would you please help me? Thanks in advance.

    • rmt said, on August 29, 2012 at 4:37 PM

      You didn’t leave enough detail for me to even begin to answer this question. Try asking on StackOverflow and include all the details, starting with the error message you get, the image you’re trying to recognize, and the portion of code that you think is causing the problem.

  80. Leon Tan said, on October 8, 2012 at 7:03 PM

    Hi Robert,
    if i wish to add a button on the same interface of where the source_language is translated and translated_text is displayed in blue colour, may i know which java file can i modify in order to add the button? seek for your reply, thx

    Regards,
    Leon

    • rmt said, on October 8, 2012 at 7:24 PM

      CaptureActivity.java/layout.xml

      • Leon Tan said, on October 8, 2012 at 11:02 PM

        Thx for the replies, does the layout.xml refers to the layout/capture.xml?
        how about the viewFinderview.java?

        Regards,
        Leon Tan

      • rmt said, on October 8, 2012 at 11:23 PM

        Yes. layout/capture.xml. You don’t need to modify viewFinderview.java.

      • Leon Tan said, on October 8, 2012 at 11:32 PM

        Okay, i had done it, with
        Speech = (Button) findViewById(R.id.Speech);
        registerForContextMenu(Speech);
        thank you so much ! :)

  81. Khanh Nguyen said, on November 18, 2012 at 10:22 AM

    How coult I use the ” public void setImage(byte[] imagedata, int width, int height, int bpp, int bpl)” ?

    • rmt said, on November 24, 2012 at 2:47 PM

      Use the raw image data. What’s your question, specifically?

  82. terril123 said, on December 13, 2012 at 12:51 PM

    Anything for digital fonts which is being captured from LED i have read about SSOCR can u tell be how to work with it?

    Thanks for the tutorial .

    • rmt said, on December 13, 2012 at 11:49 PM

      I haven’t been able to find any 7-segment digit trained data files that are publicly available. Never tried SSOCR.

  83. Selvamariappan said, on December 13, 2012 at 11:23 PM

    java.lang.ExceptionInInitializerError came

    • rmt said, on December 13, 2012 at 11:50 PM

      Not enough info. What’s the entire message you see?

  84. viru48 said, on December 20, 2012 at 12:11 AM

    hello rmt, i have followed the way you dealt with this tutorial but i was prompted with an error ” No activity specified! Getting the launcher activity.”

    • rmt said, on December 20, 2012 at 12:24 PM

      That could be an AndroidManifest.xml problem.

  85. viru48 said, on December 23, 2012 at 11:12 PM

    Thanks, i have solved it. ,but the accuracy is so poor. Not a word in the image matches.

  86. viru48 said, on December 23, 2012 at 11:20 PM

    how to fix it ??

    • rmt said, on December 23, 2012 at 11:26 PM

      It depends. What are you OCRing? What is the result? Post a link to your image.

  87. viru48 said, on December 27, 2012 at 2:52 AM

    can you suggest any tutorial which explains the translating the text after OCRing. i have checked a link referred by gaut.am in his blog written for intermediate+. but it needs more explanation.

  88. prince said, on August 6, 2013 at 4:12 AM

    i need to run ocr test and i got the gode.can any one guide me to run it in eclipse..? Thanks in advance

  89. Leeon said, on September 13, 2013 at 8:39 AM

    I can’t run this code for multiple words/multiple text lines. Logcat says,Fatal signal. Is there any way to get rid of this

  90. manivannan said, on September 20, 2013 at 2:53 AM

    hi.. i tried but i get the following error. please help me..
    Compile arm : jpeg <= jidctfst.S
    jni/../external/libjpeg/jidctfst.S: Assembler messages:
    jni/../external/libjpeg/jidctfst.S:66: Error: missing ')'
    jni/../external/libjpeg/jidctfst.S:66: Error: garbage following instruction — `pld (r2,#0)'
    jni/../external/libjpeg/jidctfst.S:259: Error: missing ')'
    jni/../external/libjpeg/jidctfst.S:259: Error: garbage following instruction — `pld (sp,#32)'
    jni/../external/libjpeg/jidctfst.S:271: Error: missing ')'
    jni/../external/libjpeg/jidctfst.S:271: Error: garbage following instruction — `pld (ip,#32)'
    make: *** [obj/local/armeabi/objs/jpeg/jidctfst.o] Err
    or 1

  91. Tharanga said, on November 2, 2013 at 8:00 PM

    when “TessBaseAPI baseApi = new TessBaseAPI()” excute i got error.how to fix it?

  92. Anny said, on January 12, 2014 at 9:29 PM

    Hi…I setup Everything ….But the accuracy is so much poor..
    I am not able to get the exact text that the image contain…
    How to get the exact text from an image using OCR…
    Please Help me in this..
    You can also help me at :https://github.com/rmtheis/tess-two/issues/34
    Waiting for your reply…
    please please need help urgently…
    please help me

    • rmt said, on January 12, 2014 at 9:32 PM

      Try asking your question at stackoverflow.com. Be sure to include *all* the details about the problem, including *exactly* what you’ve tried so far.

  93. Reham said, on February 13, 2014 at 4:49 AM

    Your tutorial was great it helped me greatly but I want to make tesseract read arabic digit
    If you can help me please tell me how read arabic or how to make training data for digits only because that is all i need

  94. AJ said, on February 26, 2014 at 11:11 PM

    Hello,
    I intend to use tess-two to create a phonegap android plugin. Do I simply copy the .so files and put them in my lib folders are are they other files that need to be copied along?

  95. Sarath said, on May 5, 2014 at 7:29 AM

    Hi.. I am using win 8 with cygwin terminal for do this project. When i build the ndk, an error occured.. Please Help Me..!!!

    “” $ /cygdrive/c/android-ndk-r9d/ndk-build
    awk: /cygdrive/c/android-ndk-r9d/build/awk/extract-minsdkversion.awk:52: fatal: cannot open file `E:DevelopmentAndroidtess-two/AndroidManifest.xml’ for reading (No such file or directory)
    awk: /cygdrive/c/android-ndk-r9d/build/awk/extract-debuggable.awk:55: fatal: cannot open file `E:DevelopmentAndroidtess-two/AndroidManifest.xml’ for reading (No such file or directory)
    /cygdrive/c/android-ndk-r9d/build/core/prebuilt-library.mk:68: *** target pattern contains no ‘%’. Stop.
    “”

    • rmt said, on May 5, 2014 at 10:56 AM

      I suggest not using Cygwin. Try doing the build with a regular Windows terminal.

  96. Lahiru J Ekanayake said, on June 28, 2014 at 5:51 PM

    hello can you help me to configure google teseract project
    When i create object using

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

    TessBaseAPI baseApi = new TessBaseAPI();

    It will you unfortunately Allication has stopped, but it compile and installed well

    can you please help me..
    ekanayakelahiru@gmail.com


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.