--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/85a15318-3f8b-43cb-9e9e-74be69a29825%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
java.lang.Error: Invalid memory access
at com.sun.jna.Native.invokePointer(Native Method) ~[jna-4.5.1.jar:4.5.1 (b0)]
at com.sun.jna.Function.invokePointer(Function.java:490) ~[jna-4.5.1.jar:4.5.1 (b0)]
at com.sun.jna.Function.invoke(Function.java:434) ~[jna-4.5.1.jar:4.5.1 (b0)]
at com.sun.jna.Function.invoke(Function.java:354) ~[jna-4.5.1.jar:4.5.1 (b0)]
at com.sun.jna.Library$Handler.invoke(Library.java:244) ~[jna-4.5.1.jar:4.5.1 (b0)]
at com.sun.proxy.$Proxy77.TessBaseAPIGetUTF8Text(Unknown Source) ~[na:na]
at net.sourceforge.tess4j.Tesseract.getOCRText(Tesseract.java:433) ~[tess4j-4.0.1.jar:4.0.1]
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:288) ~[tess4j-4.0.1.jar:4.0.1]
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:209) ~[tess4j-4.0.1.jar:4.0.1]
at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:193) ~[tess4j-4.0.1.jar:4.0.1]
Pointer utf8Text = renderedFormat == RenderedFormat.HOCR ? api.TessBaseAPIGetHOCRText(handle, pageNum - 1) : api.TessBaseAPIGetUTF8Text(handle);
[SOLVED] changed the language from 'hin+eng' to 'hin'
In this case selection of language also matters - I was processing image with lang=hin+eng, but it was giving the same error (mentioned in this post)
As English text was less in the image so I changed lang=hin and I got the expected result.
public static void main(String[] args) {
Tesseract in = new ReadImageText().getTesseractInstance("C:/Program Files (x86)/Tesseract-OCR/tessdata/", "hin");
try {
String resultText = in.doOCR(new File("C:/EA/app-result/im/01-001/34/0.png"));
log.info("resultText {}", resultText);
} catch (TesseractException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}