How to convert image to text using python

Поделиться
HTML-код
  • Опубликовано: 29 июн 2024
  • In this tutorial you will learn how to convert / turn images into text by using python and the pytesseract ocr module. You will also learn how to automate keyboard functions and drag the mouse so that you can “do something” based on the text you detect.
    Pytesseract ocr is a python library that helps with optical character recognition, or “ ocr “ in short. If you are having issues with the ocr library, please try to use python 3.7 64 bit. If you are getting inaccurate results, try to make the image size larger as ocr gets better the larger the image is (don’t overdo it of course)
    As usual, the full finished code can be found on the project’s github page:
    github.com/KianBrose/Python-b...
    Convert image to text: 0:25
    Keyboard automation: 4:14
    Mouse drag: 6:15
    Code and links used in video (in order):
    Image to text:
    github.com/UB-Mannheim/tesser...
    pip install pytesseract
    pip install pillow
    import pyautogui
    from PIL import Image
    from pytesseract import *
    pytesseract.tesseract_cmd = r'C:\Users\Antec\AppData\Local\Tesseract-OCR\tesseract.exe'
    Keyboard automation:
    pip install pywin32
    pip install pyautogui
    pip install keyboard
    import time
    import pyautogui
    import keyboard
    import win32api, win32con
    Mouse drag:
    import time
    import win32api, win32con
    time.sleep(2)
    win32api.SetCursorPos((500,500))
    time.sleep(0.1)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)
    time.sleep(0.1)
    win32api.SetCursorPos((500,300))
    time.sleep(0.1)
    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)
    Hope you enjoyed the video, if it helped please consider subscribing :)
    If you have any bugs / errors feel free to join the discord server where you can get near instant help: / discord
    I will also run polls on the server for future videos, so check it out if you’re interested in staying.
    This video is part of a series of botting tutorials where you can learn how to bot / automate daily tasks. The first video can be found here: • How to make advanced i...
    Thanks for watching!
    #botting #python #automation
  • ХоббиХобби

