-
Notifications
You must be signed in to change notification settings - Fork 0
/
canny.py
91 lines (82 loc) · 4.27 KB
/
canny.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'canny.ui'
#
# Created by: PyQt5 UI code generator 5.15.1
#
# 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_Dialog_canny(object):
def setupUi(self, Dialog_canny):
Dialog_canny.setObjectName("Dialog_canny")
Dialog_canny.resize(400, 150)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Dialog_canny.sizePolicy().hasHeightForWidth())
Dialog_canny.setSizePolicy(sizePolicy)
Dialog_canny.setMinimumSize(QtCore.QSize(400, 150))
Dialog_canny.setMaximumSize(QtCore.QSize(400, 150))
self.buttonBox = QtWidgets.QDialogButtonBox(Dialog_canny)
self.buttonBox.setGeometry(QtCore.QRect(290, 20, 81, 241))
self.buttonBox.setOrientation(QtCore.Qt.Vertical)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.widget = QtWidgets.QWidget(Dialog_canny)
self.widget.setGeometry(QtCore.QRect(51, 10, 149, 113))
self.widget.setObjectName("widget")
self.gridLayout = QtWidgets.QGridLayout(self.widget)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setObjectName("gridLayout")
self.label = QtWidgets.QLabel(self.widget)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.spinBox_thresh1 = QtWidgets.QSpinBox(self.widget)
self.spinBox_thresh1.setMaximum(255)
self.spinBox_thresh1.setSingleStep(10)
self.spinBox_thresh1.setObjectName("spinBox_thresh1")
self.gridLayout.addWidget(self.spinBox_thresh1, 0, 1, 1, 1)
self.label_2 = QtWidgets.QLabel(self.widget)
self.label_2.setObjectName("label_2")
self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
self.spinBox_thresh2 = QtWidgets.QSpinBox(self.widget)
self.spinBox_thresh2.setMaximum(255)
self.spinBox_thresh2.setSingleStep(10)
self.spinBox_thresh2.setObjectName("spinBox_thresh2")
self.gridLayout.addWidget(self.spinBox_thresh2, 1, 1, 1, 1)
self.label_3 = QtWidgets.QLabel(self.widget)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1)
self.spinBox_kernelsize = QtWidgets.QSpinBox(self.widget)
self.spinBox_kernelsize.setMaximum(1000)
self.spinBox_kernelsize.setObjectName("spinBox_kernelsize")
self.gridLayout.addWidget(self.spinBox_kernelsize, 2, 1, 1, 1)
self.label_4 = QtWidgets.QLabel(self.widget)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.comboBox = QtWidgets.QComboBox(self.widget)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.gridLayout.addWidget(self.comboBox, 3, 1, 1, 1)
self.retranslateUi(Dialog_canny)
self.buttonBox.accepted.connect(Dialog_canny.accept)
self.buttonBox.rejected.connect(Dialog_canny.reject)
QtCore.QMetaObject.connectSlotsByName(Dialog_canny)
def retranslateUi(self, Dialog_canny):
_translate = QtCore.QCoreApplication.translate
Dialog_canny.setWindowTitle(_translate("Dialog_canny", "Canny Edge Detector"))
self.label.setText(_translate("Dialog_canny", "Threshiold 1"))
self.label_2.setText(_translate("Dialog_canny", "Threshold 2"))
self.label_3.setText(_translate("Dialog_canny", "Kernel Size"))
self.label_4.setText(_translate("Dialog_canny", "Use L2gradient"))
self.comboBox.setItemText(0, _translate("Dialog_canny", "False"))
self.comboBox.setItemText(1, _translate("Dialog_canny", "True"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog_canny = QtWidgets.QDialog()
ui = Ui_Dialog_canny()
ui.setupUi(Dialog_canny)
Dialog_canny.show()
sys.exit(app.exec_())