-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.py
61 lines (42 loc) · 2.92 KB
/
ui.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
from modules import *
import functions
class Application:
def __init__(self, master):
self.frmMaster = Frame()
self.frmMaster.pack()
self.frmFiltes = Frame(self.frmMaster)
self.frmFiltes.pack(side="right", padx="10", pady="10")
self.frmImages = Frame(self.frmMaster)
self.frmImages.pack(side="left", padx="10", pady="10")
self.frmOptions = Frame(self.frmMaster)
self.frmOptions.pack(side="bottom", padx="10", pady="10")
self.lblImageOriginal = Label(self.frmMaster)
self.lblImageOriginal.pack(side="left", fill="both", expand="no", padx="10", pady="10")
self.lblImageOutput = Label(self.frmMaster)
self.lblImageOutput.pack(side="right", fill="both", expand="no", padx="10", pady="10")
self.lblTextOutputAnswer = Label(self.frmMaster, borderwidth=2, relief="solid")
self.lblTextOutputAnswer.pack(side="bottom", fill="both", expand="no", padx="10", pady="10")
self.lblTextOutputAnswerText = Label(self.frmMaster, text="Answer:")
self.lblTextOutputAnswerText.pack(side="bottom", fill="both", expand="no", padx="10", pady="10")
self.lblTextOutputExpected = Label(self.frmMaster, borderwidth=2, relief="solid")
self.lblTextOutputExpected.pack(side="bottom", fill="both", expand="no", padx="10", pady="10")
self.lblTextOutputExpectedText = Label(self.frmMaster, text="Expected:")
self.lblTextOutputExpectedText.pack(side="bottom", fill="both", expand="no", padx="10", pady="10")
self.btnImageSelect = Button(self.frmOptions, text="Select an image", command= lambda: (functions.selectImage(self), self.btnImageSelect.configure(state = DISABLED)))
self.btnImageSelect.pack(side="left", fill="both", expand="no", padx="10", pady="10")
self.btnSolveImage = Button(self.frmOptions, text="Solve", command= lambda: (functions.showResult()))
self.btnSolveImage.pack(side="left", fill="both", expand="no", padx="10", pady="10")
self.btnThreshold = Button(self.frmFiltes, text="Threshold", command = lambda : functions.applyThresholdImage())
self.btnThreshold.pack(side="top", fill="both", expand="no", padx="10", pady="10")
self.btnTeste01 = Button(self.frmFiltes, text="Solve From Letters", command = lambda : functions.solveFromLetters())
self.btnTeste01.pack(side="top", fill="both", expand="no", padx="10", pady="10")
self.btnTeste02 = Button(self.frmFiltes, text="teste02")
self.btnTeste02.pack(side="top", fill="both", expand="no", padx="10", pady="10")
self.btnTeste03 = Button(self.frmFiltes, text="teste03")
self.btnTeste03.pack(side="top", fill="both", expand="no", padx="10", pady="10")
self.btnTeste04 = Button(self.frmFiltes, text="teste04")
self.btnTeste04.pack(side="top", fill="both", expand="yes", padx="10", pady="10")
root = Tk()
root.title("TayCaptha")
Application(root)
root.mainloop()