forked from meeranahmed/Segmentation-techniques
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.py
130 lines (119 loc) · 6.25 KB
/
mainwindow.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.15.6
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1006, 591)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tabWidget.setGeometry(QtCore.QRect(10, 0, 981, 551))
self.tabWidget.setLayoutDirection(QtCore.Qt.LeftToRight)
self.tabWidget.setObjectName("tabWidget")
self.GrayImages = QtWidgets.QWidget()
self.GrayImages.setObjectName("GrayImages")
self.OpenImage = QtWidgets.QPushButton(self.GrayImages)
self.OpenImage.setGeometry(QtCore.QRect(150, 20, 141, 28))
self.OpenImage.setObjectName("OpenImage")
self.comboBox = QtWidgets.QComboBox(self.GrayImages)
self.comboBox.setGeometry(QtCore.QRect(540, 20, 141, 31))
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.OutputImage = QtWidgets.QPushButton(self.GrayImages)
self.OutputImage.setGeometry(QtCore.QRect(690, 20, 141, 28))
self.OutputImage.setObjectName("OutputImage")
self.input = ImageView(self.GrayImages)
self.input.setGeometry(QtCore.QRect(20, 60, 451, 451))
self.input.setObjectName("input")
self.output = ImageView(self.GrayImages)
self.output.setGeometry(QtCore.QRect(500, 60, 451, 451))
self.output.setObjectName("output")
self.tabWidget.addTab(self.GrayImages, "")
self.ColorImages = QtWidgets.QWidget()
self.ColorImages.setObjectName("ColorImages")
self.OpenImage_2 = QtWidgets.QPushButton(self.ColorImages)
self.OpenImage_2.setGeometry(QtCore.QRect(150, 20, 141, 28))
self.OpenImage_2.setObjectName("OpenImage_2")
self.comboBox_2 = QtWidgets.QComboBox(self.ColorImages)
self.comboBox_2.setGeometry(QtCore.QRect(540, 20, 141, 31))
self.comboBox_2.setObjectName("comboBox_2")
self.comboBox_2.addItem("")
self.comboBox_2.addItem("")
self.comboBox_2.addItem("")
self.comboBox_2.addItem("")
self.OutputImage_2 = QtWidgets.QPushButton(self.ColorImages)
self.OutputImage_2.setGeometry(QtCore.QRect(690, 20, 141, 28))
self.OutputImage_2.setObjectName("OutputImage_2")
self.Output_2 = QtWidgets.QLabel(self.ColorImages)
self.Output_2.setGeometry(QtCore.QRect(480, 60, 471, 451))
self.Output_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.Output_2.setTextFormat(QtCore.Qt.AutoText)
self.Output_2.setAlignment(QtCore.Qt.AlignCenter)
self.Output_2.setObjectName("Output_2")
self.Input_2 = QtWidgets.QLabel(self.ColorImages)
self.Input_2.setGeometry(QtCore.QRect(10, 60, 451, 451))
self.Input_2.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.Input_2.setTextFormat(QtCore.Qt.AutoText)
self.Input_2.setAlignment(QtCore.Qt.AlignCenter)
self.Input_2.setObjectName("Input_2")
self.tabWidget.addTab(self.ColorImages, "")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1006, 21))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.tabWidget.setCurrentIndex(0)
self.input.ui.histogram.hide()
self.input.ui.roiBtn.hide()
self.input.ui.menuBtn.hide()
self.input.ui.roiPlot.hide()
self.output.ui.histogram.hide()
self.output.ui.roiBtn.hide()
self.output.ui.menuBtn.hide()
self.output.ui.roiPlot.hide()
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.OpenImage.setText(_translate("MainWindow", "Open Image"))
self.comboBox.setItemText(0, _translate("MainWindow", "Optimal Local"))
self.comboBox.setItemText(1, _translate("MainWindow", "Optimal Global"))
self.comboBox.setItemText(2, _translate("MainWindow", "Otsu Local"))
self.comboBox.setItemText(3, _translate("MainWindow", "Otsu Global"))
self.comboBox.setItemText(4, _translate("MainWindow", "Spectral Local"))
self.comboBox.setItemText(5, _translate("MainWindow", "Spaectral Global"))
self.OutputImage.setText(_translate("MainWindow", "Output Image"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.GrayImages), _translate("MainWindow", "Thresholding Techniques"))
self.OpenImage_2.setText(_translate("MainWindow", "Open Image"))
self.comboBox_2.setItemText(0, _translate("MainWindow", "Kmeans "))
self.comboBox_2.setItemText(1, _translate("MainWindow", "Region_Growing"))
self.comboBox_2.setItemText(2, _translate("MainWindow", "Agglo"))
self.comboBox_2.setItemText(3, _translate("MainWindow", "Mean Shift"))
self.OutputImage_2.setText(_translate("MainWindow", "Output Image"))
self.Output_2.setText(_translate("MainWindow", "Output"))
self.Input_2.setText(_translate("MainWindow", "Input"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.ColorImages), _translate("MainWindow", "Segmentation Techniques"))
from pyqtgraph import ImageView
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())