我正在尝试编写一个 python 程序,它将拍摄屏幕截图,然后扫描图像以获取特定的像素或图案组合。例如:它拍摄网页的屏幕截图并扫描整个图像以获取 10X10 像素图案。如果它能记录屏幕上图像的 xy 位置那就太好了。
我在互联网上搜索了几个小时寻找解决方案,但一无所获。我只知道 python 的基础知识,不知道从哪里开始这个程序。
I'm trying to write a python program that will take a screen shot and then scan the image for a specific combination of pixels, or pattern. For example: it takes a screen shot of a web page and scans the whole image for a 10X10 pixel pattern. It would also be nice if it could record the x-y position of the image on the screen.
I searched the internet for hours for a solution but found nothing. I only know the basics of python and wouldn't know where to begin with this program.
发布评论
评论(1)
看一下一些基本的模式识别和机器视觉文献。为了解决您的问题,需要更多细节。
一个好的做法是查看 PIL,然后查看 卷积 in 傅里叶 空间(相对)快速定位目标区域。最后,良好的 Google 搜索是您的朋友。
Take a look at some basic pattern recognition and machine vision literature. In order to address your question considerably more detail is needed.
A good course of action is to look at PIL, and then look at convolution in Fourier space to localize the target regions (relatively) quickly. Finally, a good Google search is your friend.