Results 1 to 2 of 2
  1. #1
    jezza10181 is offline Member
    Join Date
    Jan 2011
    Posts
    4
    Rep Power
    0

    Default Using Tesseract OCR with Java

    Hi,

    I am using the Tesseract Optical Character Recognition software, and I am attempting to access it from within a Java program. I so far have attempted to use the Java wrapper known as Tess4j to do this, but despite having followed several walk-thrus now, have not been successful in implementing it.

    The Tesseract software itself has been correctly installed, and works well - I have tested it many times. You actually use it from the Command Prompt - which lead me to wonder why not simply access it by using Java commands to access it from the command prompt. I have been looking at Java processes, and have had some success in running Windows executables from within a Java class.

    The Command Prompt line that I use to get Tesseract to parse a document is as follows:-

    C:\Users\Jeremy\Desktop\Test> tesseract.exe filename.png --Textfilename.txt

    Now, the png file called 'filename' resides in the folder called Test, which is on my desktop. 'tesseract.exe' is in a folder called 'Tesseract-OCR' which is on my C: drive.

    The file called 'Textfilename.txt' is the resulting parsed document file that exists as a text file, and is then placed into the Test folder upon successful execution of the program.

    My question is this, how would this command prompt line be translated into a Java process, or sequence of processes?

    Thanks
    Jeremy

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,959
    Rep Power
    31

    Default Re: Using Tesseract OCR with Java

    Look at using the Runtime and Process classes to start execution of a program from a java program.

    Also posted at: https://coderanch.com/t/698225/java/...R-Java#3276692
    Last edited by Norm; 08-25-2018 at 01:01 PM.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 18
    Last Post: 12-26-2013, 08:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •