For a medical student, questionnaire-based short term cross-sectional studies are shortcuts to research papers. A little more effort in study design and we can turn them into some kind of case-control study or at least publish it in a fairly reputed journal, a feat for someone at our level.
While designing one such cross sectional study, a friend wondered if we can use a scantron-like system on our questionnaire to automate data entry. This would save us time and increase accuracy, at least relatively. On each questionnaire, there could be bubbles to shade for multiple-choice questions, just like SAT or TOEFL. Once we get the questionnaire back from our respondents, we would shade out corresponding bubbles for the choices they made. Then, we would simply run it through a document feeding scanner (not a flatbed, that would be way more laborius) and finally, run it through a computer program that would look at the scanned file, see what bubbles are shaded, translate that into what choices the respondent made and make it available in a format friendly to SPSS or some other statistical package. Looking at shaded areas and recognizing them is called Optical Mark Recognition or OMR.
A little research and I found that there were no open-source or freeware/shareware OMR solutions available except one developed by Aaditeshwar Seth at Udai Waterloo Chapter. It was called the Udai OMR tool and developed for an Indian NGO initially, later made available for all NGO and non-profit use. The tool is written in Java and although it is not the most user-friendly piece of software around, it is the only free OMR software and it actually works. Once you make a questionnaire with the right spots to shade using the templates they provide on their website, you first scan an all-bubbles-shaded questionnaire for the program to recognize where to look for. Then, you assign variables and values to all sites recognized and finally, you start reading your forms. It reads one form at a time and writes the data to a text file. So for each page/form, you have to run the program again and it makes a new text file.
About 3-4 days of continuous fidgeting with this and then about a day to automate so that multiple pages can be read in a sequence and the data is handled and stored into a quick database and there, the next study I am part of is using OMR
Tags: cross-sectional study, OMR, optical mark recognition, research, survey
January 16, 2009 at 4:55 pm
I used this tool and it actually worked. But i want to read multiple scanned papers. do i have to write a java class that loops for several papers??
January 16, 2009 at 9:54 pm
Hi.. I wrote a VB.NET program that does that for me. I wasn’t too comfortable with java and didn’t want to spend the time to learn the relevant areas. If you want I can send you the code for what I have done in VB. It basically reads 2 pages of a questionnaire and deciphers them. then stores the data in an XML data file and exports on demand to csv. Interested?
August 27, 2009 at 8:00 pm
Dear Murtaza,
My name is Anup A.Pawaskar. I am currently pursuing B.E.( Computer Engineering) from the Don Bosco Institute of Technolgy, Kurla (W.), Mumbai.
I am currently studying in the final year . As a part of my final year project, my group plans to develop a “PC based mark reader.” for scanning and evaluating OMR sheets.
We plan to develop this as a GUI based open source software using a programming language such as VB.net.
We will be very thankful if you can send us some more information regarding this topic and the working of the OMR code developed by you.Thank you.
kindly reply at pawaskaranup@gmail.com
September 14, 2009 at 12:23 pm
HI Murtaza
could you send me the code in VB?
thank you
September 16, 2009 at 11:22 pm
Hi Murtaza,
Thanks for the great work. I am looking for the similar software. can u please send me the code.
Regards,
Ram
February 13, 2009 at 7:03 pm
Hi Murtaza,
Could you send me the code in vb?
Rajeev
February 14, 2009 at 2:22 pm
Thank you and I am still trying to download it! Have you done any surveys using the same?
February 14, 2009 at 3:51 pm
Yes, one is ongoing. A doctors study actually.. but it lets me get away without entering lots of data by hand. Let me know if you can’t download it and i will find another way to send it to you. Good luck.
February 14, 2009 at 9:20 pm
I got it. But now i need to put up with vb .net! I will try someone who knows at my end!
February 23, 2009 at 8:51 pm
Murtaza,
I am also very much interested in similar code.
Could you send me your code?
Also can somebody help me giving instructions on how to execute Udai OMR tool?
It is failing on my system with following error:
I am trying to execute it with Java 5 Update 12 and creation of template step is failing with error:
C:\Documents and Settings\Administrator\My Documents\tambe CET\software\OMRProj>
java -cp “dist/OMRProj.jar;dist/lib/jiu.jar” omrproj.ProcessTemplate 2circletif.
TIF
Exception in thread “main” java.lang.UnsupportedClassVersionError: Bad version n
umber in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
C:\Documents and Settings\Administrator\My Documents\tambe CET\software\OMRProj>
I tried with Java 6 Update 12. It is failing as well.
C:\Documents and Settings\Administrator\My Documents\software\OMRProj>
java -cp “dist/OMRProj.jar;dist/lib/jiu.jar” omrproj.ProcessTemplate
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 0
at omrproj.ProcessTemplate.main(ProcessTemplate.java:25)
C:\Documents and Settings\Administrator\My Documents\software\OMRProj>
java -cp “dist/OMRProj.jar;dist/lib/jiu.jar” omrproj.ProcessTemplate 2circle.gif
java.lang.NullPointerException
at omrproj.ImageUtil.readImage(ImageUtil.java:28)
at omrproj.ProcessTemplate.main(ProcessTemplate.java:27)
C:\Documents and Settings\Administrator\My Documents\software\OMRProj>
Thanks!
mihirnimbalkar [at] gmail [dot] com
February 24, 2009 at 6:44 pm
Hi Murtaza:
I would like to take a look at your code if you don’t mind as well. Is it hosted somewhere? Thanks.
February 24, 2009 at 10:23 pm
Mihir and David, just sent it to both of you. Let me know if I can be of help.
Murtaza
March 5, 2009 at 11:41 pm
Murtaza,
Could you send me your vb code as well?
Thanks!
April 1, 2009 at 11:50 am
Murtaza, could you please send me your vb code.
fperich@terra.cl
very much thanks
April 15, 2009 at 9:35 pm
Hi Murtaza, I was randomly browsing around and noticed that you’d actually extended the OMR software. I’d wanted to do this myself, but I’ve been awfully busy lately. It will be wonderful if you can publish your changes somewhere, or send them to me so that I can try to integrate them. Thanks again!
Adi
April 19, 2009 at 4:48 am
Reply to Mihir:
I can’t help you with your problems with java 5.
With Java 6 I experienced some problems too and found that:
- Input images must have a colordepth of 24 bits
- Input images must not exceed about 24M
- Program fails with jpeg, bmp and compressed tif, but works ok with uncompressed tif and png
- A4 images with a resolution of 72 dpi cause a crash of the program
November 4, 2009 at 9:34 pm
Hi Giovanni
Can u send me some sample images and the code
trytusar@gmail.com
April 23, 2009 at 10:35 pm
Hi Murtaza,
Thanks for your hard work…could you send me your VB code! I would really appreciate it.
Thanks!
May 22, 2009 at 5:55 pm
Hi Aditeshwar/Murtaza
I downloaded the source code of OMR Tool and tried to run it on the image provided with the download ie “2circle-org-colored-whole.gif”
I am getting the same error Mihir got.
java.lang.NullPointerException
at com.psl.omr.ImageUtil.readImage(ImageUtil.java:19)
at com.psl.omr.ProcessTemplate.main(ProcessTemplate.java:21)
Can you tell me, what’s wrong with the code or image ?
Thanks
May 22, 2009 at 6:03 pm
Giovanni,
how to check colordepth of an image ?
Thanks
July 2, 2009 at 3:48 am
Murtaza, could you send me the VB code, too?
Thanks!
July 9, 2009 at 12:11 am
Hi – could you send me the vb code as well. Thanks a lot!
July 28, 2009 at 5:37 pm
Murtaza,
Looks like you have some popular code. Can you send it to me as well?
Thanks!
August 10, 2009 at 1:22 pm
Hi could you send me the VB code as well
thanks!
August 21, 2009 at 3:30 pm
I want to make project in java n my project is optical mark recognisation…
m beginners in java,
somebody help me..
August 26, 2009 at 9:32 pm
Hi Murtaza, your code is exactly what i need, also i need it in .net =) .. Can you send it to me as well?
Thnks!
August 29, 2009 at 9:22 pm
Hi Murtaza, can you also provide me with the VB code. I am developing a grassroots survey project and I’m sure this will be a great help. I will also share my experiences with this project of mine. Thanks
August 29, 2009 at 10:31 pm
Just sent some of you a note with the code. Let me know if I can be of any further help. Good luck.
September 9, 2009 at 12:51 pm
Dear Murtaza,
Will appreciate your VB code. I am associated with educational institutions and am sure your efforts in OMR will be highly helpful and appreciated. Regards
October 7, 2009 at 8:32 pm
Hi Murtaza,
I would like to take a look at your code,could you send me your vb code as well?
thank you.
October 7, 2009 at 9:14 pm
It seems there has been quite some interest on this post and a lot of us would like to use this software. Can we put together a collaboration of sorts to extend this software (keeping it open source) and include perhaps a decent GUI and versions that can be run as a desktop application as well as automated?
Any one who is interested, please comment here and if we have a decent group of people put together, we can have a go at this. Udai (the original developer), your input on this will be welcome.
Thanks,
Murtaza
November 4, 2009 at 9:40 pm
Hi Murtaza
Can send VB code please!
trytusar@gmail.com
November 5, 2009 at 5:08 am
Murtaza,
That sounds like a great idea. I’m in! Can you drop me a line at kevin _at_ udm-tech.com?
Thanks!
Kevin
October 17, 2009 at 9:10 pm
Hi Murtaza, I would be interested in your vb code? Could you send it to me as well?
Thanks.
November 4, 2009 at 9:42 pm
If any one have successfully run the omr .
Plz send me the sample images & code .
trytusar@gmail.com
November 5, 2009 at 4:25 am
Hi Murtaza,
I would appreciate to get a copy your vb code about OMR.
Thanks.
November 7, 2009 at 10:02 pm
I ahve the follwing error
————————
00000…..
199:268:1464:1974
curr angle = 36.55695648693926
curr diag = 2123.831678829563
scaledtop: 39:53
scaledbot: 292:394
nummarks = 25739
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 50
at omrproj.ImageManipulation.filter(ImageManipulation.java:313)
i->50178:Found j->50179:Found j->51177:Found j->51178:Found j->51179:Found j->52177:Found j->52178:Found j->52179:Found j->53177:Found j->53178:Found j->53179:Found j->54177:Found j->54178:Found j->54179:Found j->55177:Found j->55178:Found j->55179:Found j->56177:Found j->56178:Found j->56179:Found j->57177:Found j->57178:Found j->57179:Found j->58177:Found j->58178:Found j->58179:Found j->59177:Found j->59178:Found j->59179:Found j->60177:Found j->60178:Found j->60179:Found j->61177:Found j->61178:Found j->61179:Found j->62177:Found j->62178:Found j->62179:Found j->63177:Found j->63178:Found j->63179:Found j->64177:Found j->64178:Found j->64179:Found j->65176:Found j->64175:Found j->63174:Found j->63173:Found j->63172:Found j->63171:
at omrproj.ImageManipulation.locateMarks(ImageManipulation.java:121)
at omrproj.ProcessTemplate.main(ProcessTemplate.java:34)
Java Result: 1
BUILD SUCCESSFUL (total time: 11 seconds)
=======================
Image: scan1.png
SIZE: 3.84MB
Width: 1700 pixels
Height:2338 pixels
Horizontal Resolution:199 dpi
Vertical Resolution:199 dpi
Bit Depth:24
Frame Count:1
trytusar@gmail.com
plz help me
November 7, 2009 at 10:14 pm
I think you need a higher resolution scan.