Identifying filled circles in a scanned image

Claudio Grondi claudio.grondi at freenet.de
Thu Mar 30 18:35:48 EST 2006


Douglas Douglas wrote:
> Hi everybody.
> 
> I have a paper form that I scan into an image. My user fills some circles in
> this paper form using black ink. Every form has ten rows with five circles each
> and the user fills only one circle for each row.
> 
> I was wondering if I could use the Python Imaging Library to process these
> forms. I know the Image class is really powerful, but I can't think of a way of
> how to locate wich circle was filled.
> 
> Could anybody please give me an advice on this?
If you know the position of the circles in the picture (if you scanned 
properly you know it), you can test the mean darkness of the pixels 
within the circle (dark pixels: filled circle, bright pixels: not filled 
one). PIL allows access to any single pixel value (e.g. triple of values 
in case of RGB) in the picture, so, that you can test it against 
self-chosen threshold values.

It could be helpful to try to be a bit more specific about your problem 
(you have read the PIL tutorial, right?) if this above is not what you 
are looking for.

Claudio
> 
> Thanks.
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 



More information about the Python-list mailing list