tess4j

JSON parse error: Cannot deserialize instance of `byte[]` out of START_OBJECT token

限于喜欢 提交于 2019-12-25 18:06:35
问题 How to send a base64 image in postman json format. I was added image file in postman- body form data and it's encode details in json format but i got a bad request only in my attempts. [JSON parse error: Cannot deserialize instance of byte[] out of START_OBJECT token]. found that there is no error in source but the actual issue in json format in postman. SOURCE: https://github.com/arun0009/ocr-tess4j-rest I applied a stack overflow solution but it's repeating the same error. I was adding [] ,

JSON parse error: Cannot deserialize instance of `byte[]` out of START_OBJECT token

五迷三道 提交于 2019-12-25 18:04:12
问题 How to send a base64 image in postman json format. I was added image file in postman- body form data and it's encode details in json format but i got a bad request only in my attempts. [JSON parse error: Cannot deserialize instance of byte[] out of START_OBJECT token]. found that there is no error in source but the actual issue in json format in postman. SOURCE: https://github.com/arun0009/ocr-tess4j-rest I applied a stack overflow solution but it's repeating the same error. I was adding [] ,

Tess4J: “Invalid calling convention 63” despite correct versions

北战南征 提交于 2019-12-23 09:51:19
问题 I try to do OCR and output as PDF using Tess4J and the following code on Linux (Ubuntu 16 Xenial). public void testOcr() throws Exception { File imageFile = new File("/projects/de.conradt.core/tessdata/urkunde.jpg"); ITesseract instance = new Tesseract1(); // tried both Tesseract() and Tesseract1() // File tessDataFolder = LoadLibs.extractTessResources("tessdata"); // Maven build bundles English data // instance.setDatapath(tessDataFolder.getParent()); instance.setDatapath("/projects/de

Forcing Tesseract to match pattern (four digits in a row)

寵の児 提交于 2019-12-22 11:37:52
问题 I'm trying to get Tesseract (using the Tess4J wrapper) to match only a specific pattern. The pattern is four digits in a row, which I think would be \d\d\d\d. Here is a VERY small subset of the image I'm feeding tesseract (the floorplans are restricted, so I'm cautious to post much more of it): http://mike724.com/view/a06771 I'm using the following java code: File imageFile = new File("/<redacted>/file.pdf"); Tesseract instance = Tesseract.getInstance(); instance.setTessVariable("load_system

NoSuchFieldError: RESOURCE_PREFIX with a maven project using tess4j

北战南征 提交于 2019-12-13 16:30:16
问题 tess4j is an OCR packed with native library, I made a maven project to test it, I did add the installation path of maven to eclipse. I added M2_HOME, MAVEN_HOME and JAVA_HOME env variable, here is my parent pom <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>fr.mssb.ongoing</groupId> <artifactId

Tess4J error after distributing as war NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI

a 夏天 提交于 2019-12-13 02:46:17
问题 I have Spring boot Webserver project which works ok in my PC under Intellij IDEA, but it not works after distributing to the same PC as war file - NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI . my code: ITesseract instance = new Tesseract(); // JNA Interface Mapping instance.setDatapath(new File(datapath).getPath()); instance.setLanguage("eng"); try { String result = instance.doOCR(imageFile); } catch (TesseractException e) { System.err.println(e.getMessage(

Tess4j in glassfish ERROR:java.lang.NoSuchFieldError: RESOURCE_PREFIX

萝らか妹 提交于 2019-12-13 00:34:30
问题 I'm using Tess4j 2.0.0 in oracle-glassfish3.1.1, Exception is: java.lang.NoSuchFieldError: RESOURCE_PREFIX at net.sourceforge.tess4j.util.LoadLibs.(LoadLibs.java:60) at net.sourceforge.tess4j.TessAPI.(TessAPI.java:40) at net.sourceforge.tess4j.Tesseract.init(Tesseract.java:360) at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:273) at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:256) at net.sourceforge.tess4j.Tesseract.doOCR(Tesseract.java:237) at net.sourceforge.tess4j

Unsupported image format. May need to install JAI Image I/O package

橙三吉。 提交于 2019-12-12 03:44:59
问题 I'm trying to convert an image file to text using tess4j maven dependency. Dependency in pom.xml:- <!-- OCR dependency --> <dependency> <groupId>net.sourceforge.tess4j</groupId> <artifactId>tess4j</artifactId> <version>3.4.0</version> <exclusions> <exclusion> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> </exclusion> <exclusion> <groupId>net.sourceforge.lept4j</groupId> <artifactId>lept4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>net.java

Facing set datapath error while using tesseract in java

拜拜、爱过 提交于 2019-12-12 03:02:36
问题 I am using tesseract to recognize text from pdfs and I am facing some weird error. The error is Error opening data file data/tessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Now, I understand the meaning of this error and my path is updated to the parent directory of data folder. But the weird thing is that I don't get this error instantly when I run my code but I get it after recognizing 10-15 pdfs

OCR Tesseract - Tess4J behaving weirdly

风流意气都作罢 提交于 2019-12-12 01:55:42
问题 I am trying to extract text out of an image. The issue is that I am using the below given code to process the image and print the extracted text. public class Test { public static void extractText(String filename) // public static void main(String[] args) { System.setProperty("jna.library.path", "32".equals(System.getProperty("sun.arch.data.model")) ? "lib/win32-x86" : "lib/win32-x86-64"); File imageFile = new File("img_perspective.png"); Tesseract instance = Tesseract.getInstance(); // JNA