-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path074-level2-config.py
More file actions
38 lines (27 loc) · 1.05 KB
/
Copy path074-level2-config.py
File metadata and controls
38 lines (27 loc) · 1.05 KB
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
"""
Config for 075-level2.py
"""
scan_format = "tiff"
# --- Level / brightness normalization ---
# leveling is useful to remove noise
# from black and white areas in text
# but too much leveling causes too much loss in contrast
# in darkgray and lightgray areas in grayscale graphics
do_level = True
# this color leveling was already applied in 060-rotate-crop-level.py
# using an old config in 050-measure-crop-size.py
previous_lowthresh = 0.05 # about 15/255 in GIMP
previous_highthresh = 0.95 # about 240/255 in GIMP
# NOTE these are the final result levels
# after running 060-rotate-crop-level.py and 075-level.py
# so if the levels here are the same as in 050-measure-crop-size.py
# then 075-level.py is a noop
# lowthresh = 0.05 # about 15/255 in GIMP
# highthresh = 0.95 # about 240/255 in GIMP
# lowthresh = 0.2 # too dark for the book cover -> use 0.1
# lowthresh = 0.1 # about 25/255 in GIMP
# leveling for text-only books
lowthresh = 0.2 # about 50/255 in GIMP
highthresh = 0.9 # about 230/255 in GIMP
# leveling has been done. dont repeat
do_level = False