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?