我试着用下面的图片用Aspose OCR库提取它的文本内容,不幸的是结果不正确。

OcrEngine.getText()返回如下内容:
run:
HEY: + it^7--+i-*l?/r]-*+\>/
m
^s^us^^stm?s^
M\-i-/!$~-
BUILD SUCCESSFUL (total time: 1 minute 38 seconds)下面是我的代码:
import com.aspose.ocr.core.publicapi.*;
import com.aspose.ocr.core.publicapi.pal.PalFontFamily;
import java.io.*;
public class Main{
public static void main(String[] args) throws IOException{
String imagePath = "hi.jpg";
String etalonFile = "englishStandarts.xml";
String fontFile = "arialAndTimesAndCourierRegular.xml";
String resourcePath = "resources.zip";
OcrEngine ocr = new OcrEngine(resourcePath, new int[] {4, 5, 6, 7 }, etalonFile, fontFile);
ocr.getConfig().setNeedRotationCorrection(false);
File image = new File(imagePath);
ocr.setImage(image);
ILanguage language = Language.load("english");
ocr.getLanguages().addLanguage(language);
try{
if(ocr.process()){
System.out.println("HEY: "+ocr.getText());
}
}catch(Exception e){
System.err.println(e);
}
}
}发布于 2015-05-29 12:07:11
从此图像中读取文本似乎有问题。即使是最新的版本也不能工作。请在http://www.aspose.com/community/forums/aspose.ocr-product-family/493/showforum.aspx的Aspose论坛上报告此问题。
我与Aspose一起工作,作为开发人员的布道者。
https://stackoverflow.com/questions/30294734
复制相似问题