2

I'm trying to use Tesseract as a 3rd party OCR (tried Asprise beforehand as well), but the internal usage of the main function "doOCR" as it seems depends on BufferedImage object, which from what I can understand is not supported in Android Studio.

Asprise as well needed that object and ImageIO, which is also not supported.

Does anybody know how Tesseract/Asprise can be used in Android Studio, and if it's even possible ? If not, are you familiar with any other OCRs that work in Android Studio ?

Thank you

Omri Aharon
  • 16,959
  • 5
  • 40
  • 58

1 Answers1

2

You have a mismatch definition about IDE, programming language and framework support. Android Studio is just an IDE and use Gradle to build and manage your project. (Eclipse uses different, often Maven to mange project)

Because you code on Android, you muse use Java language (of course, at advanced, Android still supports some others). So that you need java library and android library for that purpose.

It means : Android Studio or Eclipse or Netbeans ... does not decide support or not object IMageIO or something like that. Those IDE just decide how you can mange your project.

If you want to program using Tesseract library on Android, you should find jar file include those libraries and add to your project.

Because you code on Android Studio, you copy those jar files into libs folder. and at file build.gradle you add this line :

compile files('libs/name_of_your_jar_files.jar');

Hope this help you :)

hqt
  • 29,632
  • 51
  • 171
  • 250
  • Thank you. I've done all that before. The issue is that the functions included in the *.jar library I added require the usage of this sort: "BufferedImage bi = ... " but I cannot use this object, even though I see it in the 'java.awt.image' package. The Tesseract, when trying to run a line like this: "tesseract.doOCR(imageFile);" I am getting this error message: "Gradle: error: cannot access BufferedImage". My google searches showed me answers that this is not supported. like this: http://stackoverflow.com/questions/5311163/how-to-load-bufferedimage-in-android – Omri Aharon Nov 08 '13 at 14:50
  • yes. that not support in Android SDK, rather than Android Studio (just and IDE) :) – hqt Nov 08 '13 at 14:54