How to work without Java.awt.image?

1

I need some help on using OCR on Android, all the libraries I've tried to use to convert image to Precise Text or a BufferedImage or Renderedimage, both of which are in the Java.awt.image library that does not is present on Android. The code has no error in my Android Studio but when I command compile of the error:

Error:(111, 57) error: cannot access RenderedImage
class file for java.awt.image.RenderedImage not found

I'm using Ascript OCR and have already tested various Tesseract adapted libraries already compiled for Java but it does not work.

Someone has an idea of how to circumvent this maybe with Android Graphics or some other way, some third-party library.

String pictureFile = "MinhaFoto_" + date + ".jpg";
String filenameFull = pictureDir.getPath() + File.separator + pictureFile;
File pictureFileFull = new File(filenameFull);

try {
    FileOutputStream fos = new FileOutputStream(pictureFileFull);
    fos.write(data);
    fos.close();

    Ocr.setUp(); // one time setup
    ocr = new Ocr(); // create a new OCR engine
    ocr.startEngine("por", Ocr.SPEED_FASTEST); // Portugues
    String textoConvertido = ocr.recognize(new File[] {pictureFileFull},
            Ocr.RECOGNIZE_TYPE_ALL, Ocr.OUTPUT_FORMAT_PLAINTEXT); // PLAINTEXT | XML | PDF | RTF

    ocr.stopEngine();
    
asked by anonymous 26.10.2015 / 20:45

0 answers