Hack Forums
[Python] Can Python recognize Images/Sprites? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Can Python recognize Images/Sprites? (/showthread.php?tid=5957103)



Can Python recognize Images/Sprites? - District - Apr 5, 2019

Can Python recognize Images/Sprites?

I'm curious as to whether this can be done, or if I will need a specific module. I have no experience with this but I'd really like to learn. Any recommendations would be great.


RE: Can Python recognize Images/Sprites? - Dark - Apr 5, 2019

Well.. an image is just a file... and a file is just data organized a certain way so it can be processed by other files...
So yes, python can recognize both of what you have requested, but the limitations of working with said devices would most likely require additional libraries...


RE: Can Python recognize Images/Sprites? - Oracle - Apr 5, 2019

I dont know what u mean by recognize but u can take a look at Pillow module check this out and tell us if its what u r looking for..


RE: Can Python recognize Images/Sprites? - Vassilios - Apr 5, 2019

(Apr 5, 2019 12:27 AM)I Am Phil Wrote:  Can Python recognize Images/Sprites?

I'm curious as to whether this can be done, or if I will need a specific module. I have no experience with this but I'd really like to learn. Any recommendations would be great.

Check out PyTesseract.


RE: Can Python recognize Images/Sprites? - lockhead - Apr 5, 2019

Of course Python recognizes Images, or rather there are modules that let you work with images.
The most prominent is PIL or Pillow, a fork from PIL https://pillow.readthedocs.io/en/stable/


RE: Can Python recognize Images/Sprites? - demarco - May 17, 2019

Yes actually python can. If the sprite that you expect to see is going to be the same few consistent sprites, you can use Opencv (open computer vision) to do a template match.

Since images are just 3D arrays, it computes the similarity between your image and the target image with some distance metric. If it's "close enough" it'll identify it.

So you'll just need numpy and opencv. dm me if you still need help.