Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to use Tess4J in my project to extract text from an image. I am getting the following error when I try run the OCR: Exception in thread "main" java.lang.Error: Invalid memory access

    try {
        File imageFile = new File("example4.jpg");
        Tesseract instance = Tesseract.getInstance(); // JNA Interface Mapping
        //Tesseract1 instance = new Tesseract1();
        String result = instance.doOCR(imageFile);
        System.out.println(result);
    } catch (Exception e) {
        e.printStackTrace();
    }   
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
521 views
Welcome To Ask or Share your Answers For Others

1 Answer

you can set the data path i am getting same problem when i set the data path that problem is solved
try try this

instance1.setDatapath("D://Hotel_project//Tess4J-1.2-src//Tess4J//tessdata");


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...