Hello, I have being trying to work with tesseract with no success.
Here is my code:
ITesseract instance = new Tesseract();
ImageIO.scanForPlugins();
instance.setDatapath(imageFile.getParent());
try {
String result = instance.doOCR(imageFile);
System.out.println(result);
} catch (TesseractException e) {
LogUtil.logException(e);
}
And here is the pom.xml:
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>${tess4J.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.media/jai_imageio -->
<dependency>
<groupId>com.sun.media</groupId>
<artifactId>jai_imageio</artifactId>
<version>${jai_imageio.version}</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jai_imageio-1.1.jar</systemPath>
</dependency>
<dependency>
<groupId>com.github.jai-imageio</groupId>
<artifactId>jai-imageio-core</artifactId>
<version>${jai-imageio-core.version}</version>
</dependency>
<dependency>
<groupId>com.github.jai-imageio</groupId>
<artifactId>jai-imageio-jpeg2000</artifactId>
<version>${jai-imageio-jpeg2000.version}</version>
</dependency>
It keeps throwing the exception: Caused by: java.lang.RuntimeException:
Unsupported image format. May need to install JAI Image I/O package.
https://java.net/projects/jai-imageio/
Please advice
Thank you in advance.
--
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tesseract-ocr/834c48fb-41c8-438c-a57a-37139cf10b1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.