-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage_param.py
33 lines (27 loc) · 849 Bytes
/
image_param.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
class ImageParam:
# angle params
angleBounds = (75, 105) # TODO: lower-upper validation
angleOffset = 0
cutoffAngles = (-15, 15) # TODO: lower-upper validation
rotationAngle = 0
# flags
takeUpperHalf = False
# dist params
consecutivePointsDistThreshold = 30.0
# coordinates offsets
consecutivePointsCoordOffset = 5.0
# valley params
valleyTopPointsHeightDiff = 50
valleyDepthThreshold = 70
valleySidesLengthFactor = 1.2
# finger params
fingersHeightDiff = 100
fingersLengthDiff = 140
minMaxFingerDist = 100
longestFingersHeightsThreshold = 280
@staticmethod
def setParams(**params):
for key, value in params.items():
if hasattr(ImageParam, key):
ImageParam.key = value
setattr(ImageParam, key, value)