Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java: sikulixapi: Tesseract library problems #503

Closed
haogubang opened this issue Dec 26, 2021 · 3 comments
Closed

Java: sikulixapi: Tesseract library problems #503

haogubang opened this issue Dec 26, 2021 · 3 comments
Assignees
Labels
aText/OCR problems with text/ocr feature discussion
Milestone

Comments

@haogubang
Copy link

haogubang commented Dec 26, 2021

Run Environment: Windows Server 2019, java 1.8.0_311, Microsoft Visual C++ 2015 Redistributable (x64)

when i use sikulixapi in my java project, occurred exception:

[error] see: https://github.com/RaiMan/SikuliX1/wiki/Windows:-Problems-with-libraries-OpenCV-or-Tesseract
[error] Save your work, correct the problem and restart the IDE!
Exception in thread "main" org.sikuli.script.SikuliXception: OCR: start: Tesseract library problems: The specified module could not be found

    at org.sikuli.script.TextRecognizer.getTesseractAPI(TextRecognizer.java:131)
    at org.sikuli.script.TextRecognizer.doRead(TextRecognizer.java:376)
    at org.sikuli.script.TextRecognizer.readText(TextRecognizer.java:335)
    at org.sikuli.script.OCR.readText(OCR.java:710)
    at org.sikuli.script.OCR.readText(OCR.java:695)
    at org.sikuli.script.Element.text(Element.java:150)

following are all jars in the project:

commons-collections-3.2.1.jar
commons-io-1.3.2.jar
commons-lang3-3.3.2.jar
commons-logging-1.1.3.jar
druid-1.0.20.jar
eova-1.6.0.jar
fastjson-1.2.59.jar
httpclient-4.3.6.jar
httpcore-4.3.2.jar
jai-imageio-core-1.4.0.jar
jfinal-3.6-bin.jar
jna-5.6.0.jar
jna-platform-5.6.0.jar
jsoup-1.11.3.jar
lept4j-1.13.2.jar
mysql-connector-java-5.1.20-bin.jar
opencv-4.3.0-3.jar
sikulixapi-2.0.5-sources.jar
sikulixapi-2.0.5.jar
slf4j-api-1.7.30.jar
slf4j-simple-1.7.32.jar
tess4j-4.5.5.jar
webmagic-core-0.5.2.jar
xsoup-0.2.4.jar

@RaiMan RaiMan changed the title Tesseract library problems Java: sikulixapi: Tesseract library problems Jan 23, 2022
@RaiMan RaiMan added the bug possible might be a bug - is currently evaluated label Jan 23, 2022
@RaiMan RaiMan self-assigned this Jan 23, 2022
@RaiMan RaiMan added this to the 2.0.6 milestone Jan 23, 2022
@RaiMan RaiMan added the aText/OCR problems with text/ocr feature label Jan 23, 2022
@fturhan
Copy link

fturhan commented Jan 26, 2022

I have the same issu with sikulixIDE 2.0.5 working with python script on windows 7 (java 1.8 installed)

@RaiMan
Copy link
Owner

RaiMan commented Jan 27, 2022

tested with a Maven project in IntelliJIDEA on Win11 with Java 17 (other Java versions 8+ should not make a difference):

import org.sikuli.script.*;
import org.sikuli.script.support.Commons;

import java.io.File;

public class Test {
   public static void main(String[] args) {
      Screen scr = new Screen();
      File workDir = Commons.getWorkDir();
      ImagePath.setBundlePath(new File(workDir, "/src/main/resources/images").getAbsolutePath());
      Commons.info("%s", ImagePath.getBundlePath());
      Commons.info("%s", scr.exists("img")); // an image containing text
      Commons.info("%s", scr.getLastMatch().text());
      Commons.info("");
   }
}

The dependency I used:

<groupId>com.sikulix</groupId>
<artifactId>sikulixapi</artifactId>
<version>2.0.5</version>

At runtime everything needed on Windows is available in the project (through Maven dep management)

@RaiMan RaiMan added discussion and removed bug possible might be a bug - is currently evaluated labels Jan 27, 2022
@RaiMan RaiMan closed this as completed Apr 10, 2022
@le-ross
Copy link

le-ross commented Jan 29, 2023

Is there a worksaround? I having the same issues here but not sure how to read this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aText/OCR problems with text/ocr feature discussion
Projects
None yet
Development

No branches or pull requests

4 participants