我想得到的结果,这是在图像格式的匹配。 下面是我用来从图像中读取文本的代码。我使用了python代码,它也给出了相同的结果。我如何提高产量,或者有没有其他更好的方法来解决我的问题
public String getImgText(String imageLocation) {
ITesseract instance = new Tesseract();
try
{
instance.setDatapath("/tessdata");
instance.setLanguage("eng");
String imgText = instance.doOCR(new File(imageLocation));
return imgText;
}
catch (TesseractException e)
{
e.getMessage();
return "Error while reading image";
}
}
输出与输入完全不同
unnl lE
mam-m m,
mun-m, 1 ms "mm M
W urn-mm my A mm“ m
mus-1mm 1 m- m m
mfinlln um: ”mu“ m
ilk-M m.
mwnm mu 5 mm nu-
..mn. n w. tvhrzmr- m
2 rm.“- 0 w, mama: m.
mum-mp 5 mu mum n.
a bulb-h» m
tum-3mm nun mm,” M
3 mmn m; mum“ M
Ema W 7 a“. m
mzsm 5m mm»... m
Continue
输入图像为
在运行Tesseract(带有opencv库的python代码)之前,应预处理图像:
结果是这样的:
此外,英语traineddata似乎对PUBG字体的处理很差,因此您可能需要对其进行微调: Training eng.traineddata for PUBG font
相关问题 更多 >
编程相关推荐