-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
32 lines (29 loc) · 1.49 KB
/
gui.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
import cv2
def updateTrackBar():
"""
updates the trackbars
:return:
"""
cannyLow = cv2.getTrackbarPos("Edge Thresh Low", "Edge Detection Settings")
cannyHigh = cv2.getTrackbarPos("Edge Thresh High", "Edge Detection Settings")
noGauss = cv2.getTrackbarPos("Gaussian's", "Edge Detection Settings")
dialations = cv2.getTrackbarPos("Dilations","Edge Detection Settings")
errosions = cv2.getTrackbarPos("Erosions", "Edge Detection Settings")
minArea = cv2.getTrackbarPos("minArea", "Edge Detection Settings")
epsilon = (cv2.getTrackbarPos("Epsilon", "Edge Detection Settings")) / 1000
showFilters = bool(cv2.getTrackbarPos("Show Filters", "General Settings"))
automatic = bool(cv2.getTrackbarPos("Automatic","General Settings"))
textsize = cv2.getTrackbarPos("TextSize","General Settings")/100
return cannyLow, cannyHigh, noGauss, minArea,errosions , dialations, epsilon, showFilters, automatic, textsize
def resetTrackBar():
"""
resets trackbars to default values
:return:
"""
cv2.setTrackbarPos("Edge Thresh Low", "Edge Detection Settings", 120)
cv2.setTrackbarPos("Edge Thresh High", "Edge Detection Settings", 160)
cv2.setTrackbarPos("Gaussian's", "Edge Detection Settings", 2)
cv2.setTrackbarPos("Dilations", "Edge Detection Settings", 6)
cv2.setTrackbarPos("Erosions", "Edge Detection Settings", 2)
cv2.setTrackbarPos("minArea", "Edge Detection Settings", 800)
cv2.setTrackbarPos("Epsilon", "Edge Detection Settings", 100)