We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

OCR Unspected output

Hi I´m testing The OCR for java and I´m gettin a very rare aswer.

this is my code

/*
* Copyright 2001-2013 Aspose Pty Ltd. All Rights Reserved.
*
* This file is part of Aspose.OCR. The source code in this file
* is only intended as a supplement to the documentation, and is provided
* “as is”, without warranty of any kind, either expressed or implied.
*/

package programmersguide.workingwithocr.performocronimage.java;

import com.aspose.ocr.*;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class PerformOCROnImage
{
public static String myDir = “c:/temp/”;

public static void main(String[] args) throws Exception
{
License license= new com.aspose.ocr.License();
// load the license file into FileStream object
try {
license.setLicense(new java.io.FileInputStream(“C:\Users\Juan\Downloads\Aspose.Total.Java.lic”));
System.out.println(“licence loaded”);
} catch (FileNotFoundException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
// Set the paths
String imagePath = “C:\Users\Juan\Desktop\imging.jpg”;
String resourcesFolderPath = “…/resources/resource.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](https://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
try {
System.out.println(“the ocr proccess is begining”);
if (ocr.process()) {
System.out.println(“Process finished”);
System.out.println("\ranswer -> " + ocr.getText());
}
} catch (Exception e) {
System.out.println(“error”);
e.printStackTrace();

}
}
}

I´ve commented this line ocr.getConfig().setNeedRotationCorrection(false);

and I´m testing with that image

http://imagizer.imageshack.us/v2/280x200q90/661/Fq6AOC.jpg

that is the output

answer -> h? 2eNaf l l -f–`{ i NQV*N*Myer*

*LBt-lexplix %\ III::s .c ^[^ sex-:s<[\ McI^^^^ I :cricin m= I*- # ^!e<

s! s sd: m? *sv :? ssli x??^??% h

What I´m doing wrong?

Hi Juan,


Thank you for reporting this problem.

We are able to replicate the problem of incorrect results when performing OCR operation with latest version of the Aspose.OCR for Java 2.0.0 API. The problem has been logged into our bug tracking system under the ticket OCR-33838 for further investigation & correction purposes. Please spare us little time to properly analyze the problem cause, and to provide a fix for it. In the meanwhile, we will keep you posted with updates in this regard.

Please accept our apologies for the inconvenience caused to you.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.