How To Read Images in Java Using OCR- Tesseract

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 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!

  • @yashsaxena47
    @yashsaxena47 5 ปีที่แล้ว +1

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

  • @SarangHoley
    @SarangHoley 5 ปีที่แล้ว

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

  • @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

  • @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?

  • @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 5 ปีที่แล้ว

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

  • @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.

  • @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 5 ปีที่แล้ว

      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

  • @parvathirachapudi5588
    @parvathirachapudi5588 5 ปีที่แล้ว +1

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

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

      Hi Parvathi, you can do that

  • @PraveenKumar-xb9ji
    @PraveenKumar-xb9ji 5 ปีที่แล้ว +1

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

  • @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 :-)

  • @mounigontla8409
    @mounigontla8409 4 ปีที่แล้ว

    Very good explanation and a nice demo

  • @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.

  • @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 ?

  • @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.

  • @satwikburman6841
    @satwikburman6841 5 ปีที่แล้ว +1

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

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

      Yes Satwik that will also work

  • @shubhamforeverything
    @shubhamforeverything 5 ปีที่แล้ว +1

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

    • @Mukeshotwani
      @Mukeshotwani  5 ปีที่แล้ว

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

  • @mohammadyusuph9532
    @mohammadyusuph9532 21 วันที่ผ่านมา +1

    Please help me, I am getting error: java.lang.Error: Invalid memory access

    • @Mukeshotwani
      @Mukeshotwani  18 วันที่ผ่านมา

      Increase JVM Memory

  • @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.

  • @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

  • @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

  • @la3035
    @la3035 5 ปีที่แล้ว +1

    Good video useful for Automation

  • @rajatshandilya1203
    @rajatshandilya1203 4 ปีที่แล้ว

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

  • @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.

  • @gandikotasudheer4442
    @gandikotasudheer4442 7 หลายเดือนก่อน

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

    • @Mukeshotwani
      @Mukeshotwani  7 หลายเดือนก่อน

      Not tried spring framework

  • @sonalisundaray1052
    @sonalisundaray1052 4 ปีที่แล้ว

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

  • @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

  • @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

  • @HariSuryaprakashBokka
    @HariSuryaprakashBokka ปีที่แล้ว

    Can u help how to set trained data in project

  • @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.

  • @AshishKumar-mo6ou
    @AshishKumar-mo6ou ปีที่แล้ว

    Can we read PAN CARD using above code?

  • @parasjoshi5509
    @parasjoshi5509 ปีที่แล้ว

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

  • @Healthmagic
    @Healthmagic ปีที่แล้ว

    How to validate any video using selenium & java

  • @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_K
      @Biswamber_K 3 ปีที่แล้ว

      I am also facing same error

  • @salmanmohamed1993
    @salmanmohamed1993 5 ปีที่แล้ว

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

  • @sivakumarmummidi6730
    @sivakumarmummidi6730 4 ปีที่แล้ว +1

    is i am not a robot can be automated ?

    • @Mukeshotwani
      @Mukeshotwani  4 ปีที่แล้ว

      No Shiva I dont think so

  • @sodiumpomegranade1161
    @sodiumpomegranade1161 4 ปีที่แล้ว +1

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

    • @Mukeshotwani
      @Mukeshotwani  4 ปีที่แล้ว +1

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

    • @sodiumpomegranade1161
      @sodiumpomegranade1161 4 ปีที่แล้ว +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  4 ปีที่แล้ว +1

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

    • @sodiumpomegranade1161
      @sodiumpomegranade1161 4 ปีที่แล้ว

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

  • @rizaladhi7066
    @rizaladhi7066 ปีที่แล้ว

    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

  • @VishalKumar-lj7xs
    @VishalKumar-lj7xs 5 ปีที่แล้ว

    Nice

  • @manuml6488
    @manuml6488 3 ปีที่แล้ว

    u gave filename as .jpg instead of .jpeg

  • @looktothecook3787
    @looktothecook3787 4 ปีที่แล้ว +1

    XML file please show sir again

    • @Mukeshotwani
      @Mukeshotwani  4 ปีที่แล้ว

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

    • @sodiumpomegranade1161
      @sodiumpomegranade1161 4 ปีที่แล้ว +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_K
    @Biswamber_K 3 ปีที่แล้ว

    Everyone getting the error 😭

  • @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".

  • @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.