Комментарии • 383

  • @KianBrose
    @KianBrose  4 года назад +88

    Tried editing this one as best as I could... Hopefully it doesn't disappoint ^-^

    • @dasosa1973
      @dasosa1973 4 года назад +3

      this video is very beginner friendly
      good job
      #loved it

    • @KianBrose
      @KianBrose  4 года назад

      @@dasosa1973 thanks!

    • @lil_zcrazyg1917
      @lil_zcrazyg1917 4 года назад +4

      Your simplistic editing style is honestly something I love, its quick, easy to follow, and doesn't stray away from the main point, its perfect!

    • @KianBrose
      @KianBrose  4 года назад +1

      @@lil_zcrazyg1917 thanks!

    • @aog3962
      @aog3962 3 года назад +2

      @@KianBrose perfect

  • @ghassane2016
    @ghassane2016 3 года назад +33

    this channel is gold.

    • @KianBrose
      @KianBrose  3 года назад +1

      Thank you!

    • @ghassane2016
      @ghassane2016 3 года назад +1

      @@KianBrose Keep the good work man, you deserve a lot!

    • @KianBrose
      @KianBrose  3 года назад +1

      @@ghassane2016 Thanks!

  • @Psychetwo
    @Psychetwo 2 года назад +2

    Thank you for taking the time to make these type of videos! I never done any coding or programming. These videos you make are very educational. I learned a lot more than I expected!
    The pace was a bit fast, but youtube allows us to pause and watch at slower speed so this is fine. I hope to see more of your videos!

  • @tinkerstamp3134
    @tinkerstamp3134 3 года назад +4

    Disappoint in terms of quality? Absolutely not! I've been looking for a well made educational video on this for a while now. Easy to understand and follow. Thank you!

    • @KianBrose
      @KianBrose  3 года назад

      Glad you liked it ^_^

  • @mdrabid2893
    @mdrabid2893 3 года назад +4

    Amazing!! and the best part is he explains other possibilities and options as integer and all . Keeping it fast and simple is better to understand and you don’t get bored .
    Keep up the good work !!

  • @xyhard8603
    @xyhard8603 3 года назад +7

    Dude, sincerly do not stop making videos!

    • @KianBrose
      @KianBrose  3 года назад +2

      Can't stop me nooooow

  • @lmprivateaccount
    @lmprivateaccount 3 года назад +2

    Super clean editing as usual ! great work

  • @koiwaiyotsuba
    @koiwaiyotsuba 3 года назад +3

    these tutorials are legendary, they help so much

    • @KianBrose
      @KianBrose  3 года назад

      Thanks! Glad they helped

  • @nijoeli
    @nijoeli 3 года назад +7

    I thought you had at least 4M subs and then I saw u don't, that's sad man :( You deserve more

    • @KianBrose
      @KianBrose  3 года назад +2

      Maybe someday I get 100k xD

  • @AndruliuSonneilloN
    @AndruliuSonneilloN 3 года назад +2

    You have a gift as a teacher. This is soo acurate and easy to understand. THX!

    • @KianBrose
      @KianBrose  3 года назад

      Thanks! Glad you enjoyed it

  • @owl5496
    @owl5496 3 года назад +1

    Bro the way to explain stuff is just amazing.

    • @KianBrose
      @KianBrose  3 года назад

      Thanks! Glad you like it ^^

  • @rohandesigns
    @rohandesigns 3 года назад +3

    Finally a channel which explains what you really need... i have subscribed bro... and thanks for such amazing videos... 👌🏻👌🏻👌🏻

    • @KianBrose
      @KianBrose  3 года назад +1

      Np, ty for the sub!

  • @archardor3392
    @archardor3392 3 года назад +3

    You are amazing, keep going! We need more content!

  • @harrydelgado9520
    @harrydelgado9520 3 года назад +1

    Hey! Please, upload more videos! No matter the content, I'll watch haha. The way you explain is amazing!

    • @KianBrose
      @KianBrose  3 года назад +1

      Will do! I'm working on the script for the next one at the moment, will be a web server hosting tutorial

  • @kaanyt5726
    @kaanyt5726 3 года назад +9

    this channel will blow up im telling you...

    • @KianBrose
      @KianBrose  3 года назад +1

      Already is xd

    • @kaanyt5726
      @kaanyt5726 3 года назад +1

      @@KianBrose you had 2.55 subs 9 hours ago and its 2.8 rn gl about yt

    • @burkhard1256
      @burkhard1256 3 года назад +2

      @@KianBrose oh no. There's gonna be more. :)

    • @nijoeli
      @nijoeli 3 года назад +1

      6k already xD glad this is happening

  • @championbenj
    @championbenj 4 года назад +2

    just as I search how to do it. keep it up dude

  • @markvegas2271
    @markvegas2271 4 года назад

    Hey Kian thanks for your uploads, you don't have many videos but your content is really good. I'm learning alot of you, the way you teach python is really good. keep making videos you will be a big youtuber in 2 years if you keep making these hq video's

  • @hariharanvinod1531
    @hariharanvinod1531 4 года назад +3

    You're amazing at explaining topics

  • @harrydelgado9520
    @harrydelgado9520 3 года назад

    Whaaat :o
    Your videos are really perfect! Easy, fast and useful. Please, continue! Thank you

  • @cepix4216
    @cepix4216 3 года назад

    I can't belive i found this chanel, it's amazing how you explaining topics

  • @nooknaruk9
    @nooknaruk9 3 года назад +1

    I really love your style, keep it up

  • @Jocobalo
    @Jocobalo 3 года назад +1

    I very much wish this video was around when I was trying to do this myself. Would have saved hours and hours of my life

    • @KianBrose
      @KianBrose  3 года назад +1

      Well now it's here

  • @avadhoot822
    @avadhoot822 3 года назад +3

    Love this channel!

  • @LuisGustavo-dk4qy
    @LuisGustavo-dk4qy 3 года назад +1

    Damn, you're cool! Keep at it, I love your videos.

  • @Porkductions
    @Porkductions 3 года назад +2

    great stuff!!! please keep it up!

  • @edwardfilm697
    @edwardfilm697 3 года назад +1

    Hey Kian this was just the channel I was looking for! I'm a machine learning enthusiast and I've always wanted to create a machine learning model to beat some online games. I saw your video about piano tiles, but I was thinking we could try out some more complicated games. I'll message you discord about the idea, I would love to work with you!

  • @harshmistry9765
    @harshmistry9765 3 года назад +2

    Wow this is so good. I will definitely try 😁. Good work teaching.

  • @opkp
    @opkp 3 года назад +1

    I just love you're channel

  • @nuggetx4086
    @nuggetx4086 2 года назад +9

    i searched for copper and i found diamonds

    • @KianBrose
      @KianBrose  2 года назад +1

      Oo Creative comment i like it

  • @Yguy
    @Yguy 3 года назад +2

    I started watching you when I saw ur bot tutorial.
    Please upload more.

    • @KianBrose
      @KianBrose  3 года назад +1

      Yeah, sorry for my inactivity, just have tons of things to do lately, I’ll start uploading more soon

    • @Yguy
      @Yguy 3 года назад +1

      @@KianBrose Its ok, can u give me project ideas please. Please give me specific game bots and stuff. I think I can make a lot of bots just need ideas.

    • @KianBrose
      @KianBrose  3 года назад +1

      Yguy hmm for practice try to make a bot that wins typewriter games

    • @Yguy
      @Yguy 3 года назад

      @@KianBrose Okay!

  • @vikranthnara3324
    @vikranthnara3324 3 года назад +1

    i love this, i am using this for my project!

  • @SohanSharad
    @SohanSharad 4 года назад +1

    dude, need more videos, this epic

  • @abdallahguid147
    @abdallahguid147 3 года назад +3

    Great video 👌👍

  • @marcosagimed33
    @marcosagimed33 3 года назад +3

    Awesome videos!!

  • @olliboy965
    @olliboy965 3 года назад +2

    New pvp looks nice!

  • @Lasnikers
    @Lasnikers 4 года назад

    Very nice video. I love the editing

  • @krissloo143
    @krissloo143 3 года назад +1

    a lot of useful tips, you're so awesome

    • @KianBrose
      @KianBrose  3 года назад +1

      No u

    • @krissloo143
      @krissloo143 3 года назад +1

      @@KianBrose please keep it going forever xD

    • @KianBrose
      @KianBrose  3 года назад +1

      ​@@krissloo143 Perhaps I can turn it into a carreer xD

    • @krissloo143
      @krissloo143 3 года назад

      @@KianBrose why not :) ur so good at what ur doing

  • @reddot3893
    @reddot3893 3 года назад +3

    super good channel you have a new subscriber

  • @storyofbo
    @storyofbo 3 года назад +3

    Ik a lot of people say this but I seriously thought you had at least like 500k subs. You are extremely underrated 😳

    • @storyofbo
      @storyofbo 3 года назад +1

      Also discord link expired

    • @KianBrose
      @KianBrose  3 года назад +1

      The new link is in the about page

    • @KianBrose
      @KianBrose  3 года назад +1

      Someday maybe ^^

  • @haykg
    @haykg 3 года назад +1

    This was a great video :))

  • @tilak03
    @tilak03 3 года назад +2

    Finally found a channel which explains in a simplistic way....I subscribed too....thank you for amazing videos

    • @KianBrose
      @KianBrose  3 года назад

      Thanks! Yeah things should be simple and concise

  • @semtex2987
    @semtex2987 3 года назад +3

    getting the integers, this comes handy.
    x,y = [int(n) for n in '12,34'.split(',')]

  • @53neshom
    @53neshom 3 года назад +1

    Awesome videos thank you.

  • @mechanical00toaster
    @mechanical00toaster 4 года назад +1

    Thank you!

  • @imresolyom8532
    @imresolyom8532 3 года назад +1

    so perfect , make more these , like with selenium or tkinter

    • @KianBrose
      @KianBrose  3 года назад

      A web scraper tutorial, why not

  • @refrefwgwgwegew
    @refrefwgwgwegew 3 года назад

    you are so good mate.

  • @ab-vj7vc
    @ab-vj7vc 3 года назад

    i gotta sponge up all your videos

  • @saadtanveer1479
    @saadtanveer1479 4 года назад +1

    Hey, keep up the good content. Are you going to do more bot videos?

    • @KianBrose
      @KianBrose  4 года назад +2

      Yes of course, this is just the one I came up with since the last one

  • @Zyphs
    @Zyphs 3 года назад

    your 2 tutorials where helpful i tried making a Typeracer bot with image to text and i had some issues when testing. it didn't like the font on the text but i could just change that with a add-on.
    and line breaks where annoying but pretty simple to work around.

    • @KianBrose
      @KianBrose  3 года назад

      Making the images larger also sometimes helps with the detection

    • @Zyphs
      @Zyphs 3 года назад

      @@KianBrose it's pretty good when I change the font. cdn.discordapp.com/attachments/224273954272051210/762446370061287485/unknown.png

  • @2010akatsuki
    @2010akatsuki Год назад +1

    Hey there, mate! I'm starting in the coding area and your videos are helping me a lot! Do you know what tools should I use to build a software that recognizes specific text on a screen and returns its location?

    • @KianBrose
      @KianBrose  Год назад +1

      Hm location not really unfortunately, you could try your luck with opencv

  • @HTWwpzIuqaObMt
    @HTWwpzIuqaObMt 2 года назад +1

    Thats a very basic demonstration of tesseract but this is gold for beginners

    • @KianBrose
      @KianBrose  2 года назад

      Yeah, I intend most content to be incredibly beginner friendly and less for advanced uses

  • @squeakycamp207
    @squeakycamp207 3 года назад +3

    YOU ARE AMAZING

    • @KianBrose
      @KianBrose  3 года назад

      Thanks u2

    • @squeakycamp207
      @squeakycamp207 3 года назад +1

      @@KianBrose you seriously have to do more of these! You are great at explaining and the videos are at the perfect place, so they can fit lots of information!
      Your videos on these topics are the best I have seen! Great job!
      Edit: pace not place

    • @KianBrose
      @KianBrose  3 года назад

      @@squeakycamp207 thanks! I'll get to uploading again once I'm done with some things

  • @anjanavabiswas8835
    @anjanavabiswas8835 3 года назад +1

    Very very very good.

  • @lukasmuller935
    @lukasmuller935 3 года назад +1

    Bro you need more subscribers. Your videos are so fucking good!

    • @KianBrose
      @KianBrose  3 года назад

      Thanks! Hopefully someday xD

  • @mrbeefy1101
    @mrbeefy1101 3 года назад +1

    Thank you so much for these videos they help sooo much. Under curiosity how would I be able to detect objects on a 3D game?

    • @KianBrose
      @KianBrose  3 года назад

      Uèeeeeeeeh character recognition sucks if theres weird backgrounds involved, if the colors of the text are "different" enough you can try to filter them out with opencv to get rid of the background and then try to detect text there

  • @rajagam5325
    @rajagam5325 3 года назад +2

    You are the fucking best brother(this is coming from an indian), I have tried many other such videos and yours always work. And you also explain most of the things.

    • @KianBrose
      @KianBrose  3 года назад

      Thanks! Glad you like it

  • @sajidnourose7080
    @sajidnourose7080 3 года назад +1

    Can we have more videos ? You can explain really well

  • @stayatohm
    @stayatohm 2 года назад +1

    MOUSE DRAG 6:16
    Good stuff thanks

  • @aoukrad
    @aoukrad 3 года назад +1

    i was here before 1M sub :D

  • @sammurphy5933
    @sammurphy5933 2 года назад +4

    I like how he has 2016 humour.

    • @KianBrose
      @KianBrose  2 года назад +1

      Ah you noticed haha

  • @ignacioleikis1784
    @ignacioleikis1784 2 года назад +1

    Awesome.
    Can you do a video tutorial where you go into converting images of numbers into manipulable integers in more detail?

    • @KianBrose
      @KianBrose  2 года назад

      That's what this video was supposed to cover although in a basic way, i unfortunately don't know of any other methods

    • @ignacioleikis1784
      @ignacioleikis1784 2 года назад

      @@KianBrose OK, thank you!

  • @robinmonsere2737
    @robinmonsere2737 3 года назад +2

    thanks! Make more!

  • @highfacility9200
    @highfacility9200 3 года назад +2

    Thanks

  • @Gerimdsc
    @Gerimdsc 3 года назад +1

    Maaaan, the content is incredible
    But what is that speed?!

    • @KianBrose
      @KianBrose  3 года назад

      Its fast no BS content xd

  • @Mr0o0o0o0o0o0o0o0
    @Mr0o0o0o0o0o0o0o0 3 года назад +2

    Tror du att du skulle kunna göra en video om image rekognition från kamera feed/video feed mer än via open cv(vilket i o för sig också varit awesome)

    • @KianBrose
      @KianBrose  3 года назад +1

      Ska försöka göra en video om AI/ML där jag använder en kamera som input

  • @pipaliyakuldeep7487
    @pipaliyakuldeep7487 3 года назад +3

    will be great if you can create playlist and keep this and previous video. name like Automation with python

    • @KianBrose
      @KianBrose  3 года назад

      Yeah the next vid will be about botting a color memory game

  • @lucasduport6293
    @lucasduport6293 3 года назад +3

    I really enjoy the video but I prefere the other video code editor, i don’t like the blue interface instead of a code editor ;) It’s only personal, keep safe dude

    • @KianBrose
      @KianBrose  3 года назад +1

      Yeah multiple people have said this, I won't do it again xD

    • @lucasduport6293
      @lucasduport6293 3 года назад

      I watched once of your video yersteday, I’m inlove w/ this channel. Thanks you for have a look on our comments, all my support is yours

  • @sanjeev_kumar14
    @sanjeev_kumar14 3 года назад +1

    I want to use the py file to read any image from the user rather than specifying that image, and then convert it to text, what changes should be made in the program?

    • @KianBrose
      @KianBrose  3 года назад +1

      You can use openCV to open images in a directory

  • @sudome5907
    @sudome5907 3 года назад +1

    Please upload new videos bro, your videos give me a lot of inspirations!

  • @CaptainRaylin
    @CaptainRaylin 3 года назад +2

    i love you

  • @TxcEcko
    @TxcEcko 2 года назад +1

    This worked for me, however I am currently analyzing thousands of images and it is very slow, reading about 1 image per 5 seconds or so. Is there any way to make my script use more of my CPU to run faster, as it is using almost nothing?

    • @KianBrose
      @KianBrose  2 года назад

      You could try your luck with multithreading, but that usually won't work really well
      1 image per 5 Seconds sounds a bit excessive, how big is the image?

  • @vedantdhadge3609
    @vedantdhadge3609 Год назад +1

    my code runs in vscode and IDLE but when i directly click the py file nothing happens and it closes immediately, i tried to keep the window open after the execution by adding a=input("press enter to exit") but still no use

    • @KianBrose
      @KianBrose  Год назад

      probably due to multiple python versions being installed

  • @nothing8497
    @nothing8497 Год назад +1

    I loved this video and channel too, I am seeking for some help related to this video, I want an automated code, such that there is a picture with some numbers, and I want bot to click a specific number in that picture, and that number is stored as a variable 'total'.

    • @nothing8497
      @nothing8497 Год назад

      or tell me how to convert that 'total' variable to an image, such that I will store it as 'pic' variable, then I will use that image match function as you used it in previous video (stickman), please help me.

    • @KianBrose
      @KianBrose  Год назад +1

      what you need there is ai, a simple bot solution won't be enough

  • @lmprivateaccount
    @lmprivateaccount 3 года назад

    I tried your resizing in order to improve OCR but it isn't working better ( maybe even less) do you have any other tricks pls ? I looked on overstack but it uses CV . Is CV better than tesseract?

    • @KianBrose
      @KianBrose  3 года назад

      Yes, you can actually apply a bunch of filters to improve the accuracy, for example: make it black and white , sharpen the corners , smooth out the sharpened corners

  • @Raylightsen
    @Raylightsen 3 года назад +2

    Sounds alien to me

    • @KianBrose
      @KianBrose  3 года назад +2

      damit, i tried explaining it easily

  • @dadmehrrezaei9611
    @dadmehrrezaei9611 3 года назад +1

    Do you have a video/code that takes an image of a text, converts to text and translate it (Spanish, etc) ?

    • @KianBrose
      @KianBrose  3 года назад +1

      I mean that's what this video is for... and the language doesn't really "matter" as optical character recognition just looks at characters and not words

  • @Priyanka-xh9gs
    @Priyanka-xh9gs 2 года назад +1

    This doesn’t work if there are indentations in the line like when u start a new paragraph, how would we get that to work, thanks!

    • @KianBrose
      @KianBrose  2 года назад

      Im not really sure what to do in that situation, sorry

  • @Hasanex
    @Hasanex 3 года назад +3

    Is that game Iruna Online at 2:42? :o

    • @KianBrose
      @KianBrose  3 года назад +1

      ..yes

    • @Hasanex
      @Hasanex 3 года назад

      You now have infinity more respect from me and a sub (jk you already won me over with your first video)! Love these fast tutorials, really looking forward to more! ^^

  • @alejandroalzatesanchez
    @alejandroalzatesanchez 3 года назад +1

    I use a friend as a clipboard too xD

    • @KianBrose
      @KianBrose  3 года назад +1

      xD That's how they know you consider them valuable

  • @gregoriusalvin118
    @gregoriusalvin118 3 года назад +1

    Teach us about selenium automation please

    • @KianBrose
      @KianBrose  3 года назад +2

      Ah yes web crawlers, I do have a video about that planned in the future

    • @gregoriusalvin118
      @gregoriusalvin118 3 года назад +1

      @@KianBrose im really" inspired by your videoo. Maybe you can make something about selenium web scrape, or auto join zoom class 😁👍👍

  • @invinciblenoman
    @invinciblenoman 2 года назад +3

    when I run the code this is the error.
    PermissionError: [WinError 5] Access is denied
    any help?

    • @KianBrose
      @KianBrose  2 года назад +2

      run it as administrator

    • @invinciblenoman
      @invinciblenoman 2 года назад

      I fixed this error

    • @benj4175
      @benj4175 Год назад +1

      @@KianBrose It doesn't show "the run it as administrator" button. What should I do?

  • @witzprinz4766
    @witzprinz4766 3 года назад +2

    You know that someone is an anime fan when they type g in their browser search bar and the first thing that pops up is gogoanime :thumbsup:

    • @KianBrose
      @KianBrose  3 года назад +1

      proceeds to type the letter *h*

  • @Broughtvulture
    @Broughtvulture 2 года назад +1

    I used this on text that is white, instead of black. And it didn't detect any of the words, what would you recommend I do?

    • @KianBrose
      @KianBrose  2 года назад

      Hmm you will need to do some image processing with OpenCV

    • @Broughtvulture
      @Broughtvulture 2 года назад

      @@KianBrose wait nvm, I just had to make my image size bigger. Great video man

  • @chakkarakuttan4569
    @chakkarakuttan4569 3 года назад +1

    bro...will this work on raspberry pi 3b+, I am having trouble with opencv installation with tesseract for image to text conversion.....please reply......I am a noob to python programing 😅

    • @KianBrose
      @KianBrose  3 года назад

      Ah yeah, you would have to install the linux version of opencv, personally I have never done it so I can't really guide you with that sorry

  • @zilla4505
    @zilla4505 3 года назад +1

    so im not the only one that uses dyno bot or mee6 to send all my important information like credit cards and highly confidential government secrets. great!

    • @KianBrose
      @KianBrose  3 года назад

      Yep xD

    • @IEBqp
      @IEBqp 3 года назад

      Btw they can store that data soo dont send your passwords

  • @jeffhehir5717
    @jeffhehir5717 3 года назад +1

    accidentally created skynet.py @4:23 Love it!

    • @KianBrose
      @KianBrose  3 года назад

      yay someone finally noticed!!!

    • @jeffhehir5717
      @jeffhehir5717 3 года назад +1

      @@KianBrose Make more videos, they are excellent!!

    • @KianBrose
      @KianBrose  3 года назад

      Jeff Hehir I know I know, the stress to make another video is slowly building up and I’m soon going to be ready with everything I currently have to do to be able to get started with the video

  • @greenmaniacs6009
    @greenmaniacs6009 3 года назад +1

    I get a error when this line runs: "from pytesseract import *" i did everything like 5 times. nothing just a LOT of errors.

    • @KianBrose
      @KianBrose  3 года назад

      Use Idle
      Use python 3.7.0 64 bit

  • @techknogamer7433
    @techknogamer7433 3 года назад +1

    I did everything you did on the video however I am getting a small box at the end of the output when converting a image to text. Any way to fix this

    • @KianBrose
      @KianBrose  3 года назад

      Ah this is probably because it's detecting some weird characters. There is a spaghetti fix to this issue which is removing all non abcd...1234 characters from a string with re:
      import re
      regex = re.compile('[^a-zA-Z]')
      #First parameter is the replacement, second parameter is your input string
      regex.sub('', 'ab3d*E')
      #Out: 'abdE'

    • @techknogamer7433
      @techknogamer7433 3 года назад

      @@KianBrose can i have a way to remove the last character from the output.

    • @KianBrose
      @KianBrose  3 года назад

      @@techknogamer7433 If you simply want the answer:
      assuming "st" is a string:
      st = st[:-1]

  • @bnebbneb2292
    @bnebbneb2292 Год назад +1

    Is there any way to have this script run on auto and convert every new image in the folder to text, and then release the output on a discord channel?

  • @taslimask2599
    @taslimask2599 3 года назад +1

    where is the first video said in this video ? link me please

    • @KianBrose
      @KianBrose  3 года назад

      ruclips.net/video/YRAIUA-Oc1Y/видео.html

  • @arjix8738
    @arjix8738 3 года назад +2

    instructions unclear, accidentally created skynet.py

    • @KianBrose
      @KianBrose  3 года назад +2

      Ayyy someone noticed!

  • @asgerandersen2087
    @asgerandersen2087 3 года назад +1

    how do i install the pyautogui on my mac?

    • @KianBrose
      @KianBrose  3 года назад

      terminal -> pip install pyautogui

  • @csicee
    @csicee 3 года назад +2

    What do u use to run python

    • @KianBrose
      @KianBrose  3 года назад +1

      Idle gives less errors than pycharm and vscode

  • @indianjitsingh8838
    @indianjitsingh8838 3 года назад +1

    This video was great but a little too fast.

    • @KianBrose
      @KianBrose  3 года назад +2

      I'd rather make it as fast as possible to avoid having empty useless spaces at all costs

  • @maumau4369
    @maumau4369 3 года назад +1

    How I can print out an specific text.I mean I can take a screenshot of something like playernames.Then read them out.But how I can do that Python than print that specific text I try to give the Programm?
    Edit:I mean that the program press the specific keys on the keyboard for the names I give him.

    • @KianBrose
      @KianBrose  3 года назад

      keyboard.write("something")

    • @maumau4369
      @maumau4369 3 года назад

      @@KianBrose hmm I know that I can make Screenshots with Python and save them with an specific title.Could I import that file and print it out with that command?

    • @KianBrose
      @KianBrose  3 года назад

      @@maumau4369 var = cv2.open("image.png")

    • @maumau4369
      @maumau4369 3 года назад +1

      @@KianBrose okay I try it when I’m back home 😊

  • @saurabhmishra7487
    @saurabhmishra7487 Год назад +1

    everything is running fine but there is no Output..

    • @KianBrose
      @KianBrose  Год назад +1

      Double check the image is being captured correctly by saving it somewhere

  • @olliboy965
    @olliboy965 3 года назад +2

    Is there a way to automate the screenshotting?

    • @KianBrose
      @KianBrose  3 года назад

      I mean just stick it in a while loop haha

    • @olliboy965
      @olliboy965 3 года назад

      @@KianBrose ohhhh nvm I forgot about the pyautogui screenshot funcion 😅

  • @Iqbalsharib4
    @Iqbalsharib4 2 года назад +1

    When to use pytesseract and when to use easyocr any idea?

    • @KianBrose
      @KianBrose  2 года назад

      I dontk now how to answer that actually

    • @Iqbalsharib4
      @Iqbalsharib4 2 года назад

      @@KianBrose ok thanks if you could make any automation tutorial on Lackey python.

  • @jamiemiller5155
    @jamiemiller5155 Год назад +2

    Hmm - Doesnt seem to want to read white text on a blueish background

    • @KianBrose
      @KianBrose  Год назад +2

      I recommend you look into opencv to filter out the noise and unwanted colors, maybe making text a tiny bit thicker as well

    • @jamiemiller5155
      @jamiemiller5155 Год назад

      @@KianBrose I finally got it to work - It was struggling to read the single digits had to ass the config on the end - EG text = pytesseract.image_to_string(img, config='--psm 6') work perfectly now - Thanks for the reply

  • @ankitwankhede2982
    @ankitwankhede2982 3 года назад +1

    it doesn't works with small and a little blur images

    • @KianBrose
      @KianBrose  3 года назад

      Yeah the image has to be decently large (you can use libraries like opencv to make them bigger) and perfectly readable