tess4j | Java JNA wrapper for Tesseract OCR API | Computer Vision library

 by   nguyenq Java Version: 5.11.0 License: Apache-2.0

kandi X-RAY | tess4j Summary

kandi X-RAY | tess4j Summary

tess4j is a Java library typically used in Artificial Intelligence, Computer Vision applications. tess4j has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.

A Java JNA wrapper for Tesseract OCR API. Tess4J is released and distributed under the Apache License, v2.0.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tess4j has a highly active ecosystem.
              It has 1321 star(s) with 357 fork(s). There are 81 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 15 open issues and 210 have been closed. On average issues are closed in 125 days. There are 3 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of tess4j is 5.11.0

            kandi-Quality Quality

              tess4j has 0 bugs and 0 code smells.

            kandi-Security Security

              tess4j has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              tess4j code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              tess4j is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              tess4j releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              tess4j saves you 2616 person hours of effort in developing the same functionality from scratch.
              It has 5417 lines of code, 688 functions and 30 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed tess4j and discovered the below as its top functions. This is intended to give you an instant insight into tess4j implemented functionality, and help decide if they suit your requirements.
            • Creates renderers .
            • Converts PDF document to images .
            • Rotate image .
            • Gets word iterator .
            • Copy a jar resource to the destination path .
            • Set DPI API .
            • Get the number of lines in the image
            • Rotate an image .
            • Gets the name of a constant field .
            • Returns a string representation of the bounding box .
            Get all kandi verified functions for this library.

            tess4j Key Features

            No Key Features are available at this moment for tess4j.

            tess4j Examples and Code Snippets

            No Code Snippets are available at this moment for tess4j.

            Community Discussions

            QUESTION

            How can I read text on the screen presented as an image using sikulix IDE?
            Asked 2022-Mar-17 at 10:01

            I'm using sikulix IDE version 2.0.5 in windows 10 and the usage so far is successful.

            I want to read a specific single line text on the screen using sikulix IDE. I can't copy the text to the clipboard because it on an image.

            I'm able to do this on eclipse IDE using Tesseract and tess4j in Java after I imported its jar.

            With my project I'm looking to use sikulix IDE because I found it to be reliable in reading images.

            My question now is how can I read the text on the screen presented as an image using sikulix IDE? Is there a method I can use within the sikuli IDE.

            Can someone guide me!

            Thank you.

            ...

            ANSWER

            Answered 2022-Mar-17 at 10:01

            text = Image.create("givenImage.png").text()

            If you want to read from only part of the image:

            text = Image.create("givenImage.png").getSub(x, y, w, h).text()

            where x and y are counting from the top left corner of the image as (0, 0).

            Example for top of image:

            Source https://stackoverflow.com/questions/71497431

            QUESTION

            Tess4J on Ubuntu crashing JVM
            Asked 2021-Dec-21 at 11:32

            I am new to Tess4J and to JNA, so apologies if this is obvious, but I have not been able to find in the blogs. I am on Ubuntu 18.04, running Java 17.0.1, Tomcat 10.0. I have built a simple dynamic web app, details below. I installed resources as such:

            ...

            ANSWER

            Answered 2021-Dec-21 at 11:32

            Not quite sure if you are aware, but there seems to be an API available that you can simply use instead of directly pointing to your Installation Lib Folder.

            This means that this would be platform agnostic and would work whether on windows/linux.

            Example of Usage:

            The pom.xml build file

            Source https://stackoverflow.com/questions/70434438

            QUESTION

            Integrate licence in Eclipse java
            Asked 2021-May-02 at 22:09

            First of all, thank you for your attention! I have the following problem - I have to read a text from a image, which works fine. Within Eclipse, I can also use the programme perfectly. I use 2 libraries: Tesseract (tess4j) and opencv-451.

            But when I export the programme to a runnable jar, I get this error message. Error Message Image

            If I export the jar anyway, it does not work because the libraries are missing (surprise).

            But these should be usable with the APACHE LICENSE, VERSION 2.0. I have added the copyright notice to every class I created, as in image 2, and I would also like the creators of the libraries to get their deserved mention.

            Unfortunately I don't know what I did wrong or what I have to do differently to be able to use these libraries as an export jar, because this is the first time I do something with free licenses.

            Can someone tell me where the error is and how I can make Eclipse pack the required file into the exported jar, or what I can do alternatively?

            ...

            ANSWER

            Answered 2021-Mar-26 at 00:56

            Just Select project Right Click > Build Path > Add external archives. This will open the file explorer , which allows you to browse through directories and choose external JAR. Once successfully added, it will appear inside Referenced Libraries of your project.

            Screenshot

            Source https://stackoverflow.com/questions/66809573

            QUESTION

            Can't resolve warning in Gradle 6.4
            Asked 2021-Apr-04 at 06:04

            In Gradle 6.4 i've got warning with type as:

            ...

            ANSWER

            Answered 2021-Apr-04 at 06:04

            Found the root of the problem. Allure plugin use 'testCompile' by default. Fixed it by adding configuration in allure:

            Source https://stackoverflow.com/questions/66938321

            QUESTION

            Can't run my test class with testng config
            Asked 2021-Apr-02 at 12:09

            I have an issue with running test classes on it's own. After updating my IntelliJ IDEA from version 2018 to 2020 i can't run tests on it's own using testNG it runs through the Gradle and don't work.

            My build.gradle

            ...

            ANSWER

            Answered 2021-Apr-02 at 12:09

            The problem had been resolved by changing value 'run tests' in gradle run configuration from 'gradle' to 'intelliJ'

            https://prnt.sc/112b4el

            Source https://stackoverflow.com/questions/66918400

            QUESTION

            Tess4j tesseract - How can you differentiate between columns or rows in a table?
            Asked 2020-Dec-16 at 00:47

            I am working a bit with tess4j tesseract in Java. It works well and it allows me to do what I need.

            But I have come across an issue that I cannot solve without guidance or help.

            Let us say, I have the following image:

            This then provides me with the following output:

            Column 1 Column 2 Column3

            Row 1 Column 1 Rowt Column 3

            Row 2 Column 1 Row 2 Column 2 Row 2 Column 3

            Here is my code

            ...

            ANSWER

            Answered 2020-Dec-16 at 00:47

            You can preserve the spaces and then count them:

            tesseract.setTessVariable("preserve_interword_spaces", "1");

            Source https://stackoverflow.com/questions/65290354

            QUESTION

            OCR tessdata directory is incorrect
            Asked 2020-Sep-21 at 19:31

            I've been following this tutorial for trying to create an OCR and I've copy and pasted all of the necessary code and followed the steps but I keep receiving this error when I run OCRDemo.java:

            Error opening data file ./eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages!

            So I'm assuming the issue is that TESSDATA_PREFIX has the wrong directory. Currently it is "C:\CodeRepository\OCR\tessdata" and I got that directory and confirmed that directory by literally going into file explorer and copying and pasting it. But I keep getting this error message. I've also tried "OCR\tessdata", "tessdata" but none of them work. Help?

            Here's my pom.xml code that has the TESSDATA_PREFIX:

            ...

            ANSWER

            Answered 2020-Sep-21 at 19:31

            From the given link, it looks like it points the readers to incompatible language data files. Try https://github.com/tesseract-ocr/tessdata_fast.

            Source https://stackoverflow.com/questions/63997048

            QUESTION

            Tesseract failed loading language (Tess4j / Java / Netbeans)
            Asked 2020-Aug-29 at 13:40

            I'm currently working on a program which should detect letters and numbers in an image using OpenCV and Tessj4. For that I downloaded and installed Tesseract (Version 5.0.0 alpha) from https://github.com/UB-Mannheim/tesseract/wiki, downloaded the Tess4j API (Version 3.4.8) from http://tess4j.sourceforge.net and added the .jar files (tess4j-3.4.8.jar + all the .jar files inside the lib folder) to my project.

            Furthermore I included the tesseract directory (C:/Program Files/Tesseract-OCR) to the systems path and added TESSDATA_PREFIX with the value (C:/Program Files/Tesseract-OCR/tessdata) to my environment variables.

            However, when I try to run this 4 simple lines of code, I get the following error:

            ...

            ANSWER

            Answered 2020-Aug-29 at 13:40

            Okay I found out that for some reason my language file got corrupted.
            I simply replaced the "eng.traineddata" file inside the "C:\Program Files\Tesseract-OCR\tessdata" directory.

            Now all is working properly.

            Source https://stackoverflow.com/questions/63644614

            QUESTION

            It is possible to use the TessAPI1.TessPDFRendererCreate API of tess4J without needing to create physical files?
            Asked 2020-Aug-01 at 13:26

            I am using the Tesseract Java API (tess4J) to convert Tiff images to PDFs.

            This works nicely, but I am forced to write both the source Tiff image and the output PDF to local filestore as actual physical files in order to use the TessAPI1.TessPDFRendererCreate API.

            Please note the following in the code snippet below: -

            1. The input Tiff is originally a java.awt.image.BufferedImage, but I have to write it to a physical file (sourceTiffFile is a File object).

            2. I must specify a file path for the output (pdfFullFilepath is a String representing an absolute path for the new PDF file).

              ...

            ANSWER

            Answered 2020-Aug-01 at 13:26

            You can pass in ProcessPage API method a Pix, which can be converted from a BufferedImage, but the output will still be a physical file. Tesseract API dictates that.

            https://tesseract-ocr.github.io/tessapi/4.0.0/a01625.html

            http://tess4j.sourceforge.net/docs/docs-4.4/net/sourceforge/tess4j/TessAPI1.html

            For ex:

            Source https://stackoverflow.com/questions/63156046

            QUESTION

            How to pass a list of TIFF files to TessAPI1.TessBaseAPIProcessPages
            Asked 2020-Jul-30 at 13:22

            I am using the Tesseract Java API (tess4J) to convert TIFF files to readable PDFs.

            When I have a single source TIFF file, the results have been quite pleasing:

            ...

            ANSWER

            Answered 2020-Jul-30 at 13:22

            Try a filelist with each entry on a separate line (i.e, delimited by \n character).

            Source https://stackoverflow.com/questions/62775114

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tess4j

            You can download it from GitHub, Maven.
            You can use tess4j like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the tess4j component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/nguyenq/tess4j.git

          • CLI

            gh repo clone nguyenq/tess4j

          • sshUrl

            git@github.com:nguyenq/tess4j.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link