I have been trying to capture a game to make a notification system to notify a player on discord via a bot when they find a match. i am able to do it when the game is open in windowed or borderless windowed, when using fullscreen it returns a blackscreen.
@@tavi7 Try MSS for screen capture. You should see noticeable fps increase. Also If you watch his last video in the series where he implements threading, fps increases to over 100+ and no longer is an issue
I would honestly put you in the top 1% of coders on TH-cam who are actually good teachers as well. Wow.. just wow.. I'm amazed at how clear and concise you made everything I'm subscribing for sure
"This video is getting kind of long" What are you talking about? We had been here for 5 min... whoa, time does fly when you are enjoying something! Absolutely fantastic, thank you for your work!
I’ve only seen one of your videos so far, and skimmed through this one but I can definitely say that your unique content has gotten me very motivated to dedicate even more time for programming.
this is by far the best episode of the series. I always love the idea of the author walking through the mental process on how solve the problem. Appreciate your effort Ben. Take care
I've been smacking my head into a keyboard all day trying to understand Classes. I've had it explained to me 4 times (usually with a Class Person analogy), but your explanation was the first time it clicked. Thank you!
i was about to say how good teacher you are but ppl actually just did. Wow, in seconds you were able to explain concepts that ppl take hours to doo. so simple and easy to understand. GRATS
I appreciate your emphasis on problem-solving and research. It's almost like the specific purpose of your video is second to the more general process of research/coding/bug-fixing.
you are great. I don't speak English so I have to use google translate to comment. Very detailed instructions easy to understand. For those who don't know anything about programming like me, but also understand. Thank you very much.
Man, thank you so much this really helped a lot. I liked that instead of just saying the answer and keep going, you search Google in front of us about each problem you encounter and then analyze the written code and try to make us understand more. This is the best openCV tutorial I ever saw on TH-cam❤
Woow, thank you so much, i saw this video more than one year ago and today i was with an issue related with shape of screenshots in cv2 and i remembered that you used in the tutorial
Instead of removing alpha by looping through the image array you can run cv.cvtColor(screenshot, cv.COLOR_RGBA2RGB) before cv.imshow('Computer Vision', screenshot). That gives back ~10 FPS.
did you mean this drop inside get_screenshot function? -> img = img[...,:3] the cvtColor can be inputed in the window capture return in get_screenshot function -> return cv.cvtColor(img, cv.COLOR_RGBA2RGB), doesn't necesseraly need to be inputed in main, but i get your point, gonna test it, thanks
I really like the way you teach. You are not a "know-it-all" guy. I appreciate that you showed how real programmers work. Sometimes the most basic concepts are forgotten and just a simple google search for an example function is what needed. You got a subscriber here, keep it up! :)
Minute 16 (more or less) you used "fromstring", when I ran the code in Jupyter recommended me to use "frombuffer" and it was 2-3 times faster than before, Amazing videos man, you really ROCK
It’s quite nice you included your thought process when you were googling stuff, for beginners like me that could be quite inspiring and i haven’t seen any other tutorial videos which have done this
The way you teach is awesome. Very precise and to the point. Mark my words. You will easily be one of the most followed teachers for programming in the future. Looking forward to your videos. Please do consider integrating ML into game automation for your next series.
Forever grateful for your videos. I haven't started diving into Python but watching you explain a lot of stuff that are not often explained to beginners is sooo helpful. Keep it up!
I'm learning a ton from this. I'm building a bot that will do object recognition, log the object and the player inserted title of the object, take action upon the object, and move on to the next. I'm really interested in learning how to use a folder of images to detect each object in the frame. Maybe some kind of ML / AI tool. Awesome!
Awesome, sounds fun! I'll definitely be making videos down that path of using multiple images for detection, and eventually machine learning things too.
I have a working script for a Image Search using an array of images from a folder using a screencapture from a WindowHandle. But it's in Autoit. I will posted a video of my Bot in some time. I am working on an Android game and capturing it via an Emulator and further sending mouse and keyboard commands via a window handle.
Truly brilliant and neatly arranged video series. I was looking to shift my code to Python (from AutoIt), expecting Python to be significantly faster. But calling out WinCapture is same in both cases.i prefer Autoit code to Python as it's easier for me. I will wait for your final video to see the performance before i start shifting my code to Python. Thanks for the information and details on the methodology.
16:25 or something around it. you might go with this line: img = cv.cvtColor(img, cv.COLOR_RGBA2RGB) as a result, almost no performance drop, no alfa, no errors.
Cool tuts man. I'm currently developing minimilitia game bot using adb_shell, pynput,numpy. I never thought of using opencv to detects it's characters location - x, y axis. Thanks man.
I got to hand it to you, you are an amazing teacher. I have worked through a couple of Python Fundamentals books / courses which all included a chapter or two on OOP. But it wasn't until I listened to your game character class analogy that things finally clicked for me! I still have a lot to learn, but I finally understand why the code I am trying to grasp contains all of these "self" references, haha! Thank you very much for these great tutorials and I look forward to watching the rest of the series.
DUDEEE I UNDERSTOOD CLASSES NOW SO MUCH MORE THNX TO YOUUUUUUUUUUUU THANK YOU SO MUCHHHHHHHHHHH IVE BEEN STRUGGLING PYTHON OOP AND WHEN I WATCED THIS VIDEO IT MADE IT SOOO CLEAR
thanks for showing me some useful tips for google searching solutions to my problems but looks like i didn’t need to! this video was so helpful! thanks so much
Amazing, thank you so much for this video. I'm from Brazil and I dont have a really good english level, but I achieved to understand what you said. Thank you again, see you um next videos
no sNice tutorialt. Always watched soft-soft beginner guides and understood notNice tutorialng. But now I am feeling the first ti like I can start making
If i ever would have to teach someone basics about classes, i definately use your explanation. That was awesome, which i would have learned it that way :D
Nice work ! :) next episodes detect object from those frames of game :) problems : multi objects detect === more slower multi image template for each object ===== more slower draw those rectangle ... Good luck !
I had to stop by and personally thank you for this amazing tutorial video. This is top quality material. I have just subscribed and hope to see more of your content. Ty so much for sharing
Great content, great channel idea. I'm not new to programming but I am new to OpenCV, this is a really engaging way for me to get into the content. Hope you continue on with it. Subscribed with notifications, can't wait for the next one!
First, great videos. Learning python and this really helped. Huge kudos. Unfortunately, the screencapture would not work for me with a game based on Unreal Engine. I think it has to do with how 3D graphics are rendered on screen, not sure, but I kept getting that "Black Screen" capture and nothing fixed it, checked Video #5, still, black screen. I ended up having to use my Steam Overlay Screenshot feature to capture the screenshots then read them into Python and used CV to manipulate the shots. That has downsides as well. Would love to hear from someone that solved the "Black Screen" capture with CV on 3D accelerated games (like Unreal Engine). BTW, I was using Sea of Thieves as my game reference.
In Linux there is the python mss() module, by which in my modest 1366x768 px screen, it reaches 130~140 fps. A gt1030 graphic, and a FX6300 processor with 8GB ram, so I suppose that if someone has something better than that, the result should be even better. Anyway I want to thank you for the fact that you teach python. I don't speak English, so I use automatic subtitling and translation to understand you. I have learned several things, thank you very much. You teach in a very pleasant way, and I even relax hahaha
Aside from the importance of good googling skills, it's wise to also give back to the community, a single upvote could greatly help. I feel sad for the StackOverflow link who deserves an upvote whom you got the useful info from, so I gave both of them one :) Great content along with humor!
This is a very good tutorial. Subscirbed! I'm learning this so I can build a tool that waits for a specific S class ships to land in No Man's Sky and pause the game. Proably not going to be easy but this already putting me in the right path
It has been two years already, where is the continuation? Why did you abandon your channel? You explain better than all my teachers! You're the best! It has been 2 years already, perhaps you have improved object detection, bot performance, and their movement between points, or maybe there's something else interesting to see!
Can I just mention that at 21:05 you explaining why self.h needs to happen as it's no longer within the function is the first time I actually got why that happens. Great material and teacher!
the step at 12:12 I dont get an error when running the code but there is also no screenshot saved. It prints out the done thats it What could be wrong ?
These videos are fantastic. There's a reason why nobody pressed the dislike link. I can't wait for the next video and I hope the notification bell sends me a message. Do you have twitter?
Thanks for the videos. I am really enjoying them. Little bit slower progress because I have to translate everything into C++. :) So far so good though!
Hey! Im having an issue to where some windows that I use the WindowCapture on just returns a black screen. Do you know how I might be able to fix this? Love your work, and thank you!
Have the same issue, somebody fixed it yet? Could that be caused due to permission issues? Things like Explorer can be captured, websites can't, although the headers get recorded the actual website is black.
March 2024 - VS Code installed to go through your tutorial, fresh python installation (3.2 I think the current one); April 1: followed all your steps up to now and had to upgrade pillow, before you mentioned how it should be installed already, to do the first section of screenshots.
Thank you so much. I finally got to learn how to write classes. The albion capture doesn't work, I'm assuming as they have the anti-cheat system enabled.
If you're having trouble with a black screen when you try to do the window capture, continue on to video #5 for a fix.
I have been trying to capture a game to make a notification system to notify a player on discord via a bot when they find a match. i am able to do it when the game is open in windowed or borderless windowed, when using fullscreen it returns a blackscreen.
search skill increased to 70
Nice video but I don't get the point, it's not faster than pyautogui at all, same 20 fps so why even bother?
@@tavi7 Try MSS for screen capture. You should see noticeable fps increase. Also If you watch his last video in the series where he implements threading, fps increases to over 100+ and no longer is an issue
Which VScode color theme are you using in this video, I love it! Awsome video btw helped me a lot.
The most honest programmer I have seen in TH-cam, keep continuing what you are doing. I rarely put comment for someone... Thanks!
Thanks appreciate it!
Man, I seriously enjoy your style of explaining things.
It's the small stuff like that remark at 6:10 for example.
Kudos and keep up the good work! :)
Thanks!
I would honestly put you in the top 1% of coders on TH-cam who are actually good teachers as well.
Wow.. just wow.. I'm amazed at how clear and concise you made everything
I'm subscribing for sure
Top 0.1% I would say
@@ilia9872 Tbh yeah haha he's just that good
You are quite possibly the best instructor I have ever had...in any subject. Fantastic!
I can't stress enough how your style of explanation helps us understand both the concept and the practicality of OpenCV. Huge huge thanks!!
Glad to help!
"This video is getting kind of long" What are you talking about? We had been here for 5 min... whoa, time does fly when you are enjoying something!
Absolutely fantastic, thank you for your work!
I’ve only seen one of your videos so far, and skimmed through this one but I can definitely say that your unique content has gotten me very motivated to dedicate even more time for programming.
Awesome man, keep at it.
this is by far the best episode of the series. I always love the idea of the author walking through the mental process on how solve the problem. Appreciate your effort Ben.
Take care
I've been smacking my head into a keyboard all day trying to understand Classes. I've had it explained to me 4 times (usually with a Class Person analogy), but your explanation was the first time it clicked. Thank you!
i was about to say how good teacher you are but ppl actually just did. Wow, in seconds you were able to explain concepts that ppl take hours to doo. so simple and easy to understand. GRATS
I appreciate your emphasis on problem-solving and research. It's almost like the specific purpose of your video is second to the more general process of research/coding/bug-fixing.
you are great. I don't speak English so I have to use google translate to comment. Very detailed instructions easy to understand. For those who don't know anything about programming like me, but also understand. Thank you very much.
Man, thank you so much this really helped a lot. I liked that instead of just saying the answer and keep going, you search Google in front of us about each problem you encounter and then analyze the written code and try to make us understand more. This is the best openCV tutorial I ever saw on TH-cam❤
Woow, thank you so much, i saw this video more than one year ago and today i was with an issue related with shape of screenshots in cv2 and i remembered that you used in the tutorial
Instead of removing alpha by looping through the image array you can run cv.cvtColor(screenshot, cv.COLOR_RGBA2RGB) before cv.imshow('Computer Vision', screenshot). That gives back ~10 FPS.
noted (by me 😊)
did you mean this drop inside get_screenshot function? -> img = img[...,:3]
the cvtColor can be inputed in the window capture return in get_screenshot function -> return cv.cvtColor(img, cv.COLOR_RGBA2RGB), doesn't necesseraly need to be inputed in main, but i get your point, gonna test it, thanks
I have no words to describe how much I like your tutorials. All I can think of is Thank you.
I really like the way you teach. You are not a "know-it-all" guy. I appreciate that you showed how real programmers work.
Sometimes the most basic concepts are forgotten and just a simple google search for an example function is what needed.
You got a subscriber here, keep it up! :)
Thanks!
The penny has finally dropped after the way you explained classes and the self variable. I can't believe I've never understood classes before. Thanks!
That's awesome to hear!
This is one of the finest tutorial I've searched. It goes step by step and everything was explained. I'm glad I didn't miss this one.
I love the comment at the beginning
"Talking about the importance of good googling skills"
Hahaha
Underrated channel. I'd be happy to see even more videos from you, no pressure.
Minute 16 (more or less) you used "fromstring", when I ran the code in Jupyter recommended me to use "frombuffer" and it was 2-3 times faster than before,
Amazing videos man, you really ROCK
that class explanation was a very creative and gave me a new, more fun perspective regarding classes. Thank you
thank you alot for this video , i like the way you explain things especially learning how to search instead of giving us the solution directly
Thank you for your calm style of teaching; you alone have helped me learn more than anybody else on TH-cam.
Awesome! I wasn't sure when I started, but hoped my style would resonate with some people.
This is the first time im gonna turn on the notifications on youtube.
It’s quite nice you included your thought process when you were googling stuff, for beginners like me that could be quite inspiring and i haven’t seen any other tutorial videos which have done this
The way you teach is awesome. Very precise and to the point.
Mark my words. You will easily be one of the most followed teachers for programming in the future.
Looking forward to your videos.
Please do consider integrating ML into game automation for your next series.
Thanks for the kind words. Yeah I definitely want to get to machine learning stuff before too long.
This is the first playlist on TH-cam I've been waiting on the next episode, learning tons thanks for this resource!
I have never been so motivated to learn, I love this video
You move like Richard from Silicon Valley when you talk. Great video btw
Forever grateful for your videos. I haven't started diving into Python but watching you explain a lot of stuff that are not often explained to beginners is sooo helpful. Keep it up!
Thanks for your comment. Good to know I'm on the right track!
I'm learning a ton from this. I'm building a bot that will do object recognition, log the object and the player inserted title of the object, take action upon the object, and move on to the next. I'm really interested in learning how to use a folder of images to detect each object in the frame. Maybe some kind of ML / AI tool. Awesome!
Awesome, sounds fun! I'll definitely be making videos down that path of using multiple images for detection, and eventually machine learning things too.
I have a working script for a Image Search using an array of images from a folder using a screencapture from a WindowHandle. But it's in Autoit.
I will posted a video of my Bot in some time.
I am working on an Android game and capturing it via an Emulator and further sending mouse and keyboard commands via a window handle.
Capturing just the window is a game changer, looking forward to your next video. Cheers
Yeah it definitely is!
I'm hoping the next video is out today/tmrw, loving these! Surprised they don't have 100x more views.
Truly brilliant and neatly arranged video series. I was looking to shift my code to Python (from AutoIt), expecting Python to be significantly faster. But calling out WinCapture is same in both cases.i prefer Autoit code to Python as it's easier for me. I will wait for your final video to see the performance before i start shifting my code to Python. Thanks for the information and details on the methodology.
Thanks for watching! I haven't used AutoIt before, I'll have to check it out.
Yes, AutoIt is easier for automation and hacking. Trying to shift to Python too.
Not only got what I need, but also more lesson about googling. Very good tutorial :)
Thank you for making this video. It's really helpful to see the full process of not just building the code, but also researching reference codes.
I'm playing Albion Online and learning to work with open CV
How perfect is this!!
this series keeps getting more interesting!!! aw man thank you so much
Glad you like it!
This is the best free software Ive seen. Respect.
16:25 or something around it.
you might go with this line:
img = cv.cvtColor(img, cv.COLOR_RGBA2RGB)
as a result, almost no performance drop, no alfa, no errors.
Cool tuts man.
I'm currently developing minimilitia game bot using adb_shell, pynput,numpy. I never thought of using opencv to detects it's characters location - x, y axis. Thanks man.
I got to hand it to you, you are an amazing teacher. I have worked through a couple of Python Fundamentals books / courses which all included a chapter or two on OOP. But it wasn't until I listened to your game character class analogy that things finally clicked for me! I still have a lot to learn, but I finally understand why the code I am trying to grasp contains all of these "self" references, haha! Thank you very much for these great tutorials and I look forward to watching the rest of the series.
Dude! This is perfect! I'm doing a bot using opencv and your video help me a lot!!! Thank you so much!!!
Nice!
It’s awesome that you go into how you research. This probably helped so many people with just research generally - great work! Awesome post
I learn lots of new things in every single video from you. Although I'm not a beginner
Tank you very much ❤️❤️❤️
Thanks for watching!
Being a pro googler makes sense. I find that I run into issues all the time but one simple google search and everything is good.
This is the best explaining while coding, Thanks
DUDEEE I UNDERSTOOD CLASSES NOW SO MUCH MORE THNX TO YOUUUUUUUUUUUU THANK YOU SO MUCHHHHHHHHHHH IVE BEEN STRUGGLING PYTHON OOP AND WHEN I WATCED THIS VIDEO IT MADE IT SOOO CLEAR
thanks for showing me some useful tips for google searching solutions to my problems but looks like i didn’t need to! this video was so helpful! thanks so much
Thanks a lots for the great video! The way you demonstrate the research to get the solutions is really helpful. Looking forward to your next video!
Love your videos, very helpful and easy to understand.
Thanks!
This was exactly what i needed for my project, great timing
Amazing, thank you so much for this video. I'm from Brazil and I dont have a really good english level, but I achieved to understand what you said. Thank you again, see you um next videos
no sNice tutorialt. Always watched soft-soft beginner guides and understood notNice tutorialng. But now I am feeling the first ti like I can start making
If i ever would have to teach someone basics about classes, i definately use your explanation. That was awesome, which i would have learned it that way :D
Nice work !
:) next episodes
detect object from those frames of game :)
problems : multi objects detect === more slower
multi image template for each object ===== more slower
draw those rectangle ...
Good luck !
Thanks! Yep, that's what's coming up.
@@LearnCodeByGaming i made a community of "bot building" in facebook , if you are interested to join :) us
facebook.com/groups/botbuilding
greetings.
How do you have just 10k subscribers? I wish I found this content when I started my university four years ago, these are gold explanations and tips
The best videos I have ever seen, I look forward to the next part
Thanks!
This is crazy man, thanks for sharing. Now i have some ideas for my project.
I had to stop by and personally thank you for this amazing tutorial video. This is top quality material. I have just subscribed and hope to see more of your content. Ty so much for sharing
Great content, great channel idea. I'm not new to programming but I am new to OpenCV, this is a really engaging way for me to get into the content. Hope you continue on with it. Subscribed with notifications, can't wait for the next one!
Thanks David!
First, great videos. Learning python and this really helped. Huge kudos. Unfortunately, the screencapture would not work for me with a game based on Unreal Engine. I think it has to do with how 3D graphics are rendered on screen, not sure, but I kept getting that "Black Screen" capture and nothing fixed it, checked Video #5, still, black screen. I ended up having to use my Steam Overlay Screenshot feature to capture the screenshots then read them into Python and used CV to manipulate the shots. That has downsides as well. Would love to hear from someone that solved the "Black Screen" capture with CV on 3D accelerated games (like Unreal Engine). BTW, I was using Sea of Thieves as my game reference.
In Linux there is the python mss() module, by which in my modest 1366x768 px screen, it reaches 130~140 fps. A gt1030 graphic, and a FX6300 processor with 8GB ram, so I suppose that if someone has something better than that, the result should be even better.
Anyway I want to thank you for the fact that you teach python. I don't speak English, so I use automatic subtitling and translation to understand you. I have learned several things, thank you very much. You teach in a very pleasant way, and I even relax hahaha
Thanks for sharing that info! And cool to hear that the subtitles work well.
Ben, you are my personal Jesus Christ! Thank you for your work, which causes incredible admiration! Hello from Russia.
Aside from the importance of good googling skills, it's wise to also give back to the community, a single upvote could greatly help. I feel sad for the StackOverflow link who deserves an upvote whom you got the useful info from, so I gave both of them one :) Great content along with humor!
Bruh it's very sad you stopped making videos, this was a great material.
MAN YOU ARE AWESOME! FROM BRAZIL. This help me a lot in my project. Keep the good work. Your think process is so good, and help so much! Thx
Glad to help!
@@LearnCodeByGaming Looking forward to the next video.
O cara é muito bom, melhor coisa q o youtube fez foi me jogar nos videos dele kkkk
@@johnathangomes3750 Sim! To fazendo um projeto aqui e isso me deu um norte muito bom, desenvolvi mil vezes mais rápido com alguns conceitos dele
This is a very good tutorial. Subscirbed! I'm learning this so I can build a tool that waits for a specific S class ships to land in No Man's Sky and pause the game. Proably not going to be easy but this already putting me in the right path
Wow, I learned a bit about Python classes. You present very well and to the point. Nice work!
You are a true master at opencv xD bravo 👏
It has been two years already, where is the continuation? Why did you abandon your channel? You explain better than all my teachers! You're the best! It has been 2 years already, perhaps you have improved object detection, bot performance, and their movement between points, or maybe there's something else interesting to see!
brother you are insane in a very good way! genius thanks for sharing knowledge
Thank you for helping us beginners out.
Thanks, this is help me a lot. I'm still waiting for 5# and so on.
Just posted video 5! th-cam.com/video/7k4j-uL8WSQ/w-d-xo.html
Great Video, congrats from Brazil. (Sharing knowledge to all world) :D
Can I just mention that at 21:05 you explaining why self.h needs to happen as it's no longer within the function is the first time I actually got why that happens. Great material and teacher!
the step at 12:12 I dont get an error when running the code but there is also no screenshot saved. It prints out the done thats it
What could be wrong ?
Thank you so much, Richard Hendrix!
Dude I'm so glad I found this channel!
Dude You rock bro, also could you make a tutorial to how to read and understand documentation of python modules in general?
Thanks Emilio! Yeah I've thought about doing videos like that. I'll add it to my list of ideas.
@@LearnCodeByGaming thanks man, also what is a good project for a newbie to do for learning yo aplying the theory?
Great videos! Easy to understand and follow. Thank you
the area inside the frame is called the client area and GetClientRect will get the adjusted rectangle
These videos are fantastic. There's a reason why nobody pressed the dislike link. I can't wait for the next video and I hope the notification bell sends me a message. Do you have twitter?
Thanks! I do have a twitter: twitter.com/BenLearnCode
Learn Code By Gaming great! You have a new follower.
Thanks for the videos. I am really enjoying them. Little bit slower progress because I have to translate everything into C++. :) So far so good though!
it's so cool seeing someone code that doesn't hide anything
Epic video Ben! I've been enjoying the series. This is better than paid udemy courses btw. Thanks!
where were you few months ago when I tried to make a LoL bot... anyway this was super useful, subscribed!
i would love more python old school runescape projects from you
Your Videos Helped Me SO MUCH
Easy to follow as you explain.
Hey!
Im having an issue to where some windows that I use the WindowCapture on just returns a black screen. Do you know how I might be able to fix this?
Love your work, and thank you!
Have the same issue, somebody fixed it yet? Could that be caused due to permission issues? Things like Explorer can be captured, websites can't, although the headers get recorded the actual website is black.
That’s because this is no buffer 3D hardware device accelerated window. Just turn Windowed or do not use Python.
This video was super helpful. The only downside is that you clearly main hunter in WoW.
🤣🤣🤣
Você é um gênio kkkk um ano procurando isso, muito legal parabéns
Thanks man this was really helpful and I learnt a ton, appreciate the effort, really great tutorial
Hey did you get a black screen?
March 2024 - VS Code installed to go through your tutorial, fresh python installation (3.2 I think the current one); April 1: followed all your steps up to now and had to upgrade pillow, before you mentioned how it should be installed already, to do the first section of screenshots.
Thank you so much. I finally got to learn how to write classes. The albion capture doesn't work, I'm assuming as they have the anti-cheat system enabled.
Good instructor. Enjoyed the video.