Giter VIP home page Giter VIP logo

Comments (2)

mythrex avatar mythrex commented on July 27, 2024

Found a work around. Instead for sorting top to bottom first. Sort left to right first. This will sort all the countours form left to right such that first contour is 15a and 15th countour is 1a and 16th is 30a.
screenshot from 2018-10-09 13-23-55

Then sort from top to bottom

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

It works but don't understand fully why? :)

from omr-scanner.

mythrex avatar mythrex commented on July 27, 2024

The problem is not resolved till now.
Now the contours are sorted as:
1A-> questionCnts[0]
1B-> questionCnts[1]
..
Now here is the twist
16A-> questionCnts[5]

questionCnts[104] will be .. that's right
37A
image

from omr-scanner.

Related Issues (15)

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.