Giter VIP home page Giter VIP logo

omr-scanner's Issues

Choose a correct bubble threshold.

The bubble threshold is creating a problem. A bubble_thresh for one is not working for other. Take a look at images. The threshold is working for test-2 but not for test-3.

test 2
test 3

Sorting contours is not working properly

# sort the question contours from top to bottom
questionCnts = contours.sort_contours(questionCnts, method='top-to-bottom')[0]
correct = 0
# sort the first 4 countours left to right
e = contours.sort_contours(questionCnts[0:4])[0]
# this should draw 1 a countour
cv2.drawContours(paper, [e[0]], -1, 255, -1)

This code should show question 1 A contour but instead it shows some random contour.
See in pic which contour is being displayed.
screenshot from 2018-10-09 13-00-27

# sort the question contours from top to bottom
questionCnts = contours.sort_contours(questionCnts, method='top-to-bottom')[0]
correct = 0
# sort the first 4 countours left to right
e = contours.sort_contours(questionCnts[0:4])[0]
# this should draw 1 b countour
cv2.drawContours(paper, [e[1]], -1, 255, -1)

This code should show question 1 B contour but instead it shows some random contour.
but instead the following has been showing.
screenshot from 2018-10-09 13-01-47

Need new function and algorithm to sort contours.

for c in filter_cnts:
    (x, y, w, h) = cv2.boundingRect(c)
    ar = w / float(h)
    if w >= 9 and h >= 9 and ar >= 0.7 and ar <= 1.2:
       # change this!!!!!!!!!!!!!!!!1
        box = [(x//5)*5, round(y/20.0)]
        questions.append([c, box])
        cv2.rectangle(paper, (x, y), (x+w, y+h), (0, 255, 0), 1)

Problem is with calculation of box for sorting in top to bottom.
Change this logic.
box = [(x//5)*5, round(y/20.0)]
issue 2

Change the design of OMR.

The box-line for bubbles is too thick. The system sometimes takes it as two contours and the most external contour is the box because of which RETR_EXTERNAL return method fails.

image

Module should throw error.

The module should throw an error in some cases like

  • when it does not detect all the bubbles
  • if the paper is not detected
  • if only external contour after the perspective transform is detected.

System Detecting D as potential bubble.

Changing the min height and width is creating a problem. D is being detected.

if w >= 9 and h >= 9 and ar >= 0.7 and ar <= 1.2:

Look at image for more details.
issue 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.