I am able to process smaller files say up to 160 kb
When I hit 220 to 250 kb, I am having issues and getting the following error:
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(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at net.sourceforge.tess4j.Tesseract.doOCR(Unknown Source)
at com.nationwide.robot.MinP98TextReader.main(MinP98TextReader.java:34)
split_pt >0 && split_pt < word->chopped_word->NumBlobs():Error:Assert failed:in file ..\..\ccmain\tfacepp.cpp, line 186
Using the following code
Tesseract instance = new Tesseract();
String result = instance.doOCR(outputFile );
Now if I set a rectangle in the doOCR I am able to process that rectangle but not the complete image of course limited to the rectangle. I stepped the rectangle around the file to determine if there is an issue and cannot find a problem with the processing of the image, just a problem with processing the entire image.
so if I process
new Rectangle(0, 0,1200, 1000) It works
If I exceed to new Rectangle(0, 0,1400, 1000), it fails with the above error.
Is there some buffer size I need to adjust to allow for processing the larger image or higher text content images?
Or is there a strategy I can employ other than making lots of rectangles :)