Dominating an Online Game with Object Detection Using OpenCV - Template Matching.

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

ความคิดเห็น • 501

  • @williamrutherford553
    @williamrutherford553 3 ปีที่แล้ว +363

    Great video, love to see more like this. Automating games like this is an amazing way to introduce people to OpenCV, it's simple to explain but teaches you important skills applicable to a much wider range of tasks. I'm glad I randomly stumbled upon your channel, your videos don't get nearly as many views as it deserves for such high quality educational content.

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +9

      Glad you enjoyed it! I'll have more coming soon!

    • @yichong777
      @yichong777 3 ปีที่แล้ว +4

      I agree, I had my first coding experience from minecraft because I wanted to automate a turtle in the modded game xD

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +6

      @@yichong777 Thanks for the comment it means a lot. I was getting beat up a bit today haha...

    • @bobchelios9961
      @bobchelios9961 3 ปีที่แล้ว +3

      i bascily became a programmer by starting to atuomate games. learned many skills from basic programming to ocr to stock market theroies to reinforcement learning while doing that.

    • @johndorian4078
      @johndorian4078 3 ปีที่แล้ว +1

      @@bobchelios9961 So did i....... which is why it's kind of a shame some games are so quick to ban.

  • @ArcaneEther
    @ArcaneEther 3 ปีที่แล้ว +130

    To circumvent the missed image detection from a day/night cycle, you can add a desaturation to both your sample and comparison images to grayscale them before comparison.
    This usually works for pixel-based art styles, as day/night is usually just an added color filter over the original image.
    The exception being those games that use specular or bloom lighting effects, which can distort the end-result grayscale in the image.
    The trade off, however, is that the added step of desaturating the sample image on each frame will slow down the script a bit.
    EDIT: This method also wouldn't work in games that reuse sprites with different color palettes, for obvious reasons.

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +14

      Yes sir! Very good points this is something I've used in a few projects and probably should have talked about! Great comment.

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

      hey could you help make a open cv for shooting the ball in nba 2k

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

      I didn’t get it why do they use different color palettes for different reasons?

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 8 หลายเดือนก่อน +1

      Differentiate objects by color is a cost effective way of expanding the object types in game.
      Red goblins are fire goblins.
      Blue goblins are ice goblins.
      If you want to use flame thrower on red goblins, and water gun on blue goblins, you need to be able to determine type you're identifying.
      That's the issue discussed above.

  • @Primu
    @Primu 11 หลายเดือนก่อน +8

    15:15 A more efficient solution here would be to just check for rectangles with intersecting regions. Not sure about python but in c# this is very simple with the Rect.IntersectsWith method (you can also just do it manually, the math is easy). Then you can combine them by inflating one rect with the difference from the other.
    Also for more reliable matching, there are various imaging algorithms you can use, for my OCR projects I do: grayscale > scaling > binarization > inversion > denoise > bordering, this helps a lot for matching foreground objects over varying backgrounds. You can also start with colour averaging which can make scanning for objects significantly faster at higher resolutions because you can scan chunks of the image and skip processing any that aren't similar. I've used these methods for overlaying real-time translation of text in non-english games.

  • @Beatsbasteln
    @Beatsbasteln 3 ปีที่แล้ว +279

    3:34 "now my hope is that we detect multiple instances of weed"
    yes pls!

    • @NoshNosher
      @NoshNosher 3 ปีที่แล้ว +19

      except he clearly says wheat

    • @Beatsbasteln
      @Beatsbasteln 3 ปีที่แล้ว +2

      @@NoshNosher are you sure about that bro?

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

      @@NoshNosher Charles Shwab ova here

    • @emifro
      @emifro 3 ปีที่แล้ว +4

      @@Beatsbasteln I am 100% sure he said wheat.

    • @Beatsbasteln
      @Beatsbasteln 3 ปีที่แล้ว +5

      @@emifro but how are you going to smoke wheat?

  • @AlgorithmAlloy
    @AlgorithmAlloy 3 ปีที่แล้ว +12

    You could have also done the grouping by comparing the distances of all rectangle centroids which would essentially create a node graph with every center connected to everyother center and then combining all nodes whose distance is below some threshold distance. Your solution works, I just think it’s good practice to use more general algorithms.

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +4

      I would agree very good points. Thanks for watching and commenting.

  • @mdellertson
    @mdellertson 3 ปีที่แล้ว +29

    Amazing work! Thank you so much for sharing this! I would love to see a video on how to implement convolutional neural networks to do object recognition.

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +10

      It's on my list for sure!

  • @pfever
    @pfever 3 ปีที่แล้ว +26

    Your videos are awesome man! I really love them :D

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      Mean a lot thanks. I really appreciate the view and comment have a good one.

  • @DarkNemesis04
    @DarkNemesis04 3 ปีที่แล้ว +11

    This is a really well paced and detailed guide! Great work :)

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +2

      Thanks I work really hard on trying to figure out the best pace to keep people engaged and still not skip topics. I will continue to try and improve. Thanks for commenting and watching.

  • @mohammedyasser3189
    @mohammedyasser3189 3 หลายเดือนก่อน

    man!!!!
    your are amazing
    we need more of this content with this type of teaching methods

  • @djbroake9810
    @djbroake9810 2 ปีที่แล้ว +2

    Thank for the examples and how it all works, liked and subbed.

  • @BusinessWolf1
    @BusinessWolf1 3 ปีที่แล้ว +6

    Here's an idea to get around the different shades thing: transform all target images to black and white, and same with the recording output going into the program.

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

      Different colours will end up as different shades of grey though. The correct approach is what the library already does, which is normalisation.

    • @BusinessWolf1
      @BusinessWolf1 3 ปีที่แล้ว +1

      @@gnack420 Shades imply there's color. What you wanted to say was value (lightdark). Sorry I got into definitions. But yeah, you're right. I wrote that comment before finishing the video, I didn't know you were gonna use an algorithm to find likely matches, I thought that whould require some deep learning or something much more advanced. Shows how much I know about programming. Oh, and btw, thanks for the video, it was really fun!

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

    Oh, come on.. I just decided "Ah crap, just get started..(!) Ima start with the basic webstack and see from there.
    And then I stumbled over this channel and THIS video..
    Great video @ClarityCoders!

  • @stevesteverson3345
    @stevesteverson3345 3 ปีที่แล้ว +6

    haha this is awesome, i've thought about doing it before and after this i might have to. One of the most relatable/interesting coding videos lmao.

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

      glad you liked it! I hope you do please share it if you do.

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

      @@ClarityCoders I already did :) although apparently the only way to grow small channels these days is to leave comments on a bunch of related videos so people click on your profile.

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

      @@stevesteverson3345 Trying to grow your channel?

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

      @@ClarityCoders hahah yeah come watch any of my 0 videos

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

    Great tutorial, really enjoy and appreciate you explain what each line does in detail. Subscribed and liked!

  • @ruangustavomoretti766
    @ruangustavomoretti766 2 ปีที่แล้ว

    Thanks man, you saved my graduation project!

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

    Teaching archivement unlocked! congrats man! you are helping people from brazil!

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      I am from a tiny town in the US never thought people would watch me in Brazil. Thanks for watching and commenting.

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

      @@ClarityCoders 🇧🇷

  • @aowmovies8657
    @aowmovies8657 10 หลายเดือนก่อน +1

    Hey bro, you can google mines game usually available in rummy apps. How to create mines game bot? To make all cells visible by seeing all hidden covered mines inside cells/grid or uncover then through any method or using OpenCv(image recognition) algorithm method to identify exact mines in the cells/grid? Can you make that tutorial?

  • @leonhardguss8150
    @leonhardguss8150 3 ปีที่แล้ว +16

    Thank you man, this is awesome !!

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

      Glad you liked it thanks for watching!

  • @youcandoit4502
    @youcandoit4502 3 ปีที่แล้ว +22

    Hi brother is it possible for you to make a chess bot with opencv as u make for other games or for knife hit game if yes please make a video on it .It will be really helpful .

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +6

      Sure let me see what I can do! Hit that bell so you don't miss it.

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

      ohh I already done that as I like your content so much and thanks it really means a lot.

    • @Ali-Britco
      @Ali-Britco 3 ปีที่แล้ว +2

      @@grzegorzabedzki2989 awesome work, very readable code, even though I have no interest in chess.

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

      @@ClarityCoders please don't, chess sucks with cheaters. And if you must, at least don't release the code

  • @elonmed
    @elonmed 2 ปีที่แล้ว +1

    thanks man. I love your teaching style

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

    Ah thank you so much, i was looking for a tutorial like this for a very long time :) I did something similiar in auto it just for fun, but I always wanted do something like that in a "real" programming language with more powerful libraries. Thank you so much =)
    I only need to learn how to use it in 3d games /video capturing. But it is just fine to learn right from the start :)

  • @CrynogarTM
    @CrynogarTM 3 หลายเดือนก่อน

    I use IDA Pro to Dominate in Multiplayer Games. In HTML Games I reverse the Server requests and just need a proper parser or memory pattern.

  • @chuifrankz2070
    @chuifrankz2070 2 ปีที่แล้ว

    best tuto about template match i have ever seen!helpful!

  • @hiperion_1416
    @hiperion_1416 3 ปีที่แล้ว +3

    getting game information from memory: 😴😴🤢🤬🤬
    getting game information using opencv: 😎😎🤑🤑🥶🥶

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      Both can be crazy frustrating haha...

  • @joshuaolsen8844
    @joshuaolsen8844 3 ปีที่แล้ว +3

    I love to see you doing these videos! I’d like to see one that is based on real pictures, like “is the car pointed left or right” etc and incorporate some training and AI

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +2

      Cool idea! I'll put it on my list.

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

    why is my match when copying and pasting from the haystack img 70-86% match instead of 99??? what am i doing wrong?

  • @Conqueror1807
    @Conqueror1807 3 ปีที่แล้ว +3

    Here after watching CS Dojo's video :)

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      Awesome thanks for stopping by!!

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

    please your codi, dimensions_left = {
    'left': 164,
    'top': 92,
    'width': 150,
    'height': 250
    }
    dimensions_right = {
    'left': 520,
    'top': 600,
    'width': 150,
    'height': 250
    } , what config positions the screen corret ? what exemple ?

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

    this is what I have been looking for... THANK YOUUUU

  • @Maric18
    @Maric18 3 ปีที่แล้ว +1

    whats the music near the end?

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +3

      Nico Staf - Fast and Run. Thanks for watching and commenting.

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

      @@ClarityCoders hey if i can get you that engagement and get the name of the song ... double positive :D

  • @officialonbekende9785
    @officialonbekende9785 2 ปีที่แล้ว

    imshow,imread,and al the rest of the stuff that comes after cv2. isnt working . it says __init__.py isnt found .i reinstalled is 5 times but still nothing

  • @walidyoucefkahla6120
    @walidyoucefkahla6120 2 ปีที่แล้ว

    bro can you write it as a scipte cause i tryed and it doesn't work like yours the rectongel doesnt showed on the the colored image

  • @maciej12345678
    @maciej12345678 11 หลายเดือนก่อน

    how to open view on screen windows like there 19:51 ?

  • @XIAOBAIZHANG-ym8pn
    @XIAOBAIZHANG-ym8pn 8 หลายเดือนก่อน

    Very good video, can you combine your idea into the online game of chess, and use OPENCV to identify the FEN position code of chess on the web page?

  • @wyatt5984
    @wyatt5984 3 ปีที่แล้ว +6

    I love the tutorial; keep up the great work! Heads up, I am coming for your high score ;)

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      I hope you do! Thanks for watching I appreciate it!

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

      Your score has been topped! No template matching was needed since the game uses the exact same pixels in the same locations but still great to know that functionality exists within OpenCV. keep on keepin on.

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      @@wyatt5984 Yeah I noticed that as well haha! Gives you some flexibility for more complex games though. Nice score!

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +2

      @@wyatt5984 Our discord is you're into that sort of thing. discord.gg/cAWW5qq

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

    This is an awesome, very straightforward tutorial. Thank you!

  • @USBEN.
    @USBEN. 3 ปีที่แล้ว +1

    Very fun to watch and learned a lot. Thankyou.

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      Thanks for watching/commenting it means a lot.

  • @jeevan1016
    @jeevan1016 24 วันที่ผ่านมา

    This is amazing. Can any GUI be automated using this?
    Can GUI testing be done using this technique?

  • @ihatechocolate6621
    @ihatechocolate6621 4 หลายเดือนก่อน

    I love this video and the idea, I don't know anything about coding but if you would every take a look at the game called "Parking master multiplayer 2" (the game requires a lot of repetition plays in order to have money, I would love to see you make a video about that game of how you would set up for it to auto drive the car into the parking spot!!

  • @saidalizade1291
    @saidalizade1291 2 ปีที่แล้ว

    Ty very much, i could not find someone explain this as well as you did ngl saved me

  • @jean-marctrutna4098
    @jean-marctrutna4098 2 ปีที่แล้ว

    Is it possible to move the mouse to the location of the identified object on the screen instead of a pre-set point?

  • @xpcraft2238
    @xpcraft2238 2 ปีที่แล้ว

    when i click shift enter it dosent run anything can you help me?

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

    Couldn't be more clear. Many thanks...

  • @blubms8593
    @blubms8593 2 หลายเดือนก่อน

    Please give me an idea how to make bot Auto Combo?

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

    blessed by youtube algo.. found your video and subscribed!

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      It's actually given me some love this past week. Thanks for watching and commenting.

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

    15:13 can't you make a try except instead of duping all boxes?

  • @CharlesWeill
    @CharlesWeill 3 ปีที่แล้ว +1

    I'm loving your content! As a fellow ML engineer, and fan on mini online games, I love this!

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

      Thanks! I really appreciate the feedback and views!

  • @Elislavkat
    @Elislavkat 11 หลายเดือนก่อน

    amazing. thanks. so much easy class from you

  • @HelloWorld-vm9gz
    @HelloWorld-vm9gz 3 ปีที่แล้ว

    Can i work with multiple models of an NPC (different color clothes, but similar image) in 3d? Like multiple images, side, front, back?

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

      Might needs something a little more flexible like a neural network.

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

    How to take screenshot and use it as a variable instead of writing it to file and reading it from the file. The issue I have is that first, I'm afraid that my harddrive age won't last that long with this method and second, it is faster

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

      Check out the code on the github for kick ya chop. I do exactly that! github.com/ClarityCoders/ComputerVision-OpenCV/blob/master/Lesson3-TemplateMatching/PlayGame.py

  • @UTJK.
    @UTJK. 3 ปีที่แล้ว

    Could this tecnique work to detect parts of a document (for example a rectangle with a text) in order to read what's inside that section of the document? It would be a scanned document so it could arrive with horizontal lines not perfectly aligned due the subtle movements of the paper durinig the passage under the scanner.

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

      I think you can make it much easier. OpenCV can detect rectangles in image. Next, it can detect text (OCR) within those rectangles. If rectangles are not perfectly aligned you can fix perspective of those rects in openCV too.

  • @cancihancelebi3495
    @cancihancelebi3495 8 หลายเดือนก่อน

    Thank you very much my friend, first of all, I follow the wheat finding code exactly and it doesn't work. Can you send it as a working project rather than a tutorial?

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

    how to you make it run in background? like i want to do other stuff and the bot still running the game in the background

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

      just keep it running then or get it hosted

  • @RiddleRations
    @RiddleRations 9 หลายเดือนก่อน

    Awesome video! Learned a lot!

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

    You can also find the wheat points without overlaps by running a local maxima filter on the grayscale image- accomplished in OpenCV with a dilate filter followed by a compare filter. You might not need it for this use-case, but you can also additionally filter out plateaus of local maximum value with an erode and a compare (if you want to know what to compare against what, for the sake of brevity here either google it or just try a few combinations; heck, you don’t need Jupyter to figure out the correct operations; you can prototype this kind of stuff with Photoshop/Gimp layers easily).
    I like image-processing solutions like this because 1. For an end-use you can more easily run the whole thing on a GPU where operations over a whole image are cheap and reducing that an array of numerical results is the expensive part, and 2. You can visually see and tune/debug the dilated image, the dilated-compared image, the dilated-compared-eroded image, and the dilated-compared-eroded-compared image.

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

      Very good points and great feedback. Thanks for watching and commenting.

  • @furkanakcakaya9443
    @furkanakcakaya9443 3 ปีที่แล้ว +1

    expected to see dominating that online farming game

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

      Sorrry! Maybe in the next one 😏

  • @Nougat_Noah
    @Nougat_Noah 3 ปีที่แล้ว +4

    Nice video but one question. Did you purposefully excactly double their highscore at the end or was that coincidence?

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +4

      I didn't even know! Good to have eyes like yours on these videos. Thanks for watching Noah.

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

    What to start with to understand it ?

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

    Are you taking screenshots from the whole screen or just the browser content?

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

    Teacher, first congratulations for the channel. I need your help, I have a simple image with a range of 5 placements where the quantity is identified, how do I identify the biggest color type red and say where the X,Y is, and if you can help me, and only for create an alert.

  • @gunnerstone120
    @gunnerstone120 3 ปีที่แล้ว +3

    Nice; Solid introductory video! I enjoyed watching. Wish there was a fast & efficient template matching method that worked with a high dimensional image space. I imagine the game you tested in the vid was only 800x600 or something lol. When working with large images I usually have to search a small section or it will take too long to compute.

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

      For sure I almost always cut down the area where I'm taking the screen shots. Especially if it's a real time thing where time matters. Thanks for watching and commenting I really appreciate it.

    • @SuperMasterDesaster
      @SuperMasterDesaster 3 ปีที่แล้ว +3

      You could also try speeding it up by scaling the image down before performing the template matching.

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

      @@SuperMasterDesaster Yeah I really like this idea as well.

  • @gold-junge91
    @gold-junge91 11 หลายเดือนก่อน

    Frage mich wie das ding drauf reagiert, bei mir zuhause meine Partnerin und ich schlafen 365 Tage bei Fenster ganz offen. 😅

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

    Hi i am beginner, i am preparing script for a similar game but the question is can i run script like this for multiple game windows lets say arranged in 3x3 matirx (just like tic tac toe) on desktop and would it work or do i need to implement something more?

  • @bartvrhijn
    @bartvrhijn 2 ปีที่แล้ว +1

    Jupyter us perfect for a live demonstration 👌

    • @ClarityCoders
      @ClarityCoders  2 ปีที่แล้ว

      I agree. I actually caught a lot of heat for using Jupyter haha...

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

    Instead of trying to group rectangles together, why not just find the local maximas of the correlation values?

  • @Atropin4ik
    @Atropin4ik 2 ปีที่แล้ว

    @claritycoders Thanks fo the videos! May you guys comment on how do games (their developers) catch such bots? Asking for the ways around obviously)

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

    OOOR in order to get rid of the additional rectangles you could just use sets to make get rid of data repetition

  • @timetoplay2927
    @timetoplay2927 10 หลายเดือนก่อน

    Это работает для статики. Тут зерно имеет конкретные цвета и никак не меняется. Я пробовал этот метод и он не работает для динамических картинок. Например, на экране идет снег, и снежинки закрывают объект, задний фон объекта меняется.

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

    Hi,
    how to handle transparent image case?

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      I think you can compare transparent images BUT you have to make sure both your needle image and haystack image have 4 dimensions. 1 for the alpha channel.

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

      ​@@ClarityCoders thanks for your answer yea so i cant just simple crop image and compare. Because capture image do not have alpha information. Is there any method to do this ?

  • @siswanto4045
    @siswanto4045 11 หลายเดือนก่อน

    I'm imagining, how can I use template matching on GIS software.

  • @jaimetheone9150
    @jaimetheone9150 2 ปีที่แล้ว

    This works perfectly on VSCode, but as soon as I turn it into an exe with pyinstaller it does nothing.

  • @anonymous-3695
    @anonymous-3695 3 ปีที่แล้ว

    how would this work in a 3d setting, like if objects are different sizes? can it be modified for that? it would seem to be expensive to check for many different sizes so im not sure that approach would work.

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      I would definitely lean into a CNN or some other neural network at that point. I don't think this would cut it.

  • @patrickmueller9658
    @patrickmueller9658 2 ปีที่แล้ว

    Liked and subscribed - explained and shown structured and clearly! Thanks!

  • @JohnWick-gy5vv
    @JohnWick-gy5vv 3 ปีที่แล้ว

    wow i want this i am trying to detect object game
    refresh game plants every 15mins
    if plant is dry send telegram bot notification if not do nothing

  • @farmminer4014
    @farmminer4014 3 ปีที่แล้ว +3

    Thank you! Very great guide to OpenCV! But how to optimize it to get it to run 100 times faster? How to use multiple CPU cores and GPU with OpenCV?

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

      @TridentflayerThe other thing you can attempt to do is vectorize your code very heavily so that you can do all of your calculations in numpy operations. Speaking from miserable experience, that can be far harder than just biting the bullet and doing it in c++

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

    Oh, this might solve a problem I have. There’s some made up alphabet which looks like it was made with a fixed typeface, and I want to transcribe the text in the images into actual text in order to try to decipher it, and I think I know how to extract the characters, but I still need to find how to detect which character they are.
    I can’t use standard OCR because these are a made up alphabet in an Easter egg for a game.

  • @melonman1252
    @melonman1252 3 ปีที่แล้ว +1

    Great Video!

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      Thanks for watching protect that melon.

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

    woah you jump from 2k subs to 7k in 5 days, congrats

  • @1996Pinocchio
    @1996Pinocchio 3 ปีที่แล้ว +2

    3:29 "inside PAINT"???
    Dude, just hit Shift+WindowsKey+S and cut out the picture you need :->
    Good video tho, really helpful :)

  • @4ngeek
    @4ngeek 3 ปีที่แล้ว

    I always compared images with mean square root or structural similarity. Template matching seem to be more intuitive

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

      Probably similar in speed? Thanks for watching / commenting.

  • @rogerr45
    @rogerr45 10 หลายเดือนก่อน

    Hello friend, can you help me make a bot for a gaming MMORPG?

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

    Hi
    I nned a bot for league of kingdoms, can u help?

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

    In cell 10 you overlay the template match with the original image but you don't explain how - is this something that opencv can do for you?

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      It's done automatically when you call cv2.matchTemplate. Thanks for watching and commenting!

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

      @@ClarityCoders thank you for making the video 🙏

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

    For the multiple boxes issue, could you lower the threshold till at least 2 boxes appear around the wheat, then remove any 1 box items which should be anything that isn't wheat, and continue from there?

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

    how long does it take to the entire script to run? Is it possible to implement a similar thing in a dynamic robot? Thankyou

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

      Yeah it's pretty if speed was an issue you would probably want to cut down on screen shot size and such.

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

    Cool video but if you used vs code you wouldn't need 2/3 of your code to be erroneous functions calls that you just need to keep it from crashing.

  • @4ur3n
    @4ur3n 3 ปีที่แล้ว +5

    great job man :D

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

      Thanks I really appreciate it.

  • @sasausa2952
    @sasausa2952 3 ปีที่แล้ว +4

    So with this you can basicly bot in any game? I think you cant do this bcs of EULA.

    • @Levy957
      @Levy957 3 ปีที่แล้ว +3

      the game can and will ban your account if they detect botting, but the video is for learning the fundamentals of computer vision.

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

      Yeah I would be very careful with games that you actually like or are playing on your real account. I am doing this on silly flash games and don't really care about the ban hammer.

  • @Raid77
    @Raid77 3 ปีที่แล้ว +6

    Amazing tutorial although I do have some ideas to improve some of what was presented,
    Firstly the rectangles grouping section, I'm sure there's a better way than just duplicating the list, maybe manually comparing the x, y of rectangles and if they are similar to another rectangle we don't use it
    The other point would be about beating the highscore, i would test for a single pixel's color above the player on each side where the background is static and check if it's color changes (a branch is above) and move accordingly

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

    about kick ya chop, u dont have to use entire detection system as u did with opencv, wastefull, slow. u can avchieve same result by just sticking to 1 backround pixel with 2 lines of code at max

  • @andrewyoung9290
    @andrewyoung9290 3 ปีที่แล้ว +2

    This is a great tutorial - thanks! Could you also do one explaining the kick ya chop script you have in your git hub? Also I tried to use the kick ya chop script but had to increase the sleep time to around 0.2 otherwise it wouldn't work. This is even after I tried reducing the region to search in. What gives? Do I need a faster computer or something?

    • @ClarityCoders
      @ClarityCoders  3 ปีที่แล้ว +1

      Yeah it might just be a difference in processing speed. I'll try to get some videos out explaining the code more in depth.

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

    How I contact U?

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

    Okay bro but there is a problem... You made the code using an image. What if I want to use it in a true game...?

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

    can you do this tracking soccer players?

  • @mateussantiago3131
    @mateussantiago3131 2 ปีที่แล้ว

    ty cuz ive been having a hard ti getting started.

    • @ClarityCoders
      @ClarityCoders  2 ปีที่แล้ว

      Anytime let me know if you have any questions!

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

    does it works with differences in the scale of the pattern and the image?

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

      Not well. Depends though on how good you need it to be.

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

    Thank you for making this video, it really helps me a lot.

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

      I hope so. Let me know if you have any questions.

  • @canal_conectando
    @canal_conectando 2 ปีที่แล้ว

    How is your Cam?

  • @thewdead3673
    @thewdead3673 2 ปีที่แล้ว

    great video! could you make something like this for a pokemon game walking in a grass and leveling up?

  • @mharllclarenz1449
    @mharllclarenz1449 11 หลายเดือนก่อน

    can this be used in realtime?