OCR无法在Tess4j中的黑色背景下识别文本

时间:2018-11-15 10:47:43

标签: selenium tesseract tess4j

我无法在黑色背景上提取文本,如所附图像所示。其他所有东西都被认可。

有人可以帮忙吗?

enter image description here

public static void main(String args[]) {
        scrShotDirPath = new File("/Users/prakashp/IdeaProjects/screenshots");
        String imgName = "15-Nov-2018_05_14_57PM.png";
        String result = null;
        File imageFile = new File(scrShotDirPath, imgName);


        logger.info("Image name is :" + imageFile.toString());
        ITesseract instance = new Tesseract();
        File tessDataFolder = LoadLibs.extractTessResources("tessdata");
        instance.setDatapath(tessDataFolder.getAbsolutePath());
        try {
            result = instance.doOCR(imageFile);
            logger.info(result);
        } catch (TesseractException e) {
            logger.info("", e);
        }
}

<dependency>
    <groupId>net.sourceforge.tess4j</groupId>
    <artifactId>tess4j</artifactId>
    <version>4.2.2</version>
</dependency>

0 个答案:

没有答案