Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need new function and algorithm to sort contours. #9

Closed
mythrex opened this issue Oct 20, 2018 · 0 comments
Closed

Need new function and algorithm to sort contours. #9

mythrex opened this issue Oct 20, 2018 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mythrex
Copy link
Owner

mythrex commented Oct 20, 2018

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

@mythrex mythrex added the bug Something isn't working label Oct 20, 2018
@mythrex mythrex self-assigned this Oct 20, 2018
mythrex added a commit that referenced this issue Oct 20, 2018
The new algo now sorts contours for test 1,2,3 except test 1 has a little problem though.
@mythrex mythrex closed this as completed Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant