使用Tess4J阅读大纲文本

时间:2019-10-14 20:30:32

标签: java ocr tesseract tess4j

我正在使用Tess4J进行一些OCR。除加粗文字外,一切正常。

像这样的简单代码:

ITesseract instance = new Tesseract();

BufferedImage ocrImage = loadImage();

String screenText = instance.doOCR(ocrImage);

In this image,预期输出文本为“ 4/5”,但返回“ a3”。

I tried changing the image to gray-scale,没有成功。

我发现in this answer可以填充背景或使用“骨架化”功能。

我没有找到使用Java进行骨架化的任何实现,而且,文档说这些方法还不可靠,所以我放弃了此选项。

为了进行测试,我手动填充了背景,因此图像看起来像like this,并且可以正常工作!但我不知道如何以编程方式绘制它。阈值无效,因为轮廓比数字暗。

关于如何自动检测和绘制背景的任何建议?或其他任何其他策略吗?

0 个答案:

没有答案
相关问题