Hi,
Evaluating the OCR Engine under Java platform I executed the demo package.
Environment: WIN 2008 Server 64bit + Java 1.6u35.
The result is: getText() -> abcdefgnij
What about the other part of text?
Why the engine doesn’t recognize it?
I tried also with another image (see attchment) but the engine recognize only “sheepscot”.
What is wrong in my approach?
To complete the question I send also the source code of the test.
// Set the paths
String imagePath = “./…/samples/Sample2.bmp”;
String xmlEtalonFileName = “englishStandarts”;
String fontCollectionFileName = “arialAndTimesAndCourierRegular.xml.bin”;
String resourcesFilePath = “./…/…/…/…/resources/resources.zip”;
// Create an instance of OcrEngine class but providing required parameters
OcrEngine ocr = new OcrEngine(ResourcesSource.BINARY_ZIP_FILE,
resourcesFilePath, xmlEtalonFileName, fontCollectionFileName);
ocr.getConfig().setNeedRotationCorrection(false);
// Set image file
File image = new File(imagePath);
ocr.setImage(image);
// Add language
ILanguage language = Language.load(“english”);
ocr.getLanguages().addLanguage(language);
// Perform OCR and get extracted text
try
{
ocr.process();
}
catch (Exception e)
{
e.printStackTrace();
}
// Get info about each part of the recognized text
IRecognizedText recognizedText = ocr.getText();
IRecognizedTextPartInfo[] parts = recognizedText.getPartsInfo();
for (IRecognizedTextPartInfo part : parts)
{
System.out.println("part.getText() => " + part.getText());
float[] quality = part.getCharactersQuality();
System.out.println("quality : ");
for (float f : quality)
{
System.out.println(f);
}
}