Someone posed the question to me, if they could use their scanner for 
grading multiple choice tests.  This is for someone in a volunteer 
teaching position in one of the less advanced, poor countries, but they 
do have an image scanner available.  So I'm not a real expert in 
graphics manipulation and analysis, most of what I do in the way of 
graphics is generating print images for books, so I mostly use 
ImageMagick to help with some of the manipulations, but they are 
simple... crops, resizings, adding margins, and the like.

In thinking about the problem I see several steps, and several possibly 
applicable uses of ImageMagick.

Scan the answer sheet, which would be a bunch of pencil filled dots. 
The locations of the dots would be known.  Perhaps a preprinted dark 
stripe or two would be good for alignment?  Or even a surrounding box? 
Is there a way to detect, and then rotate and translate known objects to 
a fixed position, to compensate for misalignment of the papers in the 
scanner?  This seems to be the hardest thing, maybe because it is the 
part I know least about.

The scan could be done in color or greyscale, and then thresholded to 
eliminate erasures... the use of soft, very black pencils is the norm in 
those testing environments.

Then, knowing where the answer dots would be, one would check for the 
overall darkness of the enclosing region, and if it exceeds some 
threshold it is considered marked.

Once the set of marked boxes is known, the actual scoring, or grading, 
is straightforward logic.  The test creator would simply supply a list 
of "correct answer" boxes, possibly a weighting for certain "partially 
correct answer" boxes, and others would be assumed "incorrect answer" 
boxes.  Some rules about whether or not multiple boxes are allowed or 
required to be a "correct answer".  Multiple choice doesn't only mean 
one choice, always.  So the grading rules might be complex, but that is 
orthogonal to the "marked box detection", which is the part I'm 
concerned with here.

Does anyone have advice, or sample code, on how to approach the first 
part, the alignment? I think I understand enough to do the remaining 
parts, as well as understanding how to generate the form that would be 
printed to be the answer sheet.

Or maybe this is a solved problem, that I have missed in my searches.  I 
found lots of paid solutions to this sort of thing, but didn't find a 
freeware, or low-cost shareware, but maybe there was one hidden in the 
noise.  I'm not averse to using something besides ImageMagick if it 
exists as a canned solution, but if I need to create my own, then 
ImageMagick seems like a good starting point overall, and if I can 
figure out how to do the scan alignment.

Glenn
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to