Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6151755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:48:49+00:00 2026-05-23T19:48:49+00:00

I built the tesseract ocr for android using android tesseract tool and everything went

  • 0

I built the tesseract ocr for android using android tesseract tool and everything went fine. I also got the library files. When I tried to use the java wrappers to access the native methods, the device crashes. I’m using the tesseract directly in camera callback.

The code looks something like this:

public class AndroidCamera extends Activity implements SurfaceHolder.Callback {

    TessBaseAPI tba;

    PictureCallback myPictureCallback_JPG = new PictureCallback() {

        public void onPictureTaken(byte[] data, Camera arg1) {
            Bitmap bitmapPicture = BitmapFactory.decodeByteArray(data, 0, data.length);
            tba = new TessBaseAPI();
            tba.setImage(bitmapPicture);
            String result = tba.getUTF8Text();
            Log.i("text: "+result);

            Toast.makeText(AndroidCamera.this,result,Toast.LENGTH_LONG).show();
        }
        camera.startPreview();
    };
}

I checked in the log cat still setimage it’s working fine, in the tba.getUTF8Text() the device crashes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:48:49+00:00Added an answer on May 23, 2026 at 7:48 pm

    I don’t see any engine initialization code with the desired language. This is done by calling the init method with the language/directory.

        // if trained data is /mnt/sdcard/tessdata/eng.traineddata then 
        // the tesseractDirectory should be /mnt/sdcard/
        String tesseractDirectory ="path to tessdata dir";
        TessBaseAPI api = new TessBaseAPI();
    
        // eng - english language
        api.init(tesseractDirectory, "eng");
        // you may want to provide a grayscale/high contrast image for better results
    

    Trained data can be downloaded here: http://code.google.com/p/tesseract-ocr/downloads/list

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which built in (if any) tool can I use to determine the allocation unit
I built an app, I add articles, I view articles, everything is fine on
I cloned the tesseract code from here and built the iphone OCR demo for
I built a template-based document generator using the Open XML SDK (1.0) , the
I built a client server application using posix shared memory and posix unnamed semaphores
I built a custom activity referencing a custom library. When I drop my custom
I built a new FlowDocument Paragraph B by examining/using elements of an existing Paragraph
The built-in i18n message files for Yesod are very nice but I've noticed two
I have an application, which uses some 3rd party libraries, for example Tesseract library.
I built a application, it generates Excel with COM Interop. It works fine on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.