How To Read Images in Java Using OCR- Tesseract

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • In this video, we will discuss how to read images via Google OCR tesseract.
    Important link
    github.com/tes...
    Trained Data
    github.com/tes...
    tess4J
    tess4j.sourcefo...
    Selenium 4 maven dependency
    mvnrepository....

КОМЕНТАРІ • 134

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

    Thank you Mukesh for uploading this video. It will really help the automation test engineers to automate CAPTCHA in their respective applications under test.

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

    Very informative sir, just got with same scenario and finally found solution after seeing this videos.
    Thank You Sir!

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

    It just changed the perspective of automation, very good and Useful API you covered 👍😊

  • @yashsaxena47
    @yashsaxena47 5 років тому +1

    Awesome Bhai !! you made it look so easy .. Keep Sharing !!

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

    Thanks for sharing the video. I am curious that if we can read images in different language and extract the text from the images. For that we have to download the training data of that language and copy it in tessdata folder of our project? If yes, then we have to remove the english trained data or we can have multiple trained data in the tessdata folder?

  • @sankarginjupalli2380
    @sankarginjupalli2380 5 років тому +1

    Hi Mukesh, I am getting the following error.
    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!

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

      Same Problem for me also. I set enviroment variable. i still see same problem. Also after copy pasting eng.traineddata file fo tessdata folder, i still see that file name in red. not sure why

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

    Very good explanation and a nice demo

  • @annasonita1186
    @annasonita1186 3 роки тому +1

    Hi Mukesh
    Thanks you very much for sharing. I try your tutorial it works. But sometime it fail to convert the image for example, "IZZ2" it converts as "1772". I used eng.traineddata. Do you have any idea? Which traineddata file should i use instead? The image text is english number and alphabet only.

  • @iburahim786
    @iburahim786 5 років тому +2

    These all are stored image from local. how to capture the images on runtime. And insert into code???

    • @Mukeshotwani
      @Mukeshotwani  5 років тому +1

      Posted new video on same

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

      @@Mukeshotwani Mukesh otwani thank you so much.

  • @yogitaguthula5947
    @yogitaguthula5947 5 років тому +2

    Hey Hi Mukesh Otwani ,
    Thank you so much for your informative video :-)
    But when i'm writing the code,
    ITesseract image=new Tesseract(); Following line is throwing an error saying "The constructor Tesseract() is not visible".
    Could you please help me to solve above error.
    Thank You :-)

  • @satwikburman6841
    @satwikburman6841 5 років тому +1

    What if we split against the ":"
    That would be more efficient right?

  • @PraveenKumar-xb9ji
    @PraveenKumar-xb9ji 4 роки тому +1

    Hi Mukesh, irrespective of image type(jpg or jpeg or png), am getting null pointer exception

  • @shubhamforeverything
    @shubhamforeverything 4 роки тому +1

    Hi Mukesh,
    How to setup the project explorer tab ? can you share me the video link that will very helpful.

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

      Hi Mate, you can use perspective to change the perspective or you can use views from top menu and you can customize the eclipse

  • @ashwajitthukral9101
    @ashwajitthukral9101 5 років тому +1

    Thanks Mukesh, Really usefull for all selenium guys. Why last 2 lines are not showing in output and whats that ST YT. Thanks

    • @Mukeshotwani
      @Mukeshotwani  5 років тому +1

      Hi Ashwajit, regular express was causing the issue so we written another reg ex then it started showing the correct output.

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

      Mukesh otwani ThankYou

  • @saravanansaravanan18
    @saravanansaravanan18 2 роки тому +1

    Hi Mukesh,
    it is not working in CMD using JAR
    Please share your thoughts

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

      Please share your details about this with screenshot.

  • @la3035
    @la3035 5 років тому +1

    Good video useful for Automation

  • @parvathirachapudi5588
    @parvathirachapudi5588 4 роки тому +1

    Hi Mukesh,
    Is it possible to read checkboxes data from pdf file using Tesseract (using java implementation)

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

    Hi Sir,
    Thank you very much for your very informative video.
    Could you please let me know that is there any way like Tessaract, in C# to read Captcha and images ??
    Hopeful for your reply !
    Regards,
    Amit

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

    Hi Mukesh,can u create another video how to setup tess4j src file in maven project

  • @karthikeyans1583
    @karthikeyans1583 4 роки тому +1

    Hi Mukesh, Can u expain what is the use of traineddata file? thanks in advance.

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

      Hi Karthikeyan if you see next video, I have explained how we used Tesseract to read captcha code.

  • @AbhishekMishra-ru2fi
    @AbhishekMishra-ru2fi 4 роки тому +1

    Mukesh , can you please prepare video in Regular Expression ?

    • @Mukeshotwani
      @Mukeshotwani  4 роки тому +1

      yes Abhishek will try. Good to see your comment after long time.

  • @shubhamforeverything
    @shubhamforeverything 5 років тому +2

    Hi bro,In Eclipse which package you used?

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

      Hi Bro I used 4.7 eclipse java developer

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

      @@Mukeshotwani is working with ellipse java oxygen R Win ?

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

    i am getting an error
    ava.lang.UnsatisfiedLinkError: Unable to load library 'tesseract'

  • @eswartirumalasetti1268
    @eswartirumalasetti1268 4 роки тому +1

    This is not working as expected. i tried the same configuration with IRCTC site. OCR is not reading captcha properly. i tired many times and all the times i got a different word than the expected one.

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

      Hi Eswar, May be some changes from IRCTC side, try to read some images using the same.

    • @eswartirumalasetti1268
      @eswartirumalasetti1268 4 роки тому +1

      Normal images with clear text is working fine.. but IRCTC captcha is having stricked lined over the text so it is not able to read it properly

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

      yes it works fine with normal images

  • @HariSuryaprakashBokka
    @HariSuryaprakashBokka 10 місяців тому

    Can u help how to set trained data in project

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

    How to validate any video using selenium & java

  • @santoshs105
    @santoshs105 4 роки тому +1

    Getting below error @mukesh Otwani , how to solve:
    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!
    Warning: Invalid resolution 0 dpi. Using 70 instead.

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

      you need to set path

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

      Mukesh otwani how do I set path in Mac can u please let know in detail for Mac thanks

  • @sanjitpal8558
    @sanjitpal8558 5 років тому +1

    sir either if i am adding .png or .jpeg format file it is giving the same error which is coming in case of .jpg
    11:31:27.199 [main] ERROR net.sourceforge.tess4j.Tesseract - null
    java.lang.NullPointerException: null

    • @swatijamodkar3084
      @swatijamodkar3084 3 роки тому +1

      I'm also facing same issue , if you solved ,could you please help me ?

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

      Hi Sanjit, is this issue resolved? Did u try with different version of tess4j

  • @nagarjunanethaji8480
    @nagarjunanethaji8480 4 роки тому +1

    Hi Mukesh ,
    Thank for sharing valuable video.Is there any videos or references to read images like business card (like PAN card,Aadhaar card).Please help me on this Mukesh.

    • @ankitatalukdar3807
      @ankitatalukdar3807 4 роки тому +1

      Hi, I also have the same query of reading ID cards. Any solution can be helpful. Thanks In Advance

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

      Hi It reads images if background is clear and no strikes.

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

    Sir How to pass image in browser instead of capturing from webcam

  • @gandikotasudheer4442
    @gandikotasudheer4442 4 місяці тому

    How can we read data from pdf from database or cloud by using spring framework

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

    Not working. I am getting tesseract path issue with eng file

  • @AshishKumar-mo6ou
    @AshishKumar-mo6ou Рік тому

    Can we read PAN CARD using above code?

  • @JitendraKumar-lr3vq
    @JitendraKumar-lr3vq 5 років тому +1

    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!
    Exception in thread "main" java.lang.Error: Invalid memory access
    I am getting following error after running the code ,i have downloaded the eng.traineddata file and kept it under the testdata folder as suggested. Could you please help.

    • @Mukeshotwani
      @Mukeshotwani  5 років тому +1

      Hi Jitendra can u send me project screenshot ? Or export project and send me.
      mukeshotwani.50@gmail.com

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

      This is just trained data path issue only

    • @JitendraKumar-lr3vq
      @JitendraKumar-lr3vq 5 років тому +1

      @@Mukeshotwani hi Mukesh I have emailed the project screenshot and I have also send the project workspace ..could you please help me with the resolution..if it's path mistake .. could you please guide on how to set correct path ..

    • @Mukeshotwani
      @Mukeshotwani  5 років тому +1

      Its path issue I am happy that you solved it

    • @sayoojk.s6856
      @sayoojk.s6856 5 років тому

      How you solved this one ?

  • @sivakumarmummidi6730
    @sivakumarmummidi6730 4 роки тому +1

    is i am not a robot can be automated ?

  • @rizaladhi7066
    @rizaladhi7066 11 місяців тому

    please teach tutorial how to ocr in lightroom with free api ,i want to search my friend race number marathon (BIB number) ive been photograph

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

    Hi mukesh,
    iam facing this error
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/Pointer
    at imgTotext.ImageToText.main(ImageToText.java:13)
    Caused by: java.lang.ClassNotFoundException: com.sun.jna.Pointer
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    ... 1 more
    could u pls help me ?

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

      I have the same issue. Were you ever able to resolve it?

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

      @@joshuaaguilera6666 change tass4j dependency version and try

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

      I am also facing same error

  • @ryentertainmentbulletin
    @ryentertainmentbulletin 4 роки тому +1

    Awesome

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

    Thank You sir it worked fine in eclipse but in intellij it giving error -SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

  • @VishalKumar-lj7xs
    @VishalKumar-lj7xs 4 роки тому

    Nice

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

    u gave filename as .jpg instead of .jpeg

  • @sodiumpomegranade1161
    @sodiumpomegranade1161 3 роки тому +1

    the tessdata folder had already a pom.xml and path.... how?

    • @Mukeshotwani
      @Mukeshotwani  3 роки тому +1

      Sorry Ronald can you tell me what issue you are getting here?

    • @sodiumpomegranade1161
      @sodiumpomegranade1161 3 роки тому +1

      @@Mukeshotwani maybe there is something that I miss... when I download the file..... there is no POM.XML in the directory of the tessdata. did you made it perhaps sir?

    • @Mukeshotwani
      @Mukeshotwani  3 роки тому +1

      Hi Mate you pom.xml is from maven. when you create maven project you will get pom.xml file too.

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

      @@Mukeshotwani thanks mate. Total noob question but is it in Eclipse>File>New>Java project/project?

  • @looktothecook3787
    @looktothecook3787 3 роки тому +1

    XML file please show sir again

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

      Its there already you can pause the video or watch it again.

    • @sodiumpomegranade1161
      @sodiumpomegranade1161 3 роки тому +1

      @@Mukeshotwani i really can't find pom.xml. where or how do you make it?

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

    I am getting unsatisfied linkerror

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

      Please suggest

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

      Hi Saurabh,Are you using Java 8 if not then try with Java 8 and if you still facing such issue then send me all config details along with screenshots.

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

    Everyone getting the error 😭

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

    Hi Mukesh, I am getting below error.
    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!

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

      same for me too. Is there any solution available.

    • @rahulsamyal6159
      @rahulsamyal6159 5 років тому +1

      @@sankarginjupalli2380 save your file ./eng.traineddata
      at project level also.