Now that we understand the basics of OMR, let’s build a computer vision system using
Python and OpenCV that can read and grade bubble sheet tests. In our project , we
combine 3 techniques:
Building document scanner
Sorting the outlines
Perspective transform to get top-down view
Python to Store the correct answer keys in a dict .
Used Canny edge detection for detecting the edges in the document and
Gaussian blur for reducing high frequency noise
OpenCV has the way to get the top-down view of the image.
Used that methodology to get the top-down view.
Used Otsu’s thresholding method for thresholding.
Determined the bubbles using the aspect ratio of approx one (1) for it’s bounding rect-
Used bitwise operations and masking to find the filled in bubble using the amount of
shaded pixels in the bubble.