forked from Udayraj123/OMRChecker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
89 lines (70 loc) · 1.93 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
"""
Designed and Developed by-
Udayraj Deshmukh
https://github.com/Udayraj123
"""
"""
Constants
"""
display_height = int(640)
display_width = int(640)
windowWidth = 1280
windowHeight = 720
saveMarked = 1
saveCropped = 1
showimglvl = 4
saveimglvl = 0
PRELIM_CHECKS = 0
explain = 0
# autorotate=1
BATCH_NO = 1000
NO_MARKER_ERR = 12
MULTI_BUBBLE_WARN = 15
# name of template file
TEMPLATE_FILE = 'template.json'
MARKER_FILE = "omr_marker.jpg"
# For preProcessing
GAMMA_LOW = 0.7
GAMMA_HIGH = 1.25
ERODE_SUB_OFF = 1
# For new ways of determining threshold
MIN_GAP, MIN_STD = 30, 25
MIN_JUMP = 25
# If only not confident, take help of globalTHR
CONFIDENT_JUMP = MIN_JUMP + 15
JUMP_DELTA = 30
# MIN_GAP : worst case gap of black and gray
# Templ alignment parameters
ALIGN_RANGE = range(-5, 6, 1)
# TODO ^THIS SHOULD BE IN LAYOUT FILE AS ITS RELATED TO DIMENSIONS
# ALIGN_RANGE = [-6,-4,-2,-1,0,1,2,4,6]
# max threshold difference for template matching
thresholdVar = 0.41
# TODO: remove unnec variables here-
thresholdCircle = 0.3
marker_rescale_range = (35, 100)
marker_rescale_steps = 10
# Presentation variables
uniform_height = int(1231 / 1.5)
uniform_width = int(1000 / 1.5)
# Original dims are about (3527, 2494)
# Any input images should be resized to this--
uniform_width_hd = int(uniform_width * 1.5)
uniform_height_hd = int(uniform_height * 1.5)
TEXT_SIZE = 0.95
CLR_BLACK = (50, 150, 150)
CLR_WHITE = (250, 250, 250)
CLR_GRAY = (130, 130, 130)
# CLR_DARK_GRAY = (190,190,190)
CLR_DARK_GRAY = (100, 100, 100)
MIN_PAGE_AREA = 80000
# Filepaths
class Paths:
def __init__(self, output):
self.output = output
self.saveMarkedDir = f'{output}/CheckedOMRs/'
self.resultDir = f'{output}/Results/'
self.manualDir = f'{output}/Manual/'
self.errorsDir = f'{self.manualDir}ErrorFiles/'
self.badRollsDir = f'{self.manualDir}BadRollNosFiles/'
self.multiMarkedDir = f'{self.manualDir}MultiMarkedFiles/'