
Automatically grading multiple choice exams from photos using Python and OpenCV - zionsrogue
http://www.pyimagesearch.com/2016/10/03/bubble-sheet-multiple-choice-scanner-and-test-grader-using-omr-python-and-opencv/
======
Houshalter
There's an even cooler thing you can do with automatic grading. I saw this
idea on another HN comment once. The computer can figure out the answers
without programming them in. Or it can figure out mistakes in the real answer
key.

The idea is that answers are highly correlated. Better students are more
likely to get all answers correct, worse students are more likely to make
mistakes. So if you do something like PCA on all the students' answers, the
first dimension will represent the quality of the student. And the weights
will represent which answers are correct.

~~~
tgb
Interesting, but how would PCA work with a discretely-valued, unordered,
metric-less data like multiple choice answers? (Actual question, not snark, I
only know the basics of PCA.)

~~~
Houshalter
I would imagine you would assign each multiple choice answer a value of 0 or
1, based on whether they selected that answer or not. So if there was just one
question, and the student answered 'A', it would produce a vector like [1, 0,
0, 0].

In fact I believe there are similar but better algorithms than PCA for
handling mutually exclusive binary variables. I just don't know what they are
called.

------
coredog64
The author has been pretty good at documenting a number of simple projects
that can start you off in OpenCV.

Disclaimer: I bought his eBook bundle.

~~~
mountaineer22
How are the eBooks? Do you like them?

~~~
coredog64
I am very happy with them. It wasn't full of fluff but was very targeted. I
have the prior edition, so at some point I'll have to go back and buy the
basic package again to upgrade.

------
honkhonkpants
So back in the Bronze Age my teacher would collect all the scantron cards --
which by the way can already be automatically graded; that is the entire point
of the scantron -- and put them on the overhead projector with the correct
answers masked out. Overhead projector was more than bright enough to shine
through the paper card. The teacher could easily grade the entire class in a
minute or two, no cameras or computers needed.

~~~
coredog64
I had a biology teacher who would put them into a plywood form and drive a
nail through a giant stack of papers.

~~~
honkhonkpants
I don't clearly understand how that is effective, but it sounds like fun, and
a good way to impress kids.

~~~
coredog64
She would drive nails through the forms and then count where the marked answer
matched the hole. I suspect she got her husband to help too.

It was easy for the students to double check that their tests were marked
correctly as well.

------
epalmer
This is pretty cool. I am getting ready to embark on camera projects with a
Raspberry Pi 3 and saw this project. Since I will be using python and OpenCV
anyway this is a motivator.

~~~
zionsrogue
Combining the Raspberry Pi + Python + OpenCV is a lot of fun. If you feel like
sharing the details on your project I might be able to point you in the right
direction.

~~~
epalmer
You wrote the ebook right? I think I'll get it.

~~~
zionsrogue
Correct, I am the author of Practical Python and OpenCV.

------
swyphcosmo
Do you take off points if they don't use a #2 pencil?

------
mandudebruh
Here's a similar service: [http://bubblevision.org/](http://bubblevision.org/)

~~~
honkhonkpants
If only I had Adobe Flash, I could learn all about this!

~~~
dylz
VLC -> open network ->
[http://embed.wistia.com/deliveries/5bed39f586d77c4436f569d16...](http://embed.wistia.com/deliveries/5bed39f586d77c4436f569d164e910dbe75eb739.bin)
if you actually want to

------
tropo
Processing well-known forms (AP, PSAT, SAT, etc.) would be sweet. The one for
AP is 4 pages in color, but one might have a greyscale printer or decide to
print only one page of it.

------
jrcii
I just need 20 years to modify this to grade my short and long answer tests
and I'll be sitting pretty.

~~~
teach
If Gradescope[0] starts allowing public signups it might be sooner than you
think....

[0] [https://blogs.nvidia.com/blog/2016/09/02/gradescope-
brings-a...](https://blogs.nvidia.com/blog/2016/09/02/gradescope-brings-ai-to-
grading/)

