The java.lang.StackOverflowError exception encountered when OCR(aspose-ocr-1.9-jdk16.jar). Can please assist to help?
Source Code:
String imagePath=filePath;
String resourcesFolderPath = “C:\OCRResources.zip”;
// Create an instance of OcrEngine
OcrEngine ocr = new OcrEngine();
// Set Resources for OcrEngine
ocr.setResource(new FileInputStream(resourcesFolderPath));
// Set NeedRotationCorrection property to false
ocr.getConfig().setNeedRotationCorrection(false);
// Set image file
ocr.setImage(ImageStream.fromFile(imagePath));
// Add language
ILanguage language = Language.load(“english”);
ocr.getLanguages().addLanguage(language);
// Perform OCR and get extracted text
if (ocr.process()) {
System.out.println("\ranswer -> " + ocr.getText());
}
Error:
Start…Fri Jun 27 17:07:37 SGT 2014
Exception in thread “main” java.lang.StackOverflowError
at com.aspose.ocr.internal.bJ.l(Unknown Source)
at com.aspose.ocr.internal.du.a(Unknown Source)
at com.aspose.ocr.internal.du.a(Unknown Source)
at com.aspose.ocr.internal.du.a(Unknown Source)
at com.aspose.ocr.internal.bC.(Unknown Source)
at com.aspose.ocr.internal.bC.a(Unknown Source)
at com.aspose.ocr.internal.dW.b(Unknown Source)
at com.aspose.ocr.internal.bC.d(Unknown Source)
at com.aspose.ocr.internal.lv.l(Unknown Source)
at com.aspose.ocr.internal.lv.a(Unknown Source)
at com.aspose.ocr.internal.cr.a(Unknown Source)
at com.aspose.ocr.internal.lv.a(Unknown Source)
at com.aspose.ocr.internal.du.a(Unknown Source)
at com.aspose.ocr.internal.du.a(Unknown Source)
at com.aspose.ocr.internal.du.a(Unknown Source)
at com.aspose.ocr.internal.bC.(Unknown Source)
at com.aspose.ocr.internal.bC.a(Unknown Source)
at com.aspose.ocr.internal.dW.b(Unknown Source)