[OT] Want to recognize pictures using Python

Raymond Hettinger python at rcn.com
Wed Mar 6 12:12:23 EST 2002


Yes, PIL is a good choice.

It has primitives that solve your problem directly:

im.open() loads the image from almost any standard file format
im.split() will generate the three R,G,B color separations
im.resize() can shrink the images to 2 pixels by 2 pixels (a pixel per
quadrant)
im.getdata() will give you the element Python lists of the average quadrant
values


Raymond Hettinger

"F. GEIGER" <fgeiger at datec.at> wrote in message
news:a655p5$82t$1 at rex.ip-plus.net...
> I plan to buy a USB camera (hope, they are not too expensive) to play a
bit
> with image analyzing. Nothing sophisticated, just color recognition: I'd
> like to be able to tell whether the upper half of a picture has mostly the
> color green or red or the lower left quarter of an image is mostly blue
etc.
>
> I'm completely new to this topic, but really would like to do this in
> Python.
>
> Does anyone know of a package capable of providing such services? As said
> already, preferably for use in Python programs. PIL comes to my mind here.
> Is PIL the right one to start with in this regard?
>
>
> Thanks and best regards
> Franz GEIGER
>
>
>
>





More information about the Python-list mailing list