Skip to content
Snippets Groups Projects
Commit dc453a03 authored by RABijl's avatar RABijl
Browse files

adds commit statement with approve button and good parameter settings for is box filled

parent 29c623f2
No related branches found
No related tags found
1 merge request!28combine precise positioning with pregrading
......@@ -186,4 +186,6 @@ class Approve(Resource):
solution.graded_at = datetime.now()
solution.graded_by = grader
db.session.commit()
return {'state': graded}
......@@ -32,7 +32,7 @@ def add_feedback_to_solution(sub, exam, page, page_img):
db.session.commit()
def box_is_filled(box, page_img, threshold=235, cut_padding=0.05, box_size=9):
def box_is_filled(box, page_img, threshold=225, cut_padding=0.05, box_size=9):
"""
A function that finds the checkbox in a general area and then checks if it is filled in.
......@@ -68,7 +68,7 @@ def box_is_filled(box, page_img, threshold=235, cut_padding=0.05, box_size=9):
# convert to grayscale
gray_im = cv2.cvtColor(cut_im, cv2.COLOR_BGR2GRAY)
# apply threshold to only have black or white
_, bin_im = cv2.threshold(gray_im, 160, 255, cv2.THRESH_BINARY)
_, bin_im = cv2.threshold(gray_im, 150, 255, cv2.THRESH_BINARY)
h_bin, w_bin, *_ = bin_im.shape
# create a mask that gets applied when floodfill the white
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment