473,513 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Identifying filled circles in a scanned image

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?

Thanks.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Mar 30 '06 #1
3 2813
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

Mar 30 '06 #2
Douglas Douglas schrieb:
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?


Depends on how much time you have... Google for "Hough Transformation",
or look it up in a text book on image processing. That's a very general
method for finding lines and circles. If you know where the circles
are, comparing the average grey value inside the circle with the
average of the environment should tell you if it's filled or not.

Mar 30 '06 #3

Douglas Douglas wrote:
The problem is that when the scanner takes the pages it
doesn't put it in the same exact position in its bed. There's not a lot of
difference, but there's a little.


Your forms should have some reference registration marks or targets in
opposite corners. Find these first, then you should be able to
interpolate pixel positions from there, using a 2D trans/rotational
transform.

-- Paul

Mar 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1539
by: Joe | last post by:
Anybody ever figure out how to use a web page UI to allow someone to upload an image from a scanner? I understand you can scan a document, save it on the hard drive - then via the web UI you can...
7
10600
by: Don Riesbeck Jr. | last post by:
I'm working on an application (OEM) using C# that utilizes input from a keyboard, and USB Barcode Scanner. The scanner is a HID Keyboard device, and input from it is sent to the system as if it...
0
904
by: Paul K | last post by:
I am busy doing a small application to get myself familiar with asp.net, and I have run into a problem. I have a list of anchors created with a repeater. I need to uniquely identify each anchor...
1
3425
by: RAB | last post by:
I want to scan documents and then store them in an Access database. What file type would I want to scan the document as? Would I want to store the document file in the database or a path to the...
0
1554
by: Gilgamesh | last post by:
Hi, I have some very limited knowledge of web development but I have an imagemap in which I want to be able to display a small yellow circle at certain pre-define locations. When the user moves...
0
1147
by: asif siraj | last post by:
we want to check the scanned answer sheet through omr.we need a help for how we can read the shadded area. plz some buddy help us. *** Sent via Developersdex http://www.developersdex.com ***
6
7586
by: Frank Rizzo | last post by:
I have an interesting problem. I have a directory of image files. However, none of the files have an extension. I need to figure out what type if image it is and attach an extension to the file. ...
0
1799
by: manjum | last post by:
I am a newb to Java imaging. Can anybody give some sample code or idea on how to capture data from an image. My image is a scanned OMR sheet and I want to read the contents text input as well as...
1
1351
by: Anoosha | last post by:
Need an urgent help! I use HP 8300 Scanjet to scan a page. The page consists of a barcode at the top of the page, some text information at the middle of the page and a SIGNATURE inside a square...
0
7158
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7380
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7523
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5683
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5085
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.