Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
zesje
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Works on my machine
zesje
Commits
dc453a03
Commit
dc453a03
authored
5 years ago
by
RABijl
Browse files
Options
Downloads
Patches
Plain Diff
adds commit statement with approve button and good parameter settings for is box filled
parent
29c623f2
No related branches found
Branches containing commit
No related tags found
1 merge request
!28
combine precise positioning with pregrading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
zesje/api/solutions.py
+2
-0
2 additions, 0 deletions
zesje/api/solutions.py
zesje/pregrader.py
+2
-2
2 additions, 2 deletions
zesje/pregrader.py
with
4 additions
and
2 deletions
zesje/api/solutions.py
+
2
−
0
View file @
dc453a03
...
...
@@ -186,4 +186,6 @@ class Approve(Resource):
solution
.
graded_at
=
datetime
.
now
()
solution
.
graded_by
=
grader
db
.
session
.
commit
()
return
{
'
state
'
:
graded
}
This diff is collapsed.
Click to expand it.
zesje/pregrader.py
+
2
−
2
View file @
dc453a03
...
...
@@ -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
=
2
3
5
,
cut_padding
=
0.05
,
box_size
=
9
):
def
box_is_filled
(
box
,
page_img
,
threshold
=
2
2
5
,
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
,
1
6
0
,
255
,
cv2
.
THRESH_BINARY
)
_
,
bin_im
=
cv2
.
threshold
(
gray_im
,
1
5
0
,
255
,
cv2
.
THRESH_BINARY
)
h_bin
,
w_bin
,
*
_
=
bin_im
.
shape
# create a mask that gets applied when floodfill the white
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment