Google Glass OCR Tutorial using Eclipse

Glass OCR Tesseract

Glass OCR Tesseract

While scanning QR codes can be achieved by porting the ZXing library app to Google Glass (which has been accomplished by BarcodeEye), I thought it be interesting to also combine OCR and Glass. OCR stands for Optical Character Recognition. The

Posted in Glass, Technical
17 comments on “Google Glass OCR Tutorial using Eclipse
  1. hello can you help me to configure google teseract project
    When i create object using

    TessBaseAPI baseApi = new TessBaseAPI();

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

  2. Michael Siu says:

    Hi Lahiru,

    Are you running it on Google Glass? Or a mobile device?

    In your case, I will double check the following:

    – Did you follow all the steps to build Tesseract properly?
    – Did you add google glass lib in your project
    – Does your example Tesseract app running properly on your android phone?

    I will start with these item to make sure it’s running properly.

    Happy coding! 🙂

  3. gsbchkteam says:

    Hi, I’m new to Google glass. Would you tell me where I should “Add the following sample code to the project

  4. gsbchkteam says:

    Hi, I have tried the whole afternoon, it seems like I couldn’t run the code under 4.4 SDK. Is it because of the SDK upgrade from 4.0.3 to 4.4? Is there any solution? Where I download the glass sneak peek 4.0.3? Thanks.

  5. gsbchkteam says:

    I should say I can run the code in 4.4 by changing the following.

    // TimelineManager tm = TimelineManager.from(context);
    liveCard = new LiveCard(context,cardId);
    // liveCard.setNonSilent(false); // the livecard runs in the “background” only.

    When I ran the program, I could take a picture but it stucked at “Tap to accept”
    In the debug comment, the last call is “handleGestureTap() called”

    I really want to get it running. Either modify the code or if I can download the 4.0.3 for glass. Any suggestion will be great. Thanks.

    • rui says:

      I got the same problem, but after i checked the logCat, i found it’s because the language model is not put in the right DATA_PATH variable, make sure that in google glass, there is a “tessdata/” folder inside the DATA_PATH, and the language model “eng.traineddata” should be put inside tessdata folder. It would be nice if we could first preview then take a picture with right position and distance instead of suddenly save a picture and ocr it.

  6. gsbchkteam says:

    We saw this bug of startActivityForResult for SDK 4.4, is it true? Thanks

  7. gsbchkteam says:

    We found out the doBindService return false. Is it the SDK 4.4 problem? Thx

  8. Yours Truly says:

    Hey man, thanks for putting this tutorial up. I’m following it and brushing up on my sword fighting while it compiles.
    One question, how does the training data end up in the library? Do I need to manually import it before compilation?

  9. Michael Siu says:

    @Yours Truly
    You don’t need to manual import anything, after compiling, the OCR should work

  10. Michael Siu says:


    I haven’t run this project after the update, let me get back to you

  11. Michael Siu says:


    After the update, some of the code broke, but it works fine with 4.0.3, i got it to work at demo at the BitCoin Hackathon in Toronto

  12. Great tutorial.. But this doesnt work anymore.. The code uses Timeline which is not supported with the latest version.Can you please post the latest code?

  13. Sushil says:

    What Changes need to be done in the upgraded version ?
    Can you please Highlight the code.

  14. Nayal says:

    TessBaseAPI baseApi = new TessBaseAPI(); for android will stop the application. any suggestion
    and how to put image as local resource,not from camera or SD car input

  15. amar says:

    Did u get the solution for TimeLineManager package error.or else can u send me the timeline manager class

Leave a Reply