0

When invoking tesseract doOcr on a multi page tiff documents throws invalid memory access error. Datapath is set to the folder where tessdata is present and dlls are present in classes folder

Exception in thread "main" java.lang.Error: Invalid memory access
    at com.sun.jna.Native.invokePointer(Native Method)
    at com.sun.jna.Function.invokePointer(Function.java:470)
    at com.sun.jna.Function.invoke(Function.java:404)
    at com.sun.jna.Function.invoke(Function.java:315)
    at com.sun.jna.Library$Handler.invoke(Library.java:212)
    at com.sun.proxy.$Proxy0.TessBaseAPIGetUTF8Text(Unknown Source)
    at net.sourceforge.tess4j.Tesseract.getOCRText(Tesseract.java:429)
    at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:284)
    at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:205)
    at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:189)
    at Test.main(Test.java:23)
  • See http://stackoverflow.com/questions/19894890/tess4j-invalid-memory-access – Mihai8 Jun 26 '15 at 10:33
  • tried that option as well. not working when psm=ITessAPI.TessPageSegMode.PSM_AUTO is used. Works with psm = -1 – SIVAPRIYA V Jun 26 '15 at 10:40
  • This usually indicates you're passing a buffer to the native code that is invalid (might be already freed, might be too small). Verify that all your parameters are sane when you enter `TessBaseAPIGetUTF8Text`. – technomage Jun 26 '15 at 11:59
  • Make sure your Java architecture matches your Windows architecture. – mhcuervo Apr 08 '16 at 07:13
  • Possible duplicate of [Tess4J: Invalid memory access](http://stackoverflow.com/questions/19894890/tess4j-invalid-memory-access) – Raedwald Mar 06 '17 at 11:05

0 Answers0