I work for an institution that has to process a very large number of multiple-choice answer forms on a regular basis. We have adopted a commercial solution that is very expensive, plus we've begun bending to the open-source side of things --- I'm helping with a massive LaTeX rehaul of word-processed test forms.

A Google search and my basic instincts don't show a clear winner. Subjective, but here I go: what is the best free software optical mark recognition solution?

One requirement is that the software must incorporate a utility for flagging ambiguous marks for a human to identify manually. If it has a simple image/mark recognition API as well, that would be lovely.

  • Probably should be CW, but I can't set it.
    – Simon Kuang
    Jun 26, 2015 at 18:58
  • 1
    Does the OS matter? For Windows, the question might already be asked here
    – Tymric
    Jun 27, 2015 at 8:39
  • Did you try any of these? en.wikipedia.org/wiki/Optical_mark_recognition#Open_source
    – Nemo
    Oct 8, 2015 at 16:38
  • You are still using dead trees?
    – Mawg
    Jun 28, 2016 at 6:57
  • @Mawg: Dead trees are certainly a good thing for certifications etc. E.g. I'd not like to have my ISTQB certification done on a PC. Paper and pencil are really good. You can read it at sunlight, it has an awesome resolution and you can rearrange and mark papers in a way that has not been adopted by PCs yet. Jun 28, 2016 at 8:19

2 Answers 2


It sounds similar to this question and like you need to check out SDAPS which is an acronym for "Scripts for data acquisition with paper based surveys".

The workflow is depicted here: sdaps workflow

The feature list is impressive:

  • Open Source Software; use and modify it as you like (subject to the GPLv3+/LPPLv1.3c+) Optical mark recognition (OMR) from scanned data Imports most formats including PDF and even photographs (version 1.1.7)

  • OpenDocument text (ODT) for creating questionnaires

  • LaTeX class for creating questionnaires Supports any paper size Multipage questionnaires, both simplex and duplex printing (up to 9999 pages with "code128" and "qr" style) Different kinds of questions:

    • A mark type question (a score)
    • A choice of many, that may also include freeform fields
    • Freeform fields
    • The LaTeX class also supports more compact matrix configurations for these.
  • Creation of PDF reports for printout

    • Also supports creating reports of only partial result sets with arbitrary filters
  • Export of data to CSV files for further analysis (excluding image data)

  • Import of additional results from other sources. With this it is for example possible to merge data aquired via a webpage at a later point. A GUI application to check the recognition and correct errors Written in Python using a modular and extensible design

The code is in Python and available here: https://github.com/sdaps/sdaps

There is a GUI which allows the user to "correct" the OCR. gui


I would suggest taking a look at implementing something yourself with OpenCV and possibly python.

A couple of things to keep in mind about your form design:

  1. Include registration marks, (usually 3 of them), so as to be able to rotate and scale the image to cope with forms scanned the wrong way up or at an angle, etc.
  2. Include a machine readable form identifier and for multi-page a page identifier.
  3. Space the answer boxes well, even spacing but well spaced makes filling the form easier and extracting it much easier.
  4. Have a clear rule on how to mark the options, e.g. Use BLACK pen to place a vertical line in the selected box.
  5. Include an option to cancel a box, e.g. If box marked erroneously cancel the mark with a horizontal bar the width of the box.
  6. Always have a box for "I don't wish to answer that"
  7. Use colours to separate out elements by an audience, if all the questions are in light blue but the registration marks are black you can separate them out of the image with a simple colour filter.

Once you have done the above it is simply a matter of:

  • capturing the image,
  • colour filter to get just what we are interested in,
  • rotating and scaling to get the reference marks in the correct place,
  • check it is the right form and
  • then look for marks in the specific areas of interest, (the boxes).

You could even have a "training mode" where you mark all the areas of interest, say in red, and then scan that to tell the code where to look.

OpenCV includes display facilities so you could show the problem area to an operator with a "Which do you think this is?" prompt for any anomalous areas.

There are a number of good books online some free, or from retailers, that cover using OpenCV and python in this sort of way.

  • Completely Free and Open Source
  • Cross Platform Win/OS-X/Linux all supported
  • Lots of online/community help
  • Could provide an educational and interesting couple of days to implement.
  • I know Python, but I have no experience developing with OpenCV. A quick couple questions: 1) are there good multipage PDF libraries for Python, 2) is it easy to build point-and-click (viz. circle selection) GUIs with OpenCV, and 3) does OpenCV have facilities for affine-transformation alignment based on said registration marks? Jun 29, 2015 at 18:56
  • Alignment in my opinion will be the biggest challenge. Can OpenCV do something similar to Hugin's align_image_stack except aligning scanned forms against a standard template? Jun 29, 2015 at 18:57
  • Alignment is easy if your form includes exactly 3 registration marks in a different colour to the rest of the image, - filter for that colour, measure the angles and distances between the 3 and rotate and scale accordingly, (about 5 lines of python + OpenCV IIRC). Jun 30, 2015 at 5:42
  • Could they be the same color? Jun 30, 2015 at 6:15
  • They could be the same colour but then you will have to "find" them - if they are a distinct colour you can filter by colour and they will be the only things there which makes it really easy. Jun 30, 2015 at 6:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.