How to set up Tess4j in Eclipse

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • Hi Everyone.
    I have decided to make this video to show you how to load Java JNA wrapper for Tesseract OCR APIs into Java Eclipse and how to get it to successfully read an image.
    Tesseract is written in C# and anyone working with Java will need a wrapper to ensure this is possible. Therefore, Tess4J is ideal.
    After spending a long time trying to get it set up and found there was limited documentation on how to use it so I've decided to create this video to help anyone wanting to start exploring OCR with Java.
    You will need the following:
    - Eclipse
    - Tess4j (sourceforge.ne...)
    - Lipt4j (sourceforge.ne...)
    - libtesseract302.dll (api.256file.com...)
    Additional documentation found for set up:
    - tphangout.com/h...
    - tess4j.sourcefo...

КОМЕНТАРІ • 91

  • @rs22113
    @rs22113 4 роки тому

    thank you for making this video. it solved my problem after wasting hours haggling with different versions and tutorials which are half-baked and don't talk about actual configurations.
    The only difference for me was that I did not copy over any source, just adding the tess4j jar worked for me.

  • @Eagles_Vanguard
    @Eagles_Vanguard 2 роки тому

    Thankyou so much this is the perfect video working today also. If anyone encounters any problem I advice them to kindly execute each and every step given in the video

  • @s5gchannel
    @s5gchannel 7 років тому +2

    Nice!!! It's working for me. I did two different things. 1. Used 64 bit dll files 2. Included all jars from Tess4j-3.3.1-src into Tess4j build path else getting various errors.

  • @barsailles
    @barsailles 3 роки тому

    Really informative, even after 4 years. Thanks amccu!

  • @silvergodanalyser7762
    @silvergodanalyser7762 3 роки тому

    You are my HERO!

  • @SwapPartLLC
    @SwapPartLLC 6 років тому

    It works! I couldn't have done this without you. Thank you!

  • @aronatvw
    @aronatvw 6 років тому +1

    Excellent job!! I think I was looking at the same netbeans project as you though and I was able to simply import that project and it worked fine in eclipse neon!

  • @Eddyburgercheese
    @Eddyburgercheese 6 років тому

    YESSS youre an angel. thank you so much for making this

  • @reactvscode6282
    @reactvscode6282 6 років тому +9

    i cant find the gsdll64.dll

    • @garymejia9035
      @garymejia9035 5 років тому

      neither did i but it ran regardless if you included the other files she mentioned

    • @HussainAkbar
      @HussainAkbar 4 роки тому +2

      @@garymejia9035 This library comes with GhostScript. If it ran for you, it means that you had GhostScript already installed on your system. If not installed, do a search for gsdll64.dll and download it into the main project folder.

    • @HussainAkbar
      @HussainAkbar 4 роки тому +2

      @@garymejia9035 Oh, the gsdll4.dll is not needed for reading JPEG files as I just found out. It is, however, needed to read PDF files. You'd also need to copy the two pdfbox*.jar files to lib.

  • @Daniel-zk2qr
    @Daniel-zk2qr 2 роки тому

    Works on NetBeans 13 as well, but keep in mind:
    1)If on NetBeans, just add the libraries by right clicking Libraries, then add JAR/Folder, and then press open on the Jar files in the video
    2)When adding a folder, you need to add it on properties as well before, and then on NetBeans.
    😎😎😎😎

  • @kavyaseeramsetty4817
    @kavyaseeramsetty4817 4 роки тому

    Thankyou so much for sharing this video it had helped me a lot!!

  • @nik22208
    @nik22208 6 років тому

    Thanks Alexandra... this tutorial was very helpful

  • @mightyduckyo
    @mightyduckyo 2 роки тому

    I am getting this error:
    The package net.sourceforge.tess4j conflicts with a package accessible from another module: tess4j

  • @what_iz_it
    @what_iz_it 7 років тому

    Hi Alexandra, Thank you very much for this amazing vid

  • @One-th4ls
    @One-th4ls 7 років тому +1

    @Alexandra: Did you make any changes to Tessseract.java class before or after adding slf4j-api?
    Reason being i saw an error for the class in video recording before you added the slf4j jar and then once you reconnected the video with jar added, it didnt show up.. Did you by any chance modify the class to remove the override keyword?

  • @senthilkumarsr4908
    @senthilkumarsr4908 3 роки тому

    Yes, I need a help, please create new video with this ocr to display particular field

  • @MrTbob418
    @MrTbob418 5 років тому

    This is a very nice video explaining what to do step by step, saved me a lot of time trying to figure it out myself. By the way, I get the feeling you think ".dll" stands for "download" ;), it doesn't ^^

  • @kunmeh13
    @kunmeh13 6 років тому

    Thank you! Worked like a charm

  • @Atharva555
    @Atharva555 7 років тому

    thank you very very much ma'am you just saved my day!

  • @chandananand1640
    @chandananand1640 6 років тому

    Hi Alexandra, i followed same procedure but i found
    "SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    Exception in thread "main" java.lang.UnsatisfiedLinkError: The specified module could not be found." this error
    please help me to resolve this ASAP.

  • @faizanshaikh8738
    @faizanshaikh8738 Рік тому

    your voice is really sweeet

  • @aishwarkumar
    @aishwarkumar 6 років тому

    thank you, worked out for me...!!!appreciate it

  • @ritikabhardwaj3920
    @ritikabhardwaj3920 3 роки тому

    I'm not able to understand at 11:22 how notepad get open

  • @nikkonv9
    @nikkonv9 5 років тому

    I did everything step by step, but I getting an error with the slf4j.
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    The type org.slf4j.Logger cannot be resolved. It is indirectly referenced from required .class files
    org.slf4j.Logger cannot be resolved to a type
    LoggerFactory cannot be resolved
    Logger cannot be resolved to a type
    It's generated in the "new Tesseract();" part and I can't solve it

  • @samruddhinaik7349
    @samruddhinaik7349 7 років тому +1

    May I please know the Eclipse version that you are using?

  • @phibuihoang3557
    @phibuihoang3557 7 років тому

    you are so great :D
    i very like the sound of your voice :D
    i love you so much :D

  • @suryamishra3160
    @suryamishra3160 7 років тому

    I am getting error couldn't find module. My laptop is 64 bit and I follow all steps according to your instructions and taking dil file from 64 bit folder but couldn't achieved it. Please help me out

  • @hire05
    @hire05 6 років тому

    Thank you~! This video helped me a lot.

  • @pratiknaik888
    @pratiknaik888 6 років тому

    Thank you, it helped me a lot.

  • @DeepanshiBansalincredible_life
    @DeepanshiBansalincredible_life 7 років тому

    Thanku so much ....awesome.. working great :)

  • @thefox1959
    @thefox1959 3 роки тому

    Hi Alexandra, Nice video I am using a macbook but I can not find the gsdll32.dll. Do you know were I can find it? Thank you, Paul

    • @barsailles
      @barsailles 3 роки тому

      I am using a Mac as well and I actually didn't need that .dll file. All I needed to do is install tesseract from terminal with homebrew. I typed "brew install tesseract", and it worked!

  • @lynettegonsalves7248
    @lynettegonsalves7248 7 років тому

    I am getting an error in netbeans Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3236) .could you please help me out here

  • @aries2aqua
    @aries2aqua 6 років тому

    Thank you, worked fine.

  • @claudiocaastro4
    @claudiocaastro4 6 років тому

    I did what you show in the video but my program not compile. Message error: java.lang.unsatisfiedlinkerror. My Microsoft Visual C++ is updated. Can you help me with this?

  • @merichelledelrosario232
    @merichelledelrosario232 6 років тому

    I need to recognize a handwritten text from different people and then extract the text from the image, how can I do it? I am getting error, it says "net.sourceforge.tess4j.TesseractException: javax.imageio.IIOException: Inconsistent metadata read from stream". I need your help, thank you!

  • @kirubagaran3749
    @kirubagaran3749 5 років тому

    thanks from India

  • @karanyadav87
    @karanyadav87 4 роки тому

    Thanks. I know it's been long since you posted this video. Currently I'm facing one issue. This works perfectly as java core application but implementing same as web project and creating war and deploying it on server , it's not working. I searched everywhere. Everyone facing same issue. Can you help

  • @noeldiaz1354
    @noeldiaz1354 6 років тому +1

    or you can just use gradle and homebrew instead of all this, STEPS:
    In the gradle dependecys:
    compile group: 'net.sourceforge.tess4j', name: 'tess4j', version: '3.4.6'
    In terminal:
    brew install tesseract
    DONE, start coding

  • @Rohit04h02
    @Rohit04h02 7 років тому +2

    I am getting error java.lang.unsatisfiedlinkerror : could not find the module
    in netbeans. Can you help me with this.

    • @mannimanfred4468
      @mannimanfred4468 7 років тому

      Have this as well.
      Did you find any solution yet?

    • @alexandramccusker4158
      @alexandramccusker4158  7 років тому

      Hi. This error can also occur if you are trying to load a 32 bit library on a 64 bit system. Can you check what system you have and ensure you take files from the Tess4j that match your system.
      I also found that set up in Netbeans is slightly different to Eclipse. Here are netbeans instructions by another user: tphangout.com/how-to-use-the-tesseract-api-to-perform-ocr-in-your-java-code/

    • @Rohit04h02
      @Rohit04h02 7 років тому

      Alexandra McCusker I m getting error in net beans ..... let me try in eclipse once ......

    • @yofuru
      @yofuru 7 років тому

      hey buddies, I had that error too, you re gonna love me for that : if you REALLY followed the tutorial in every details, then HERE is the solution : update you microsoft visual c++ to, at least, the 2015 version (v.14.0.24215). Let me know if it worked ;)

  • @alibalbars5177
    @alibalbars5177 5 років тому

    i dont have an idea about your pointer optimization

  • @MrTuzzo77
    @MrTuzzo77 5 років тому

    Hi thanks for the video. Is it possibile to explain how to get text from PDF with Tess4j?

  • @rahulrajan7510
    @rahulrajan7510 6 років тому

    I tried doing this in IntelliJ IDEA but it did not work. Could someone help ?

  • @ranjith_shaun7748
    @ranjith_shaun7748 7 років тому

    i did same process what have in this vedio but I don't have get out put
    that error is :
    Exception in thread "main" java.lang.unsatisfied link error: The specific module could not be found

  • @lynettegonsalves7248
    @lynettegonsalves7248 7 років тому

    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3236)

  • @FaraazKhanTV
    @FaraazKhanTV 7 років тому

    I am getting the error 16:43:57.656 [JavaFX Application Thread] ERROR net.sourceforge.tess4j.Tesseract - Input not set
    java.lang.IllegalStateException: Input not set

  • @aylinlopez1204
    @aylinlopez1204 6 років тому

    que versión de Eclipse estas usando?

  • @강동현-y2q
    @강동현-y2q 5 років тому

    thank for tutorial

  • @nishantkhona4910
    @nishantkhona4910 7 років тому

    Even I am getting the same exception i.e.java.lang.unsatisfiedlinkerror : could not find the module. I have already spend some few hours and I have brought my version of OS, JVM, Eclipse, and dll's everything to 32-bit. Still,I am facing the same issue.
    Could you please share your version of java and eclipse and also have you placed the libraries anywhere else besides than this project ?

    • @nishantkhona4910
      @nishantkhona4910 7 років тому

      Have you installed visual studio or is it already installed at your end

    • @alexandramccusker4158
      @alexandramccusker4158  7 років тому

      I didn't use visual studio for this project.

    • @alexandramccusker4158
      @alexandramccusker4158  7 років тому

      The previous comment mentions this same error. I believe this can be due to trying to load a 32 bit library on a 64 bit system, or vice versa. I suggest checking what type of system you have, then if you look back at my instructions, I took some of the dll files from the downloaded Tess4J zip in the directory: Tess4J-3.3.1-src/Tess4J/lib. In this lib folder there are two other folders; win32-x86 and win32-x86-64. Depending on whether or not your system is 32-bit or 64-bit, take only the dll's from the appropriate folders. I.e. 32-bit system = win32-x86

  • @rahulranjan2322
    @rahulranjan2322 7 років тому

    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    Access restriction: The type IIOImage is not accessible due to restriction on required library C:\Program Files\Java\jre8\lib
    t.jar
    Syntax error, static imports are only available if source level is 1.5 or greater
    The import net.sourceforge.lept4j.ILeptonica.L_CLONE cannot be resolved
    Syntax error, static imports are only available if source level is 1.5 or greater
    The import net.sourceforge.tess4j.ITessAPI.TRUE cannot be resolved
    The type Tesseract must implement the inherited abstract method ITesseract.createDocuments(String[], String[], List)
    The type Tesseract must implement the inherited abstract method ITesseract.createDocuments(String, String, List)
    RenderedFormat cannot be resolved to a type
    enum cannot be resolved to a type
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    RenderedFormat cannot be resolved to a type
    enum cannot be resolved to a type
    enum cannot be resolved to a type
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Access restriction: The type IIOImage is not accessible due to restriction on required library C:\Program Files\Java\jre8\lib
    t.jar
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Access restriction: The type IIOImage is not accessible due to restriction on required library C:\Program Files\Java\jre8\lib
    t.jar
    Syntax error, 'for each' statements are only available if source level is 1.5 or greater
    Access restriction: The type IIOImage is not accessible due to restriction on required library C:\Program Files\Java\jre8\lib
    t.jar
    Access restriction: The method getRenderedImage() from the type IIOImage is not accessible due to restriction on required library C:\Program Files\Java\jre8\lib
    t.jar
    RenderedFormat cannot be resolved to a type
    enum cannot be resolved to a type
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, annotations are only available if source level is 1.5 or greater
    The constructor StringArray(T[]) is undefined
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    RenderedFormat cannot be resolved to a type
    enum cannot be resolved to a type
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    RenderedFormat cannot be resolved to a type
    Syntax error, 'for each' statements are only available if source level is 1.5 or greater
    RenderedFormat cannot be resolved to a type
    TEXT cannot be resolved to a variable
    HOCR cannot be resolved to a variable
    PDF cannot be resolved to a variable
    BOX cannot be resolved to a variable
    UNLV cannot be resolved to a variable
    Syntax error, annotations are only available if source level is 1.5 or greater
    Name clash: The method createDocuments(String, String, List) of type Tesseract has the same erasure as createDocuments(String, String, List) of type ITesseract but does not override it
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    RenderedFormat cannot be resolved to a type
    Syntax error, annotations are only available if source level is 1.5 or greater
    Name clash: The method createDocuments(String[], String[], List) of type Tesseract has the same erasure as createDocuments(String[], String[], List) of type ITesseract but does not override it
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    RenderedFormat cannot be resolved to a type
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    TRUE cannot be resolved to a variable
    L_CLONE cannot be resolved to a variable
    Syntax error, annotations are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    Syntax error, parameterized types are only available if source level is 1.5 or greater
    TRUE cannot be resolved to a variable
    at net.sourceforge.tess4j.Tesseract.(Tesseract.java:27)
    at tess.Test.main(Test.java:9)

    • @alexandramccusker4158
      @alexandramccusker4158  7 років тому

      I'm not entirely sure. Can you tell me what Lept4J file you are using and where you got it from?

  • @HussainAkbar
    @HussainAkbar 4 роки тому

    (Please don't delete comments arbitrarily. My previous one was about the problems I was facing while trying to follow your video.) At 18-30 where you are configuring the data path, why not use a relative path such as "../tessdata"? Also, will this work if this is compiled into an executable JAR?

    • @alexandramccusker4158
      @alexandramccusker4158  4 роки тому

      I didn't delete your comment, or any other. I'm sorry this happened to you.
      I didn't use a relative path but I imagine it would work if you did. I am also not sure if it compiles into an executable JAR.

    • @HussainAkbar
      @HussainAkbar 4 роки тому

      @@alexandramccusker4158 Thank you for the reply. Yes, I realize that this is a tutorial for Tess4J and not for strict Java coding standards. In any case, if anyone is interested, you can use this: instance.setDatapath(System.getProperty("user.dir") + "\\tessdata");

    • @HussainAkbar
      @HussainAkbar 4 роки тому

      @@alexandramccusker4158 My previous comment had to do with copying of files. In the video, your mouse pointer moves differently from the items selected. I had Eclipse open and was playing / pausing the vid to follow along. When you said, "we need this file and this file", I was having trouble as you were not mentioning the names and the mouse was elsewhere.

  • @mannimanfred4468
    @mannimanfred4468 7 років тому

    Hello.
    Do you have any idea how well Tess4j works in terms of handwriting recognition?

    • @alexandramccusker4158
      @alexandramccusker4158  7 років тому

      I haven't actually tried it with handwriting before.

    • @barsailles
      @barsailles 3 роки тому

      I tried it now, unfortunately it doesn't work flawlessly. It's fairly inaccurate.

  • @boppaanji3349
    @boppaanji3349 6 років тому

    I am unable to read a JPG files. Could someone share me the code for reading JPG files if possible.

    • @tranquil31
      @tranquil31 5 років тому

      convert it to a png in ur code lol

  • @mohamedbelkhechine2849
    @mohamedbelkhechine2849 6 років тому

    Tesseract is not written in C#.

  • @aryafarzan1
    @aryafarzan1 7 років тому

    Tesseract is written in C++ not C#

  • @tranquil31
    @tranquil31 5 років тому

    thx bb :)

  • @superchargedchat
    @superchargedchat 6 років тому

    Hey, could you please send me your working project if possible?

  • @binuradodangoda3063
    @binuradodangoda3063 7 років тому

    will this work in ubuntu ?

  • @tranquil31
    @tranquil31 5 років тому

    15:28

  • @taseenahmed8645
    @taseenahmed8645 5 років тому

    With Maven it takes 5 minutes and thats an over estimate

    • @LucasRampillon
      @LucasRampillon 5 років тому

      With which dependencies?

    • @taseenahmed8645
      @taseenahmed8645 5 років тому

      @@LucasRampillon cant say on top of my head but use stackoverflow

  • @jezza10181
    @jezza10181 6 років тому

    Alexandra, I love you :)