I just found out your video and even as a senior python and opencv developer I enjoyed watching all of it. Learning image processing through games is an excellent idea. Your presentation is clear and precise, I disagree with comments which states it is a bit boring. Your explanation level is just right for the beginners, not overexplaining things and exploding beginner's minds :D I wanted to take my time and display my support with a comment because you clearly dedicate your time and enthusiasm to create a helpful content for the community. You just earned a subscriber, keep up the good work my friend. p.s. About the not so perfect matching score, it is probably due to using jpeg format's lossy compression. After you saved those images as jpeg, they will have very small differences invisible to eye but clearly visible to code as in this example. You might prefer using PNG for lossless image saving or even BMP to get faster image write/read times (high fps).
I went through this tutorial but deviated by using png files instead. ultimately this makes the tutorial not work as written because the data was no longer in the expected format of CV_8U or CV_32F for the matchTemplate function. Just a warning for those that like to experiment lol. My understanding is that you can easily convert to the proper structure, but me, being a noob, did not find success with this. I saved my files to .jpg and moved on with the tutorial instead of getting hung up and everything worked.
I was JUST looking up info on this. Who knew it would be from the guy I subbed to from a few days ago. Keep up the good work your putting out unique and great content
This was something I was wondering about, Thank you. I don't think there are much interactive content like this out there. Glad to have found this channel. Thank you once again.
Hello, I would love to consume your content, I am hearing impaired, and I need subtitles to study through youtube, I am Brazilian, I could put it to translate automatically, but the translation of youtube is terrible. I know that it takes a lot of work to make subtitles, but I could always make it accessible for subscribers of the channel to be able to create subtitles in your videos (youtube function). With this initiative, at some point someone translates, and I can read ^^. My brother helped me to write this message.
Honestly, the quality of your videos and tutorials is simply astounding. I'm constantly amazed that you don't have hundreds of thousands of subscribers....yet!
I guess the "not perfect match" that you encountered is because of the jpg format which is a lossy compression format tha therefore some pixel colors are changed as the result of the compression. You could use PNG file for better results
hi i need some help! i got some errors trying to compile this here 7:51 and what else i need/program or anything that needs for this to work?? y got python with alot pip installed i got visual code and studio 2022, i got the img's in the same folder and everything but i got error everytime i cant get that black and white img
It would be great if you make a video about how to detect multiple objects and use the ai to recognise them while playing the game and it would be great to make it recognize the distances and range between objects
I'm on part #3 of your series so far but wanted to revisit this to say - you've been helping me get out of tutorial hell. Thank you so much Ben! You have an amazing teaching style; The documentation and comments along the way in both video & blog posts provides more clarity than other tutorials. Your channel is one of the best out there, please don't stop. Peace.
Here I was wondering how i was going to pull of object detection, then my man presents the answer to me just like that! Always appreciate you, never fail to expedite my thought process!
After going through the video, I have this doubt as to why is it only detecting one item, when the other ones on the original image is almost as similar to the cut out cabbage. Can this method detect multiple items which is the same and mark them as such? Instead of just pin pointing at only one?
Yes, good catch. The very next video is going to be how to detect multiple items. It's only getting one item here because we're using minMaxLoc(), and you need to approach the result differently to pull out multiple matches.
It is using the needle screenshot as a reference and then drawing a rectangle around the object with the best match. While the other cabbages look almost exactly the same, that specific one is the best match.
I got the whole Code just like u but i get this error. Please help me! error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'rectangle' > Overload resolution failed: > - Can't parse 'pt2'. Sequence item with index 0 has a wrong type > - Can't parse 'pt2'. Sequence item with index 0 has a wrong type > - argument for rectangle() given by name ('color') and position (3) > - argument for rectangle() given by name ('color') and position (3)
I got this error. But it was an error in this line: wrong => bottom_right = (top_left[0], needle_w, top_left[1] + needle_h) correct => bottom_right = (top_left[0] + needle_w, top_left[1] + needle_h) i'm also on OpenCV(4.6.0)
Hi there Ben! I stumbled upon your channel because I wanna learn how to code. I watched this video to see if it interests me though I don't have any knowledge yet. But boy! You explain things so well that I get the idea of what you are doing. I am glad I've found your channel. +1 sub!
This should be doable in both Java and JS, assuming they have access to the same OpenCV functions as Python. You'll obviously need to spend some time in the documentation figuring out the names/parameters/returns values they use. I haven't tried it myself.
Awesome tutorial! I have an issue. I have tried with other immages and when I run the script I get this error: (-215:Assertion failed) (depth == CV_8U || depth == CV_32F) && type == _templ.type() && _img.dims()
Thanks! That error usually means the image you are passing into matchTemplate() isn't a valid OpenCV image. Check the file path you're passing into imread() and make sure it's correct.
I have installed opencv -python 4.5.1.48 , I copied your code and just change the picture names, the files are in same projects folder, and I got the same error he got , -215 assertion failed
@@ericsein I solved it. You just have to change im.READ.UNCHANGED to 1 for unchanged or 0 for grayscale. There is a list on the cV side wich number what represents
Hi, congratulations on your channel, your content is very good. I have an idea for you, I always wanted to learn how to make the mouse and keyboard work in the minimized game window (background) and that I can use the computer while the script runs. I know of a library that can be used, but I have no idea how to make it work: github.com/SerpentAI/SerpentAI/tree/dev/serpent
Hi, glad you like it! Thanks for letting me know what you'd like to see. A few others have requested a video on that, too. And that SerpentAI repo is good, I've referenced it a few times.
I keep getting error "argument for rectangle() given by name ('color') and position (3)" and im getting hopeless here is my code: import cv2 as cv import numpy as np wave_img = cv.imread('wave.jpg', cv.IMREAD_UNCHANGED) minion2_img = cv.imread('minion2.jpg', cv.IMREAD_UNCHANGED) result = cv.matchTemplate(wave_img, minion2_img, cv.TM_CCOEFF_NORMED) min_val, max_val, min_loc, max_loc = cv.minMaxLoc(result) print('Best match top left position: %s' % str(max_loc)) print('Best match confidence: %s' % str(max_val)) threshold = 0.8 if max_val >= threshold: print('Found the minion')
Hi, don't be hopeless, I found your error! You have color=('0, 255, 0') but that should be color=(0, 255, 0)... get rid of the quotes because that argument shouldn't be a string, it should be a tuple of three integers.
Hello,thank you for the great tutorial,I just have one problem,I'm trying to run this code on screenshot of some webpage and my main goal is to detect all of the logos on that page,but the problem is the position of rectangle is way far from the logo i want to put it on,can you help me please?
That's strange. It might be that your needle image is not the same size as the logos that are on the webpage? matchTemplate() doesn't do any scaling adjustments for you.
Open CV is great no denying but the library is just huge , it's full of functions to do all sorts of thing , this is a great advantage(keeps ur code short and neat) and disadvantage ( I really find it difficult to remember these lol) like think about it for a sec, there is function for like literally everything and parameters which makes no sense for newbies (like me myself), but nevertheless great video mate , really liked how u walked through the documentation (encouraging viewers to explore) and explained as much as possible while writing the code and made the video as short as it possibly could have been u certainly deserve more subs and recognition mate :)
Hi there Ben, stumbled on this channel and this language by chance, I have a small issue when I use imread for the haystack image it works fine but for the needle image it gives an error, the error is this: syntaxerror: (unicode error) 'unicodeescape' codec can't decode bytes in position 43-44: malformed \N character escape any idea why? EDIT: No wait I figured it out.... the path was messed up, dunno why it automatically uses "\" instead of "/" on windows... now I know that everytime I have to give a path I have to manually change all the slashes.... -.-"
I love your videos. they make it more fun to learn to code. thank you very much for taking the time to make these, especially into easily digestible chunks in a playlist. youre awesome!
One question: It's possible extract data from finded object with opencv? I want find images in the screen and then convert to json, like: [{img: 1, title: 'test'}, {img: 2, title: "nice"}] Thanks for you videos, awesome!
pip install opencv-python does not work. i get error; ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none) ERROR: No matching distribution found for opencv-python upgrading pip doesnt fix it because pip is already latest version. please help
Hi. I try something similar but already stuck 😱 I using visual studio 2019. But I have a quite big problem import difrent librarys. Maybe you could explain how to import and where to put files and how to have the links and path. How to set up a project. It seams like many using other editors. Maybe it's just hard to use visual studio.
Hi there, this is the best channel about this content. I have watched your Videos about Python at least 20 times each! I am a beginner and was able to follow your explanation and even to costumize the code for my needs! Really amazing!
Sup bro does Albion have any protection against emulated clicks? In other words do your have to use something like Arduino Leonardo to emulate a mouse or it works just as it is?
hi i need some help! i got some errors trying to compile this here 7:51 and what else i need/program or anything that needs for this to work?? y got python with alot pip installed i got visual code and studio 2022, i got the img's in the same folder and everything but i got error everytime i cant get that black and white img
I was so excited to follow this tutorial and learn stuff on the way, but as soon as I received the first error that I knew I couldn't fix, I joined your discord and to my dissapointment there was no activity going on and no one gives a response when you ask for help :(
I am wondering why the needle isn´t found anymore when I am using a perfect cut out needl image with alpha channel. with just a rectangle cutout it works.
this is able to find a scrap of a complete image but what about same programming but searching on active game window for the result it will work or does needs different programation method?
Thanks for the tutorials, I like all of them, it's much more fun to learn coding/new libraries if the examples are interesting topics too in this case, games! keep up the good work, looking forward to future tutorials, OpenCV looks awesome.
I do not know it did not help me, and I say that I am not an excellent programmer and I do not understand English either, but the thing is that I wanted to identify a tree in rune scape hahahaha and I do not identify it or mark it I will continue watching more videos of this to see if I find the code I need
Dear Ben, amazing video! One quick question: the results don't show the whole picture, but only the top left area of the original (I saw this is the same for you in this video). My screen is 1920x1080 And I search an image around 1900,1000, however, this part of the picture is not in the result (and therefore also not in the max_loc and max_value). Have you got any clue how to solve this? Huge thankyou in advance, kind regards!
Hey i recently redid this whole tutorial using YoloV4. Do you think you could remake the series with OpenCV and YoloV4 for games? I think viewers would find it super helpful as it was pretty challenging to setup YoloV4 with opencv in python.
I don't know about remaking this whole series, but yeah I want to do some OpenCV YOLOv4 tutorials eventually. It's definitely a more advanced topic. Nice job getting it setup for yourself!
You can start in an empty folder with a blank main.py. The folders you see in my project are .vscode, which is just generated by VSCode when you work in it, and venv which is just my virtual environment folder. You don't need to setup a virtual environment if you don't know what that is, and if you do use one you don't need to store the folder here. I use virtual environments to keep my projects separated.
Si no lo tienes, debes instalarlo. pip install De cualquier modo puedes revisarlo escribiendo: pip show . Otra forma de hacer lo mismo, pero menos elegante, es listarlos en linux y filtrarlo escribiendo: pip list | grep y revisar qué módulos tienes instalado. De cualquier modo, debes revisarlo porque puede ser que estés en un entorno virtual. Google te puede ayudar.
I just found out your video and even as a senior python and opencv developer I enjoyed watching all of it. Learning image processing through games is an excellent idea. Your presentation is clear and precise, I disagree with comments which states it is a bit boring. Your explanation level is just right for the beginners, not overexplaining things and exploding beginner's minds :D
I wanted to take my time and display my support with a comment because you clearly dedicate your time and enthusiasm to create a helpful content for the community. You just earned a subscriber, keep up the good work my friend.
p.s. About the not so perfect matching score, it is probably due to using jpeg format's lossy compression. After you saved those images as jpeg, they will have very small differences invisible to eye but clearly visible to code as in this example. You might prefer using PNG for lossless image saving or even BMP to get faster image write/read times (high fps).
second this by far the best explanation i have came across, zoomed in code, well explained step by step
I went through this tutorial but deviated by using png files instead. ultimately this makes the tutorial not work as written because the data was no longer in the expected format of CV_8U or CV_32F for the matchTemplate function. Just a warning for those that like to experiment lol. My understanding is that you can easily convert to the proper structure, but me, being a noob, did not find success with this. I saved my files to .jpg and moved on with the tutorial instead of getting hung up and everything worked.
I was JUST looking up info on this. Who knew it would be from the guy I subbed to from a few days ago. Keep up the good work your putting out unique and great content
Thanks means a lot!
Thanks alot for this video! Do you think you can cover how to find an object and also detect when it is gone in a video game?
Trueeee
@Carroll Horsely stop scamming people
Exact same here! What an underrated channel
This was something I was wondering about,
Thank you. I don't think there are much interactive content like this out there. Glad to have found this channel.
Thank you once again.
Glad you like it!
Hello, I would love to consume your content, I am hearing impaired, and I need subtitles to study through youtube, I am Brazilian, I could put it to translate automatically, but the translation of youtube is terrible.
I know that it takes a lot of work to make subtitles, but I could always make it accessible for subscribers of the channel to be able to create subtitles in your videos (youtube function). With this initiative, at some point someone translates, and I can read ^^.
My brother helped me to write this message.
Honestly, the quality of your videos and tutorials is simply astounding. I'm constantly amazed that you don't have hundreds of thousands of subscribers....yet!
Bruh ty so much! You save so much time for as !
You're welcome!
This channel is God sent. Keep going and you'll grow very fast
I guess the "not perfect match" that you encountered is because of the jpg format which is a lossy compression format tha therefore some pixel colors are changed as the result of the compression. You could use PNG file for better results
hi i need some help! i got some errors trying to compile this here 7:51 and what else i need/program or anything that needs for this to work?? y got python with alot pip installed i got visual code and studio 2022, i got the img's in the same folder and everything but i got error everytime i cant get that black and white img
GOLD CONTENT
thanks , i just needed something like this to complete my project
you earned a new subscriber :D
Glad you like it! Good luck on your project.
It would be great if you make a video about how to detect multiple objects and use the ai to recognise them while playing the game and it would be great to make it recognize the distances and range between objects
Yes I'll be doing that in the coming videos. I've got at least 4 more planned for this series.
I'm on part #3 of your series so far but wanted to revisit this to say - you've been helping me get out of tutorial hell. Thank you so much Ben! You have an amazing teaching style; The documentation and comments along the way in both video & blog posts provides more clarity than other tutorials. Your channel is one of the best out there, please don't stop. Peace.
Thanks man!
YES !! This is going to be very interesting ! =D
U r gr8
absolutely amazing content !
Nice to see you taking it to the next level
bro what vscode theme u using it's clean af
Here I was wondering how i was going to pull of object detection, then my man presents the answer to me just like that! Always appreciate you, never fail to expedite my thought process!
After going through the video, I have this doubt as to why is it only detecting one item, when the other ones on the original image is almost as similar to the cut out cabbage. Can this method detect multiple items which is the same and mark them as such? Instead of just pin pointing at only one?
Yes, good catch. The very next video is going to be how to detect multiple items. It's only getting one item here because we're using minMaxLoc(), and you need to approach the result differently to pull out multiple matches.
Aha, like widening the scope a bit and allowing in more options to come through! Great. Thank you again. ^^
It is using the needle screenshot as a reference and then drawing a rectangle around the object with the best match. While the other cabbages look almost exactly the same, that specific one is the best match.
print("Hello from Brazil")
Thx bro
I got the whole Code just like u but i get this error.
Please help me!
error: OpenCV(4.6.0) :-1: error: (-5:Bad argument) in function 'rectangle'
> Overload resolution failed:
> - Can't parse 'pt2'. Sequence item with index 0 has a wrong type
> - Can't parse 'pt2'. Sequence item with index 0 has a wrong type
> - argument for rectangle() given by name ('color') and position (3)
> - argument for rectangle() given by name ('color') and position (3)
I got this error. But it was an error in this line:
wrong => bottom_right = (top_left[0], needle_w, top_left[1] + needle_h)
correct => bottom_right = (top_left[0] + needle_w, top_left[1] + needle_h)
i'm also on OpenCV(4.6.0)
this guy should get more subscribers!
thank you for the great contents
Thanks!
Hi there Ben!
I stumbled upon your channel because I wanna learn how to code.
I watched this video to see if it interests me though I don't have any knowledge yet. But boy! You explain things so well that I get the idea of what you are doing.
I am glad I've found your channel.
+1 sub!
Awesome, always happy to see new people giving code a try! Thanks for subscribing.
Nice this verry useful for me 👍
How feasible is following this tutorial using java opencv and java robot?
This should be doable in both Java and JS, assuming they have access to the same OpenCV functions as Python. You'll obviously need to spend some time in the documentation figuring out the names/parameters/returns values they use. I haven't tried it myself.
Awesome tutorial!
I have an issue. I have tried with other immages and when I run the script I get this error: (-215:Assertion failed) (depth == CV_8U || depth == CV_32F) && type == _templ.type() && _img.dims()
Thanks! That error usually means the image you are passing into matchTemplate() isn't a valid OpenCV image. Check the file path you're passing into imread() and make sure it's correct.
@@LearnCodeByGaming Thanks, I will check! 🙂
I have installed opencv -python 4.5.1.48 , I copied your code and just change the picture names, the files are in same projects folder, and I got the same error he got , -215 assertion failed
Also got this error, the path to the image was wrong.
@@ericsein I solved it. You just have to change im.READ.UNCHANGED to 1 for unchanged or 0 for grayscale. There is a list on the cV side wich number what represents
Whoever disliked this needs their head checking, this was one of the best programming tutorials I have seen yet.
Hi, congratulations on your channel, your content is very good. I have an idea for you, I always wanted to learn how to make the mouse and keyboard work in the minimized game window (background) and that I can use the computer while the script runs. I know of a library that can be used, but I have no idea how to make it work: github.com/SerpentAI/SerpentAI/tree/dev/serpent
Hi, glad you like it! Thanks for letting me know what you'd like to see. A few others have requested a video on that, too. And that SerpentAI repo is good, I've referenced it a few times.
@@LearnCodeByGaming
this guy is the richard hendricks in real life
Thank you for your tutorials!Really appreciate it :)
You're welcome, glad you like them!
I keep getting error "argument for rectangle() given by name ('color') and position (3)" and im getting hopeless
here is my code:
import cv2 as cv
import numpy as np
wave_img = cv.imread('wave.jpg', cv.IMREAD_UNCHANGED)
minion2_img = cv.imread('minion2.jpg', cv.IMREAD_UNCHANGED)
result = cv.matchTemplate(wave_img, minion2_img, cv.TM_CCOEFF_NORMED)
min_val, max_val, min_loc, max_loc = cv.minMaxLoc(result)
print('Best match top left position: %s' % str(max_loc))
print('Best match confidence: %s' % str(max_val))
threshold = 0.8
if max_val >= threshold:
print('Found the minion')
minion_w = minion2_img.shape[1]
minion_h = minion2_img.shape[0]
top_left = max_loc
bottom_right = (top_left[0] + minion_w, top_left[1] + minion_h)
cv.rectangle(wave_img, top_left, bottom_right,
color=('0, 255, 0'), thickness=2, lineType=cv.LINE_4)
cv.imshow('Result', wave_img)
cv.waitKey()
else:
print('Dang, this minion is invisible')
Hi, don't be hopeless, I found your error! You have color=('0, 255, 0') but that should be color=(0, 255, 0)... get rid of the quotes because that argument shouldn't be a string, it should be a tuple of three integers.
@@LearnCodeByGaming Oh my... such a simple mistake ! Thank you sooo much!! Ur videos are great im binge watching them rn 🤣
I just did the sentdex opencv tutorial so this is perfect
Awesome hope it's helpful for you
@@LearnCodeByGaming Stardew valley is about to get more interesting.
why this guy don't have above 100k subs.. he explained it so good. +1
Great content as always!
Thanks Shane!
Hello,thank you for the great tutorial,I just have one problem,I'm trying to run this code on screenshot of some webpage and my main goal is to detect all of the logos on that page,but the problem is the position of rectangle is way far from the logo i want to put it on,can you help me please?
That's strange. It might be that your needle image is not the same size as the logos that are on the webpage? matchTemplate() doesn't do any scaling adjustments for you.
The non-perfect match is likely due to lossy jpeg compression
Open CV is great no denying but the library is just huge , it's full of functions to do all
sorts of thing , this is a great advantage(keeps ur code short and neat) and disadvantage
( I really find it difficult to remember these lol)
like think about it for a sec, there is function for like literally everything and parameters which makes no sense
for newbies (like me myself), but nevertheless great video mate , really liked how u walked through
the documentation (encouraging viewers to explore) and explained as much as possible while writing
the code and made the video as short as it possibly could have been u certainly deserve more subs
and recognition mate :)
Thank you for this. Keep em coming :)
this channel is so much underrated.Very good content bro,keep it up
Nice video!
Good for starting programming a mmorpg bot!
Hi there Ben, stumbled on this channel and this language by chance, I have a small issue when I use imread for the haystack image it works fine but for the needle image it gives an error, the error is this:
syntaxerror: (unicode error) 'unicodeescape' codec can't decode bytes in position 43-44: malformed \N character escape
any idea why?
EDIT:
No wait I figured it out.... the path was messed up, dunno why it automatically uses "\" instead of "/" on windows... now I know that everytime I have to give a path I have to manually change all the slashes.... -.-"
I love your videos. they make it more fun to learn to code. thank you very much for taking the time to make these, especially into easily digestible chunks in a playlist. youre awesome!
One question:
It's possible extract data from finded object with opencv?
I want find images in the screen and then convert to json, like:
[{img: 1, title: 'test'}, {img: 2, title: "nice"}]
Thanks for you videos, awesome!
pip install opencv-python does not work. i get error;
ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none)
ERROR: No matching distribution found for opencv-python
upgrading pip doesnt fix it because pip is already latest version. please help
Thank you for sharing your knowledge. Greetings from Brazil.
Hi.
I try something similar but already stuck 😱
I using visual studio 2019. But I have a quite big problem import difrent librarys.
Maybe you could explain how to import and where to put files and how to have the links and path.
How to set up a project.
It seams like many using other editors. Maybe it's just hard to use visual studio.
Anyone else having issues with cv2 not auto populating module functions?
Numpy auto populates... But after I write cv2. Nothing shows up.
Hi, can you do one for face recognition that is completely openCV?
Hi there, this is the best channel about this content. I have watched your Videos about Python at least 20 times each! I am a beginner and was able to follow your explanation and even to costumize the code for my needs! Really amazing!
Cannot find reference 'minMaxLoc' in '_init_.py' GUYS PLS HELP
Thank u very much for this video. It was Informative and engaging. Makes me want to learn more about OpenCV!
Amazing videos!thankyou so much sir!! Much praise for your work
Thank you for your efforts to make this video. What a clear explanation !!!
Underrated RUclipsr. Great content!
Thank you!
hey, thanks for the tutorial. will this work for 3d games with some modification or will 3d games be a totally different issue?
I dont know ant about programming/coding and it looks scary as well as understandable to me 😭😭😭 im also terrible at math
This is my new favorite channel, thanks for good content ^_^
Sup bro does Albion have any protection against emulated clicks? In other words do your have to use something like Arduino Leonardo to emulate a mouse or it works just as it is?
somehow template matching works really bad for me. Especially with text GUI elements
which softwarre ur using for this coding material pls can u provide me link'
nice bro
hi i need some help! i got some errors trying to compile this here 7:51 and what else i need/program or anything that needs for this to work?? y got python with alot pip installed i got visual code and studio 2022, i got the img's in the same folder and everything but i got error everytime i cant get that black and white img
Great video. How did you manage that u get to see a complete documentation for every opencv function? Thx alot!
Random tip for viewers, don't forget to pick high quality for video
Thanks a lot man , This Video really helped me start using openCV
Richard Hendricks is now creating Bots on RUclips after his app Pied Piper.
does computer vision use alot of system resources while its running?
love you so much, I love this course, you just got a Chinese Subscriber!!!
I was so excited to follow this tutorial and learn stuff on the way, but as soon as I received the first error that I knew I couldn't fix, I joined your discord and to my dissapointment there was no activity going on and no one gives a response when you ask for help :(
Thank you so much. Your explanations are so clear. I learn a lot from you. You are the best!
I am wondering why the needle isn´t found anymore when I am using a perfect cut out needl image with alpha channel. with just a rectangle cutout it works.
I wonder which AutoIT or Python would be more suitable for this job. And why?
Let's say he wants it to determine which player won a duel in some game based on the uploaded video. Is this possible?
You are great bruh I'd literally crown u as king.
This width and height order is so confusing. A point is given as (x,y) but the dimensions of an image the other way round.
this is able to find a scrap of a complete image but what about same programming but searching on active game window for the result it will work or does needs different programation method?
what about if source image orientation ? it will still work if input image tilted 45 degreee?
Thanks for the tutorials, I like all of them, it's much more fun to learn coding/new libraries if the examples are interesting topics too in this case, games! keep up the good work, looking forward to future tutorials, OpenCV looks awesome.
Yes, that's the idea of my channel! Thanks!
Hey man nice video. I was hoping if a make video on playing gta 5 using hand recognition and open cv. Thanks 👍
Love the videos dude! Looking forward to the next one! I was getting an error with this code, Had to convert both variables to greyscale?
That's interesting. Maybe something to do with the format of the image files you used? Glad you like the videos!
I had the same error. I was using PNGs but it worked well when I switched to JPGs
If you could make a video about recognizing images in videos It would be great!
Yes, that's coming up soon! Thanks for watching.
sooo gooood
can you creat a video about auto play game with opencv? Thanks
I do not know it did not help me, and I say that I am not an excellent programmer and I do not understand English either, but the thing is that I wanted to identify a tree in rune scape hahahaha and I do not identify it or mark it
I will continue watching more videos of this to see if I find the code I need
Can I give it few needle images, make CV learn the pattern, and then tell it to search for this pattern in haystack image ?
how about if we detect object then we go to that object using wasd or arrow key till near that object?
Thank you for the video :)
That s very interesting
Dear Ben, amazing video! One quick question: the results don't show the whole picture, but only the top left area of the original (I saw this is the same for you in this video). My screen is 1920x1080 And I search an image around 1900,1000, however, this part of the picture is not in the result (and therefore also not in the max_loc and max_value). Have you got any clue how to solve this? Huge thankyou in advance, kind regards!
Hi Ben, same issue occurs to me.. please help!
Does these bots are visible in game logs? This does not affect game files, so it should not be illegal in games, right?
Im not sure why but i had to change _h and _w to .shape in order to make it work otherwise i got a errormessage
Hey man just want to let you know that I'm so happy right now as a gamer and python programmer :) You just earned a new subscriber!
Glad other people like this stuff too!
I got the next error:
result = cv.matchTemplate(haystack_img, needle_img, cv.TM_CCOEFF_NORMED)
cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:1164: error: (-215:Assertion failed) (depth == CV_8U || depth == CV_32F) && type == _templ.type() && _img.dims()
Please do tutorial for a smart bot : picture recognition clicker
You did a great job at making this easy to understand, I followed it all the way through and it worked, Thank you
which is the vesion of python? i can't install opencv... /;
why don't you destroy allwindows() and release the memory?
Hey i recently redid this whole tutorial using YoloV4. Do you think you could remake the series with OpenCV and YoloV4 for games? I think viewers would find it super helpful as it was pretty challenging to setup YoloV4 with opencv in python.
I don't know about remaking this whole series, but yeah I want to do some OpenCV YOLOv4 tutorials eventually. It's definitely a more advanced topic. Nice job getting it setup for yourself!
How does it help when you don't show us how you even began your project with the beginning folders?
You can start in an empty folder with a blank main.py. The folders you see in my project are .vscode, which is just generated by VSCode when you work in it, and venv which is just my virtual environment folder. You don't need to setup a virtual environment if you don't know what that is, and if you do use one you don't need to store the folder here. I use virtual environments to keep my projects separated.
import win32gui, win32ui, win32con
ModuleNotFoundError: No module named 'win32gui'
AYUDAAAA
HELPMEEEE
Si no lo tienes, debes instalarlo.
pip install
De cualquier modo puedes revisarlo escribiendo: pip show . Otra forma de hacer lo mismo, pero menos elegante, es listarlos en linux y filtrarlo escribiendo: pip list | grep y revisar qué módulos tienes instalado. De cualquier modo, debes revisarlo porque puede ser que estés en un entorno virtual. Google te puede ayudar.