Tesseract OCR works only locally

0

My Java Spring Boot project running with Gradle, i'm using:

  1. Ubuntu(locally and on server)
  2. compile'net.sourceforge.tess4j:tess4j:4.2.1' dependency,
  3. eng.traineddata - file to connect with Tesseract

code looks like:

private static final String TRAIN_DATA = "src/test/resources/tesseractData/";

    public static List<String> getOrdersFromImage(String filePath) {
        List<String> orders = new ArrayList<>();
        Tesseract tesseract = new Tesseract();
        try {
            tesseract.setDatapath(TRAIN_DATA);
            orders = asList(tesseract.doOCR(new File(filePath)).split("\\r?\\n"));
            System.out.println(orders.toString());
        } catch (TesseractException e) {
            e.getMessage();
        }
        return orders;
    }

}

Code works perfectly but only in local runs(parsing, tests etc.), until i'm pushing it to GitLab. I receive such an errors:

java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract': Native library (linux-x86-64/libtesseract.so) not found in resource path (/cache/spedlite_us-gradle/caches/5.1.1/workerMain/gradle-worker.jar:

So any advise would be useful for me.

user1067191

Posted 2019-07-25T06:30:04.660

Reputation: 1

No answers