开发者

python program that scans a page for a specific combination of pixels?

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 开发者_如何学Pythonwouldn't know where to begin with this program.


Take a look at some basic pattern recognition and machine vision literature. In order to address your question considerably more detail is needed.

  1. Is the pattern a binary image, a grayscale image, or a color image?
  2. How often do you need to do this?
  3. Have you looked at the Python Imaging Library (PIL)?
  4. How big of an image do you want to search?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