프로젝트

일반

사용자정보

개정판 6913dbc8

ID6913dbc8afa011e66e996739e0334b88ec214992
상위 628ad62c
하위 d45df999

함의성이(가) 6년 이상 전에 추가함

issue #655: list dialog added

차이점 보기:

DTI_PID/DTI_PID/QtImageViewer.py
303 303
        @history    block clear selection when right mouse button is clicked
304 304
    '''
305 305
    def mousePressEvent(self, event):
306
        #print('v')
307
        #print(event.pos())
308
        #print(self.mapToScene(event.pos()))
309 306
        try:
310 307
            if self.command is not None:
311 308
                scenePos = self.mapToScene(event.pos())
......
323 320
        @date       
324 321
    '''
325 322
    def mouseReleaseEvent(self, event):
326
        print('v')
327
        print(self.mapToScene(event.pos()))
328 323
        try:
329 324
            if self.command is not None:
330 325
                scenePos = self.mapToScene(event.pos())
DTI_PID/DTI_PID/Shapes/TrainingBoxItem.py
19 19
from EngineeringAbstractItem import QEngineeringAbstractItem
20 20

  
21 21
class QTrainingBoxItem(QGraphicsRectItem):
22
    HIGHLIGHT = '#BC4438'
23

  
24 22
    def __init__(self, x, y, w, h, uid=None, parent=None):
25 23
        import uuid
26 24

  
......
43 41

  
44 42
        self.attribute = ''
45 43
        self.rec = None
44
        self.ui = None
46 45
        self.scene = None
47 46
        self.view = None
48 47

  
49 48
        self.transfer = Transfer()
50 49
 
51
    def mouseReleaseEvent(self, event):
50
    #def mouseReleaseEvent(self, event):
52 51
        """
53
        
54 52
        self.setRect(QRectF(self.scenePos().x(), self.scenePos().y(), self.rect().width(), self.rect().height()))
55 53
        print(self.rect().x())
56 54
        print(self.rect().y())
......
62 60
        self.setRect(QRectF(rect.x() + x, rect.y() + y, rect.width(), rect.height()))
63 61
        self.setSelected(False)
64 62
        """
65
        QGraphicsRectItem.mouseReleaseEvent(self, event)
66
        bouding_rect = self.rect()
67
        self.setRect(QRectF(bouding_rect.x(), bouding_rect.y(), bouding_rect.width(), bouding_rect.height()))
68
        print(self.rect())
69
        print(self.sceneBoundingRect())
70
        self.scene.update()
63
        #QGraphicsRectItem.mouseReleaseEvent(self, event)
64
        #bouding_rect = self.rect()
65
        #self.setRect(QRectF(bouding_rect.x(), bouding_rect.y(), bouding_rect.width(), bouding_rect.height()))
66
        #print(self.rect())
67
        #print(self.sceneBoundingRect())
68
        #self.scene.update()
69

  
71 70
    #    pen = QPen(Qt.SolidLine)
72 71
    #    pen.setColor(Qt.blue)
73 72
    #    pen.setWidthF(1)
......
98 97

  
99 98
    def mousePressEvent(self, event):
100 99
        self.scene.clearSelection()
101
        #QGraphicsRectItem.mouseReleaseEvent(self, event)
102
        #x, y = round(self.pos().x()), round(self.pos().y())
103
        #print(x)
104
        #print(y)
105
        
106
        #print('box')
107
        #x, y = round(event.pos().x()), round(event.pos().y())
108
        #print(x)
109
        print(self.sceneBoundingRect().x())
110
        print(self.sceneBoundingRect().y())
111 100
        QGraphicsRectItem.mousePressEvent(self, event)
112
     #   pen = QPen(Qt.SolidLine)
113
     #   pen.setColor(Qt.red)
114
     #   pen.setWidthF(1)
115
     #   pen.setJoinStyle(Qt.MiterJoin)
116
    #    self.setPen(pen)
117
    #    self.scene.update()
101

  
102
        rect = self.rect()
103
        self.ui.spinBoxLeft.setValue(round(rect.x()))
118 104

  
119 105
    def keyPressEvent(self, event): 
120 106
        if event.key() == Qt.Key_Delete:
......
141 127

  
142 128
        QGraphicsRectItem.keyPressEvent(self, event)
143 129

  
144
    '''
145
        @brief  override paint
146
    '''
130
    def drawFocusRect(self, painter):
131
        pen = QPen(Qt.SolidLine)
132
        pen.setColor(Qt.blue)
133
        pen.setWidthF(1)
134
        pen.setJoinStyle(Qt.MiterJoin)
135
        painter.setPen(pen)
136
        painter.drawRect(self.boundingRect())
137

  
147 138
    def paint(self, painter, options=None, widget=None):
148 139
        QGraphicsRectItem.paint(self, painter, options, widget)
140
        if self.isSelected():
141
            self.drawFocusRect(painter)
149 142

  
150
        painter.setPen(self.pen())
151
        painter.drawEllipse(QPointF(self.rect().x() , self.rect().y()), 3, 3)
152

  
153
    def addTextItemToScene(self, view):
143
    def addTextItemToScene(self, ui, view):
154 144
        try:
145
            self.ui = ui
155 146
            self.view = view
156 147
            self.scene = view.scene
157 148
            pen = QPen(Qt.SolidLine)
158
            pen.setColor(Qt.blue)
149
            pen.setColor(Qt.red)
159 150
            pen.setWidthF(1)
160 151
            pen.setJoinStyle(Qt.MiterJoin)
161 152
            self.setPen(pen)
DTI_PID/DTI_PID/TrainingEditorDialog.py
9 9
from GraphicsBoundingBoxItem import QGraphicsBoundingBoxItem
10 10
from TrainingBoxItem import QTrainingBoxItem
11 11
import cv2
12
from PIL import Image
12 13
import AreaZoomCommand
13 14
import PlaceLineCommand
14 15

  
......
27 28
        self.graphicsViewTrainingDrawing = QtImageViewer.QtImageViewer(self)
28 29
        self.graphicsViewTrainingDrawing.setParent(self.ui.centralWidget)
29 30
        self.graphicsViewTrainingDrawing.useDefaultCommand()
30

  
31 31
        self.ui.verticalLayoutTrainingDrawing.addWidget(self.graphicsViewTrainingDrawing)
32

  
33
        self.graphicsViewZoomDrawing = QGraphicsView(self)
34
        self.graphicsViewZoomDrawing.setParent(self.ui.leftSideWidget)
35
        self.ui.horizontalLayoutZoomDrawing.addWidget(self.graphicsViewZoomDrawing)
36
        
32 37
        
33
        # 학습 이미지 읽어서 뷰에 그림
38
        # 학습 이미지 읽어서 메인뷰에 그림
34 39
        try:
35 40
            trainingImgPath = os.path.join(project.getTrainingFilePath(), 'seed.seedF.exp0.tif')
36 41
            cvImg = cv2.cvtColor(cv2.imread(trainingImgPath), cv2.COLOR_BGR2GRAY)
......
46 51
        except Exception as ex:
47 52
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
48 53

  
49
        # 박스 읽어서 뷰에 그림
54
        # 박스 읽어서 메인뷰에 그림
50 55
        try:
51 56
            trainingBoxPath = os.path.join(project.getTrainingFilePath(), 'seed.seedF.exp0.box')
52 57
            fBox = open(trainingBoxPath, 'r', encoding='utf8')
......
63 68
                singleBox.angle = 0
64 69
                #singleBox.setPlainText(boxComponent[0])
65 70
                singleBox.transfer.onRemoved.connect(self.itemRemoved)
66
                singleBox.addTextItemToScene(self.graphicsViewTrainingDrawing)
71
                singleBox.addTextItemToScene(self.ui, self.graphicsViewTrainingDrawing)
67 72
            
68 73
        except Exception as ex:
69 74
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
70 75

  
76
        # 확대뷰 생성
77
        try:
78
            Image.new
79
        except Exception as ex:
80
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
81

  
71 82

  
72 83
        #'''test'''
73 84
        #item = QGraphicsBoundingBoxItem(0, 0, 30, 30)
......
78 89

  
79 90
        self.removedItems = []
80 91

  
81

  
82 92
        self.ui.pushButtonZoom.clicked.connect(self.onAreaZoom)
83

  
93
        self.ui.spinBoxLeft.valueChanged.connect(self.spinBoxLeftChangeedEvent)
94

  
95
    def spinBoxLeftChangeedEvent(self, event):
96
        left = self.ui.spinBoxLeft.value()
97
        items = self.graphicsViewTrainingDrawing.scene.selectedItems()
98
        if(len(items) is not 1):
99
            return
100
        rect = items[0].rect()
101
        items[0].setRect(QRectF(left, rect.y(), rect.width(), rect.height()))
102
        self.graphicsViewTrainingDrawing.scene.update()
103
    
84 104
    def onAreaZoom(self, action):
85 105
        if self.ui.pushButtonZoom.isChecked():
86 106
            cmd = AreaZoomCommand.AreaZoomCommand(self.graphicsViewTrainingDrawing)
DTI_PID/DTI_PID/TrainingEditor_UI.py
11 11
class Ui_TrainingEditorDialog(object):
12 12
    def setupUi(self, TrainingEditorDialog):
13 13
        TrainingEditorDialog.setObjectName("TrainingEditorDialog")
14
        TrainingEditorDialog.resize(1378, 748)
14
        TrainingEditorDialog.resize(1378, 805)
15 15
        self.gridLayout = QtWidgets.QGridLayout(TrainingEditorDialog)
16 16
        self.gridLayout.setObjectName("gridLayout")
17 17
        self.verticalLayout_6 = QtWidgets.QVBoxLayout()
......
109 109
        self.verticalLayoutTrainingDrawing = QtWidgets.QVBoxLayout()
110 110
        self.verticalLayoutTrainingDrawing.setObjectName("verticalLayoutTrainingDrawing")
111 111
        self.verticalLayout_5.addLayout(self.verticalLayoutTrainingDrawing)
112
        spacerItem2 = QtWidgets.QSpacerItem(40, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
112
        spacerItem2 = QtWidgets.QSpacerItem(4000, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
113 113
        self.verticalLayout_5.addItem(spacerItem2)
114 114
        self.horizontalLayout_4.addWidget(self.centralWidget)
115
        self.verticalLayout_15 = QtWidgets.QVBoxLayout()
116
        self.verticalLayout_15.setObjectName("verticalLayout_15")
117
        self.horizontalLayout = QtWidgets.QHBoxLayout()
118
        self.horizontalLayout.setObjectName("horizontalLayout")
115
        self.leftSideWidget = QtWidgets.QWidget(TrainingEditorDialog)
116
        self.leftSideWidget.setObjectName("leftSideWidget")
117
        self.sideWidget = QtWidgets.QVBoxLayout(self.leftSideWidget)
118
        self.sideWidget.setObjectName("sideWidget")
119
        self.horizontalLayoutZoomDrawing = QtWidgets.QHBoxLayout()
120
        self.horizontalLayoutZoomDrawing.setObjectName("horizontalLayoutZoomDrawing")
119 121
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
120
        self.horizontalLayout.addItem(spacerItem3)
121
        self.verticalLayout_15.addLayout(self.horizontalLayout)
122
        self.horizontalLayoutZoomDrawing.addItem(spacerItem3)
123
        self.sideWidget.addLayout(self.horizontalLayoutZoomDrawing)
122 124
        self.verticalLayout_7 = QtWidgets.QVBoxLayout()
123 125
        self.verticalLayout_7.setObjectName("verticalLayout_7")
124 126
        self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
125 127
        self.horizontalLayout_8.setObjectName("horizontalLayout_8")
126
        self.label_3 = QtWidgets.QLabel(TrainingEditorDialog)
128
        self.label_3 = QtWidgets.QLabel(self.leftSideWidget)
127 129
        self.label_3.setObjectName("label_3")
128 130
        self.horizontalLayout_8.addWidget(self.label_3)
129
        self.spinBoxLeft = QtWidgets.QSpinBox(TrainingEditorDialog)
131
        self.spinBoxLeft = QtWidgets.QSpinBox(self.leftSideWidget)
130 132
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
131 133
        sizePolicy.setHorizontalStretch(0)
132 134
        sizePolicy.setVerticalStretch(0)
133 135
        sizePolicy.setHeightForWidth(self.spinBoxLeft.sizePolicy().hasHeightForWidth())
134 136
        self.spinBoxLeft.setSizePolicy(sizePolicy)
135 137
        self.spinBoxLeft.setMinimumSize(QtCore.QSize(70, 0))
138
        self.spinBoxLeft.setMaximum(999999)
136 139
        self.spinBoxLeft.setObjectName("spinBoxLeft")
137 140
        self.horizontalLayout_8.addWidget(self.spinBoxLeft)
138
        self.label_6 = QtWidgets.QLabel(TrainingEditorDialog)
141
        self.label_6 = QtWidgets.QLabel(self.leftSideWidget)
139 142
        self.label_6.setObjectName("label_6")
140 143
        self.horizontalLayout_8.addWidget(self.label_6)
141
        self.spinBoxTop = QtWidgets.QSpinBox(TrainingEditorDialog)
144
        self.spinBoxTop = QtWidgets.QSpinBox(self.leftSideWidget)
142 145
        self.spinBoxTop.setMinimumSize(QtCore.QSize(70, 0))
146
        self.spinBoxTop.setMaximum(999999)
143 147
        self.spinBoxTop.setObjectName("spinBoxTop")
144 148
        self.horizontalLayout_8.addWidget(self.spinBoxTop)
145 149
        self.verticalLayout_7.addLayout(self.horizontalLayout_8)
......
147 151
        self.verticalLayout_7.addItem(spacerItem4)
148 152
        self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
149 153
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
150
        self.label_5 = QtWidgets.QLabel(TrainingEditorDialog)
154
        self.label_5 = QtWidgets.QLabel(self.leftSideWidget)
151 155
        self.label_5.setObjectName("label_5")
152 156
        self.horizontalLayout_7.addWidget(self.label_5)
153
        self.spinBoxWidth = QtWidgets.QSpinBox(TrainingEditorDialog)
157
        self.spinBoxWidth = QtWidgets.QSpinBox(self.leftSideWidget)
154 158
        self.spinBoxWidth.setMinimumSize(QtCore.QSize(70, 0))
159
        self.spinBoxWidth.setMaximum(999999)
155 160
        self.spinBoxWidth.setObjectName("spinBoxWidth")
156 161
        self.horizontalLayout_7.addWidget(self.spinBoxWidth)
157
        self.label_7 = QtWidgets.QLabel(TrainingEditorDialog)
162
        self.label_7 = QtWidgets.QLabel(self.leftSideWidget)
158 163
        self.label_7.setObjectName("label_7")
159 164
        self.horizontalLayout_7.addWidget(self.label_7)
160
        self.spinBoxHeight = QtWidgets.QSpinBox(TrainingEditorDialog)
165
        self.spinBoxHeight = QtWidgets.QSpinBox(self.leftSideWidget)
161 166
        self.spinBoxHeight.setMinimumSize(QtCore.QSize(70, 0))
167
        self.spinBoxHeight.setMaximum(999999)
162 168
        self.spinBoxHeight.setObjectName("spinBoxHeight")
163 169
        self.horizontalLayout_7.addWidget(self.spinBoxHeight)
164 170
        self.verticalLayout_7.addLayout(self.horizontalLayout_7)
......
166 172
        self.verticalLayout_7.addItem(spacerItem5)
167 173
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
168 174
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
169
        self.label_4 = QtWidgets.QLabel(TrainingEditorDialog)
175
        self.label_4 = QtWidgets.QLabel(self.leftSideWidget)
170 176
        self.label_4.setObjectName("label_4")
171 177
        self.horizontalLayout_6.addWidget(self.label_4)
172
        self.spinBox_6 = QtWidgets.QSpinBox(TrainingEditorDialog)
178
        self.spinBox_6 = QtWidgets.QSpinBox(self.leftSideWidget)
173 179
        self.spinBox_6.setMinimumSize(QtCore.QSize(70, 0))
174 180
        self.spinBox_6.setObjectName("spinBox_6")
175 181
        self.horizontalLayout_6.addWidget(self.spinBox_6)
......
180 186
        self.verticalLayout_7.addItem(spacerItem7)
181 187
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
182 188
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
183
        self.pushButton_14 = QtWidgets.QPushButton(TrainingEditorDialog)
189
        self.pushButton_14 = QtWidgets.QPushButton(self.leftSideWidget)
184 190
        self.pushButton_14.setObjectName("pushButton_14")
185 191
        self.horizontalLayout_5.addWidget(self.pushButton_14)
186
        self.pushButton_13 = QtWidgets.QPushButton(TrainingEditorDialog)
192
        self.pushButton_13 = QtWidgets.QPushButton(self.leftSideWidget)
187 193
        self.pushButton_13.setObjectName("pushButton_13")
188 194
        self.horizontalLayout_5.addWidget(self.pushButton_13)
189 195
        self.verticalLayout_7.addLayout(self.horizontalLayout_5)
190
        self.verticalLayout_15.addLayout(self.verticalLayout_7)
191
        self.horizontalLayout_4.addLayout(self.verticalLayout_15)
196
        self.sideWidget.addLayout(self.verticalLayout_7)
197
        self.horizontalLayout_4.addWidget(self.leftSideWidget)
192 198
        self.verticalLayout_6.addLayout(self.horizontalLayout_4)
193 199
        self.gridLayout.addLayout(self.verticalLayout_6, 0, 0, 1, 1)
194 200

  
DTI_PID/DTI_PID/TrainingListDialog.py
1
import sys
2
import os
3
from PyQt5.QtCore import *
4
from PyQt5.QtGui import *
5
from PyQt5.QtWidgets import *
6
from AppDocData import AppDocData, Source
7
import pytesseract
8
import TrainingList_UI
9

  
10

  
11
pytesseract.pytesseract.tesseract_cmd = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Tesseract-OCR', 'tesseract.exe')
12
tesseract_cmd = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Tesseract-OCR', 'tesseract.exe')
13

  
14
DEFAULT_CONF = """
15
    --psm 6 -c tessedit_char_whitelist=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-~.,/!@#$%&*(){}[]<>:;+=?\\"\\'
16
"""
17

  
18
class QTrainingListDialog(QDialog):
19

  
20
    trainingDataNumber = 0
21

  
22
    def __init__(self, parent):
23
        QDialog.__init__(self, parent)
24

  
25
        self.ui = TrainingList_UI.Ui_TraingingListDialog()
26
        self.ui.setupUi(self)
27

  
28
        # for List 
29
        self.ui.tableWidgetList.setSelectionMode(QAbstractItemView.SingleSelection) 
30
        self.ui.tableWidgetList.setColumnCount(2)
31

  
32
        docData = AppDocData.instance()
33
        dataList = docData.getDrawingFileList()
34
        self.ui.tableWidgetList.setRowCount(len(dataList))
35

  
36
        ## column header 명 설정
37
        headerLabel = docData.getCurrentProject().getName()
38
        self.ui.tableWidgetList.setHorizontalHeaderLabels(['No.', headerLabel])
39
        self.ui.tableWidgetList.horizontalHeaderItem(1).setToolTip('도면 이름') # header tooltip
40
        self.ui.tableWidgetList.horizontalHeaderItem(1).setSizeHint(QSize(30, 30))
41
        self.ui.tableWidgetList.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeToContents)
42
        self.ui.tableWidgetList.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch)
43
        self.ui.tableWidgetList.setEditTriggers(QAbstractItemView.NoEditTriggers)
44
        
45
        row = 0
46
        for data in dataList:
47
            self.ui.tableWidgetList.setItem(row, 0, QTableWidgetItem(str(row + 1)))
48
            self.ui.tableWidgetList.setItem(row, 1, QTableWidgetItem(data))
49
            row += 1
50

  
51
        # for Selected
52
        self.ui.tableWidgetSelected.setSelectionMode(QAbstractItemView.SingleSelection) 
53
        self.ui.tableWidgetSelected.setColumnCount(3)
54

  
55
        ## column header 명 설정
56
        headerLabel = docData.getCurrentProject().getName()
57
        self.ui.tableWidgetSelected.setHorizontalHeaderLabels(['No.', headerLabel, '작업 상태'])
58
        self.ui.tableWidgetSelected.horizontalHeaderItem(1).setToolTip('도면 이름') # header tooltip
59
        self.ui.tableWidgetSelected.horizontalHeaderItem(2).setToolTip('작업 상태') # header tooltip
60
        self.ui.tableWidgetSelected.horizontalHeaderItem(1).setSizeHint(QSize(30, 30))
61
        self.ui.tableWidgetSelected.horizontalHeader().setSectionResizeMode(0, QHeaderView.ResizeToContents)
62
        self.ui.tableWidgetSelected.horizontalHeader().setSectionResizeMode(1, QHeaderView.Stretch)
63
        self.ui.tableWidgetSelected.setEditTriggers(QAbstractItemView.NoEditTriggers)
64

  
65
        # connect signals and slots
66
        self.ui.tableWidgetList.cellDoubleClicked.connect(self.listCellDoubleClicked)
67
        self.ui.pushButtonAddList.clicked.connect(self.addListClicked)
68
        self.ui.pushButtonMakeTrainingData.clicked.connect(self.makeTrainingDataClicked)
69

  
70

  
71
    '''
72
        @brief      make training data(text image + Box file) by button click
73
        @author     euisung
74
        @date       2018.09.28
75
    '''        
76
    def makeTrainingDataClicked(self):
77
        from TextDetector import TextDetector
78
        from PIL import Image
79
        import cv2, math
80

  
81
        try:
82
            row = self.ui.tableWidgetSelected.selectedIndexes()[0].row()
83
            col = self.ui.tableWidgetSelected.selectedIndexes()[0].column()
84
            drawingName = self.ui.tableWidgetSelected.item(row, 1).text()
85
        except:
86
            return
87

  
88
        try:
89
            appDocData = AppDocData.instance()
90
            project = appDocData.getCurrentProject()
91
            textDetector = TextDetector()
92

  
93
            drawingPath = os.path.join(project.getDrawingFilePath(), drawingName)
94
            drawing = Source(Image.open(drawingPath))
95

  
96
            _imgSrc = cv2.cvtColor(cv2.imread(drawingPath), cv2.COLOR_BGR2GRAY)
97
            blur = cv2.GaussianBlur(_imgSrc , (5,5),0)
98
            _imgSrc = cv2.threshold(_imgSrc , 0, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU)[1]
99

  
100
            textAreas = textDetector.detectTextAreas(_imgSrc , (0,0))
101

  
102
            areasNumber = len(textAreas)
103
            print('total text areas : ' + str(areasNumber))
104
            maxW, maxH, sumW, sumH, count = 0, 0, 0, 0, 0
105
            for textArea in textAreas:
106
                areaW = textArea.getW()
107
                areaH = textArea.getH()
108
                areaA = textArea.getAngle()
109
                if areaA is 90:
110
                    areaW, areaH = areaH, areaW
111
                if areaA is not 0 and areaA is not 90:
112
                    continue
113
                count += 1
114
                sumW += areaW
115
                sumH += areaH
116
                if maxW < areaW:
117
                    maxW = areaW
118
                if maxH < areaH:
119
                    maxH = areaH
120
            
121
            print('count : ' + str(count))
122
            print('max width : ' + str(maxW) + ', max height : ' + str(maxH))
123
            argW = sumW / count
124
            argH = sumH / count
125
            print('arg width : ' + str(argW) + ', arg height : ' + str(argH))
126
            totalArea = math.ceil(argW * argH * count)
127
            totalBaseWidth = math.ceil(math.sqrt(totalArea))
128
            print('total area theory : ' + str(totalArea) + ', total width : ' + str(totalBaseWidth))
129

  
130
            maxLineH, lineW, totalHeight = 0, 0, 0
131
            for index in range(0, areasNumber):
132
                areaW = textAreas[index].getW()
133
                areaH = textAreas[index].getH()
134
                areaA = textAreas[index].getAngle()
135
                if areaA is 90:
136
                    areaW, areaH = areaH, areaW
137
                if areaA is not 0 and areaA is not 90:
138
                    continue
139

  
140
                if maxLineH < areaH:
141
                    maxLineH = areaH
142
                if lineW + areaW < totalBaseWidth:
143
                    lineW += areaW
144
                else:
145
                    lineW = areaW
146
                    totalHeight += maxLineH
147
            totalHeight += maxLineH
148
            print('total area real : ' + str(totalBaseWidth * totalHeight) +', total width : ' + str(totalBaseWidth) + ', total height : ' + str(totalHeight) + ', ratio : ' + str(totalHeight / totalBaseWidth))
149

  
150
            trainingTextImg = Image.new("RGB", (totalBaseWidth, totalHeight), (256,256,256))
151
            maxLineH, lineW, totalHeight, currentX, currentY = 0, 0, 0, 0, 0
152
            for index in range(0, areasNumber):
153
                #print(index)
154
                areaW = textAreas[index].getW()
155
                areaH = textAreas[index].getH()
156
                areaA = textAreas[index].getAngle()
157

  
158
                textAreaImg = drawing.source.crop((textAreas[index].getX(), textAreas[index].getY(), textAreas[index].getX() + areaW, textAreas[index].getY() + areaH))
159

  
160
                if areaA is 90:
161
                    areaW, areaH = areaH, areaW
162
                    textAreaImg = textAreaImg.transpose(Image.ROTATE_270)
163
                if areaA is not 0 and areaA is not 90:
164
                    continue
165

  
166
                if maxLineH < areaH:
167
                    maxLineH = areaH
168
                if lineW + areaW < totalBaseWidth:
169
                    lineW += areaW
170
                    trainingTextImg.paste(textAreaImg, (currentX, currentY, currentX + areaW, currentY + areaH))
171
                    currentX = lineW
172
                else:
173
                    lineW = areaW
174
                    totalHeight += maxLineH
175
                    currentX = 0
176
                    currentY = totalHeight
177
                    trainingTextImg.paste(textAreaImg, (currentX, currentY, currentX + areaW, currentY + areaH))
178
                    currentX = areaW
179
               #trainingTextImg.show()
180
            #trainingTextImg.show()
181
            boundaryOcrData = pytesseract.image_to_boxes(trainingTextImg, config=DEFAULT_CONF, lang='seed+eng')
182

  
183
            trainingImgPath = os.path.join(project.getTrainingFilePath(), 'seed.seedF.exp0.tif')
184
            trainingBoxPath = os.path.join(project.getTrainingFilePath(), 'seed.seedF.exp0.box')
185

  
186
            trainingTextImg.save(trainingImgPath, compression='tiff_lzw')
187
            fw = open(trainingBoxPath, 'w') #파일 있으면 새로 만듬 예외 처리 안됨, 임시
188
            fw.write(boundaryOcrData)
189
            fw.close()
190
            
191
        except Exception as ex:
192
            print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno))
193
        return
194

  
195
    '''
196
        @brief      add drawing to Selected by button click
197
        @author     euisung
198
        @date       2018.09.28
199
    '''        
200
    def addListClicked(self):
201
        try:
202
            row = self.ui.tableWidgetList.selectedIndexes()[0].row()
203
            col = self.ui.tableWidgetList.selectedIndexes()[0].column()
204
            self.listCellDoubleClicked(row, col)
205
        except Exception as ex:
206
            pass
207
        return
208

  
209

  
210
    '''
211
        @brief      add drawing to Selected by cell double click
212
        @author     euisung
213
        @date       2018.09.28
214
    '''
215
    def listCellDoubleClicked(self, row, col):
216
        #print('row : ' + str(row) + ', col : ' + str(col))
217
        rowPosition = self.ui.tableWidgetSelected.rowCount()
218
        self.ui.tableWidgetSelected.setRowCount(rowPosition + 1)
219

  
220
        drawingName = self.ui.tableWidgetList.item(row, 1).text()
221
        #print(drawingName)
222
        self.trainingDataNumber = self.trainingDataNumber + 1
223
        self.ui.tableWidgetSelected.setItem(rowPosition, 0, QTableWidgetItem(str(self.trainingDataNumber)))
224
        self.ui.tableWidgetSelected.setItem(rowPosition, 1, QTableWidgetItem(drawingName))
225
        self.ui.tableWidgetSelected.setItem(rowPosition, 2, QTableWidgetItem('신규'))
226

  
227
        return
228

  
229

  
230
        
DTI_PID/DTI_PID/TrainingList_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file './UI/TrainingList.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.11.2
6
#
7
# WARNING! All changes made in this file will be lost!
8

  
9
from PyQt5 import QtCore, QtGui, QtWidgets
10

  
11
class Ui_TraingingListDialog(object):
12
    def setupUi(self, TraingingListDialog):
13
        TraingingListDialog.setObjectName("TraingingListDialog")
14
        TraingingListDialog.resize(1146, 535)
15
        self.gridLayout = QtWidgets.QGridLayout(TraingingListDialog)
16
        self.gridLayout.setObjectName("gridLayout")
17
        self.verticalLayout = QtWidgets.QVBoxLayout()
18
        self.verticalLayout.setObjectName("verticalLayout")
19
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
20
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
21
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
22
        self.verticalLayout_3.setObjectName("verticalLayout_3")
23
        self.label_2 = QtWidgets.QLabel(TraingingListDialog)
24
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
25
        self.label_2.setObjectName("label_2")
26
        self.verticalLayout_3.addWidget(self.label_2)
27
        self.tableWidgetList = QtWidgets.QTableWidget(TraingingListDialog)
28
        self.tableWidgetList.setColumnCount(1)
29
        self.tableWidgetList.setObjectName("tableWidgetList")
30
        self.tableWidgetList.setRowCount(0)
31
        self.tableWidgetList.verticalHeader().setVisible(False)
32
        self.verticalLayout_3.addWidget(self.tableWidgetList)
33
        self.horizontalLayout_2.addLayout(self.verticalLayout_3)
34
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
35
        self.verticalLayout_2.setObjectName("verticalLayout_2")
36
        self.pushButtonAddList = QtWidgets.QPushButton(TraingingListDialog)
37
        self.pushButtonAddList.setObjectName("pushButtonAddList")
38
        self.verticalLayout_2.addWidget(self.pushButtonAddList)
39
        self.pushButton_5 = QtWidgets.QPushButton(TraingingListDialog)
40
        self.pushButton_5.setObjectName("pushButton_5")
41
        self.verticalLayout_2.addWidget(self.pushButton_5)
42
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
43
        self.verticalLayout_4 = QtWidgets.QVBoxLayout()
44
        self.verticalLayout_4.setObjectName("verticalLayout_4")
45
        self.label = QtWidgets.QLabel(TraingingListDialog)
46
        self.label.setAlignment(QtCore.Qt.AlignCenter)
47
        self.label.setObjectName("label")
48
        self.verticalLayout_4.addWidget(self.label)
49
        self.tableWidgetSelected = QtWidgets.QTableWidget(TraingingListDialog)
50
        self.tableWidgetSelected.setColumnCount(1)
51
        self.tableWidgetSelected.setObjectName("tableWidgetSelected")
52
        self.tableWidgetSelected.setRowCount(0)
53
        self.tableWidgetSelected.horizontalHeader().setVisible(True)
54
        self.tableWidgetSelected.horizontalHeader().setHighlightSections(True)
55
        self.tableWidgetSelected.horizontalHeader().setMinimumSectionSize(34)
56
        self.tableWidgetSelected.horizontalHeader().setSortIndicatorShown(False)
57
        self.tableWidgetSelected.verticalHeader().setVisible(False)
58
        self.tableWidgetSelected.verticalHeader().setMinimumSectionSize(23)
59
        self.verticalLayout_4.addWidget(self.tableWidgetSelected)
60
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
61
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
62
        self.pushButton_6 = QtWidgets.QPushButton(TraingingListDialog)
63
        self.pushButton_6.setObjectName("pushButton_6")
64
        self.horizontalLayout_4.addWidget(self.pushButton_6)
65
        self.pushButtonMakeTrainingData = QtWidgets.QPushButton(TraingingListDialog)
66
        self.pushButtonMakeTrainingData.setObjectName("pushButtonMakeTrainingData")
67
        self.horizontalLayout_4.addWidget(self.pushButtonMakeTrainingData)
68
        self.verticalLayout_4.addLayout(self.horizontalLayout_4)
69
        self.horizontalLayout_2.addLayout(self.verticalLayout_4)
70
        self.verticalLayout.addLayout(self.horizontalLayout_2)
71
        self.horizontalLayout = QtWidgets.QHBoxLayout()
72
        self.horizontalLayout.setObjectName("horizontalLayout")
73
        self.pushButton_3 = QtWidgets.QPushButton(TraingingListDialog)
74
        self.pushButton_3.setObjectName("pushButton_3")
75
        self.horizontalLayout.addWidget(self.pushButton_3)
76
        self.lineEdit = QtWidgets.QLineEdit(TraingingListDialog)
77
        self.lineEdit.setMaximumSize(QtCore.QSize(80, 16777215))
78
        self.lineEdit.setObjectName("lineEdit")
79
        self.horizontalLayout.addWidget(self.lineEdit)
80
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
81
        self.horizontalLayout.addItem(spacerItem)
82
        self.pushButton_2 = QtWidgets.QPushButton(TraingingListDialog)
83
        self.pushButton_2.setObjectName("pushButton_2")
84
        self.horizontalLayout.addWidget(self.pushButton_2)
85
        self.pushButton = QtWidgets.QPushButton(TraingingListDialog)
86
        self.pushButton.setObjectName("pushButton")
87
        self.horizontalLayout.addWidget(self.pushButton)
88
        self.verticalLayout.addLayout(self.horizontalLayout)
89
        self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
90

  
91
        self.retranslateUi(TraingingListDialog)
92
        QtCore.QMetaObject.connectSlotsByName(TraingingListDialog)
93

  
94
    def retranslateUi(self, TraingingListDialog):
95
        _translate = QtCore.QCoreApplication.translate
96
        TraingingListDialog.setWindowTitle(_translate("TraingingListDialog", "Training List"))
97
        self.label_2.setText(_translate("TraingingListDialog", "List"))
98
        self.pushButtonAddList.setText(_translate("TraingingListDialog", "추가"))
99
        self.pushButton_5.setText(_translate("TraingingListDialog", "PushButton"))
100
        self.label.setText(_translate("TraingingListDialog", "Selected"))
101
        self.pushButton_6.setText(_translate("TraingingListDialog", "PushButton"))
102
        self.pushButtonMakeTrainingData.setText(_translate("TraingingListDialog", "학습 데이터 생성"))
103
        self.pushButton_3.setText(_translate("TraingingListDialog", "PushButton"))
104
        self.pushButton_2.setText(_translate("TraingingListDialog", "PushButton"))
105
        self.pushButton.setText(_translate("TraingingListDialog", "PushButton"))
106

  
107

  
108
if __name__ == "__main__":
109
    import sys
110
    app = QtWidgets.QApplication(sys.argv)
111
    TraingingListDialog = QtWidgets.QDialog()
112
    ui = Ui_TraingingListDialog()
113
    ui.setupUi(TraingingListDialog)
114
    TraingingListDialog.show()
115
    sys.exit(app.exec_())
116

  
DTI_PID/DTI_PID/UI/TrainingEditor.ui
7 7
    <x>0</x>
8 8
    <y>0</y>
9 9
    <width>1378</width>
10
    <height>748</height>
10
    <height>805</height>
11 11
   </rect>
12 12
  </property>
13 13
  <property name="windowTitle">
......
94 94
       </item>
95 95
       <item>
96 96
        <widget class="QPushButton" name="pushButtonZoom">
97
         <property name="minimumSize">
98
          <size>
99
           <width>64</width>
100
           <height>64</height>
101
          </size>
102
         </property>
97 103
         <property name="toolTip">
98 104
          <string extracomment="축소 : Ctrl + Mouse Wheel Down"/>
99 105
         </property>
......
106 112
        </widget>
107 113
       </item>
108 114
       <item>
109
        <widget class="QPushButton" name="pushButton_4">
110
         <property name="text">
111
          <string>PushButton</string>
112
         </property>
113
        </widget>
114
       </item>
115
       <item>
116 115
        <layout class="QVBoxLayout" name="verticalLayout_2">
117 116
         <item>
118 117
          <widget class="QCheckBox" name="checkBox_2">
......
270 269
            <property name="orientation">
271 270
             <enum>Qt::Horizontal</enum>
272 271
            </property>
272
            <property name="sizeType">
273
             <enum>QSizePolicy::Expanding</enum>
274
            </property>
273 275
            <property name="sizeHint" stdset="0">
274 276
             <size>
275
              <width>40</width>
277
              <width>4000</width>
276 278
              <height>0</height>
277 279
             </size>
278 280
            </property>
......
282 284
        </widget>
283 285
       </item>
284 286
       <item>
285
        <layout class="QVBoxLayout" name="verticalLayout_15">
286
         <item>
287
          <layout class="QHBoxLayout" name="horizontalLayout">
288
           <item>
289
            <spacer name="verticalSpacer_2">
290
             <property name="orientation">
291
              <enum>Qt::Vertical</enum>
292
             </property>
293
             <property name="sizeHint" stdset="0">
294
              <size>
295
               <width>20</width>
296
               <height>40</height>
297
              </size>
298
             </property>
299
            </spacer>
300
           </item>
301
          </layout>
302
         </item>
303
         <item>
304
          <layout class="QVBoxLayout" name="verticalLayout_7">
305
           <item>
306
            <layout class="QHBoxLayout" name="horizontalLayout_8">
307
             <item>
308
              <widget class="QLabel" name="label_3">
309
               <property name="text">
310
                <string>Left</string>
311
               </property>
312
              </widget>
313
             </item>
314
             <item>
315
              <widget class="QSpinBox" name="spinBoxLeft">
316
               <property name="sizePolicy">
317
                <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
318
                 <horstretch>0</horstretch>
319
                 <verstretch>0</verstretch>
320
                </sizepolicy>
321
               </property>
322
               <property name="minimumSize">
323
                <size>
324
                 <width>70</width>
325
                 <height>0</height>
326
                </size>
327
               </property>
328
              </widget>
329
             </item>
330
             <item>
331
              <widget class="QLabel" name="label_6">
332
               <property name="text">
333
                <string>Top</string>
334
               </property>
335
              </widget>
336
             </item>
337
             <item>
338
              <widget class="QSpinBox" name="spinBoxTop">
339
               <property name="minimumSize">
340
                <size>
341
                 <width>70</width>
342
                 <height>0</height>
343
                </size>
344
               </property>
345
              </widget>
346
             </item>
347
            </layout>
348
           </item>
349
           <item>
350
            <spacer name="verticalSpacer_4">
351
             <property name="orientation">
352
              <enum>Qt::Vertical</enum>
353
             </property>
354
             <property name="sizeType">
355
              <enum>QSizePolicy::Fixed</enum>
356
             </property>
357
             <property name="sizeHint" stdset="0">
358
              <size>
359
               <width>20</width>
360
               <height>10</height>
361
              </size>
362
             </property>
363
            </spacer>
364
           </item>
365
           <item>
366
            <layout class="QHBoxLayout" name="horizontalLayout_7">
367
             <item>
368
              <widget class="QLabel" name="label_5">
369
               <property name="text">
370
                <string>Width</string>
371
               </property>
372
              </widget>
373
             </item>
374
             <item>
375
              <widget class="QSpinBox" name="spinBoxWidth">
376
               <property name="minimumSize">
377
                <size>
378
                 <width>70</width>
379
                 <height>0</height>
380
                </size>
381
               </property>
382
              </widget>
383
             </item>
384
             <item>
385
              <widget class="QLabel" name="label_7">
386
               <property name="text">
387
                <string>Height</string>
388
               </property>
389
              </widget>
390
             </item>
391
             <item>
392
              <widget class="QSpinBox" name="spinBoxHeight">
393
               <property name="minimumSize">
394
                <size>
395
                 <width>70</width>
396
                 <height>0</height>
397
                </size>
398
               </property>
399
              </widget>
400
             </item>
401
            </layout>
402
           </item>
403
           <item>
404
            <spacer name="verticalSpacer_5">
405
             <property name="orientation">
406
              <enum>Qt::Vertical</enum>
407
             </property>
408
             <property name="sizeType">
409
              <enum>QSizePolicy::Fixed</enum>
410
             </property>
411
             <property name="sizeHint" stdset="0">
412
              <size>
413
               <width>20</width>
414
               <height>10</height>
415
              </size>
416
             </property>
417
            </spacer>
418
           </item>
419
           <item>
420
            <layout class="QHBoxLayout" name="horizontalLayout_6">
421
             <item>
422
              <widget class="QLabel" name="label_4">
423
               <property name="text">
424
                <string>TextLabel</string>
425
               </property>
426
              </widget>
427
             </item>
428
             <item>
429
              <widget class="QSpinBox" name="spinBox_6">
430
               <property name="minimumSize">
431
                <size>
432
                 <width>70</width>
433
                 <height>0</height>
434
                </size>
435
               </property>
436
              </widget>
437
             </item>
438
            </layout>
439
           </item>
440
           <item>
441
            <spacer name="verticalSpacer_3">
442
             <property name="orientation">
443
              <enum>Qt::Vertical</enum>
444
             </property>
445
             <property name="sizeType">
446
              <enum>QSizePolicy::Fixed</enum>
447
             </property>
448
             <property name="sizeHint" stdset="0">
449
              <size>
450
               <width>20</width>
451
               <height>30</height>
452
              </size>
453
             </property>
454
            </spacer>
455
           </item>
456
           <item>
457
            <spacer name="horizontalSpacer_4">
458
             <property name="orientation">
459
              <enum>Qt::Horizontal</enum>
460
             </property>
461
             <property name="sizeType">
462
              <enum>QSizePolicy::Fixed</enum>
463
             </property>
464
             <property name="sizeHint" stdset="0">
465
              <size>
466
               <width>400</width>
467
               <height>20</height>
468
              </size>
469
             </property>
470
            </spacer>
471
           </item>
472
           <item>
473
            <layout class="QHBoxLayout" name="horizontalLayout_5">
474
             <item>
475
              <widget class="QPushButton" name="pushButton_14">
476
               <property name="text">
477
                <string>PushButton</string>
478
               </property>
479
              </widget>
480
             </item>
481
             <item>
482
              <widget class="QPushButton" name="pushButton_13">
483
               <property name="text">
484
                <string>PushButton</string>
485
               </property>
486
              </widget>
487
             </item>
488
            </layout>
489
           </item>
490
          </layout>
491
         </item>
492
        </layout>
287
        <widget class="QWidget" name="leftSideWidget" native="true">
288
         <layout class="QVBoxLayout" name="sideWidget">
289
          <item>
290
           <layout class="QHBoxLayout" name="horizontalLayoutZoomDrawing">
291
            <item>
292
             <spacer name="verticalSpacer_2">
293
              <property name="orientation">
294
               <enum>Qt::Vertical</enum>
295
              </property>
296
              <property name="sizeHint" stdset="0">
297
               <size>
298
                <width>20</width>
299
                <height>40</height>
300
               </size>
301
              </property>
302
             </spacer>
303
            </item>
304
           </layout>
305
          </item>
306
          <item>
307
           <layout class="QVBoxLayout" name="verticalLayout_7">
308
            <item>
309
             <layout class="QHBoxLayout" name="horizontalLayout_8">
310
              <item>
311
               <widget class="QLabel" name="label_3">
312
                <property name="text">
313
                 <string>Left</string>
314
                </property>
315
               </widget>
316
              </item>
317
              <item>
318
               <widget class="QSpinBox" name="spinBoxLeft">
319
                <property name="sizePolicy">
320
                 <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
321
                  <horstretch>0</horstretch>
322
                  <verstretch>0</verstretch>
323
                 </sizepolicy>
324
                </property>
325
                <property name="minimumSize">
326
                 <size>
327
                  <width>70</width>
328
                  <height>0</height>
329
                 </size>
330
                </property>
331
                <property name="maximum">
332
                 <number>999999</number>
333
                </property>
334
               </widget>
335
              </item>
336
              <item>
337
               <widget class="QLabel" name="label_6">
338
                <property name="text">
339
                 <string>Top</string>
340
                </property>
341
               </widget>
342
              </item>
343
              <item>
344
               <widget class="QSpinBox" name="spinBoxTop">
345
                <property name="minimumSize">
346
                 <size>
347
                  <width>70</width>
348
                  <height>0</height>
349
                 </size>
350
                </property>
351
                <property name="maximum">
352
                 <number>999999</number>
353
                </property>
354
               </widget>
355
              </item>
356
             </layout>
357
            </item>
358
            <item>
359
             <spacer name="verticalSpacer_4">
360
              <property name="orientation">
361
               <enum>Qt::Vertical</enum>
362
              </property>
363
              <property name="sizeType">
364
               <enum>QSizePolicy::Fixed</enum>
365
              </property>
366
              <property name="sizeHint" stdset="0">
367
               <size>
368
                <width>20</width>
369
                <height>10</height>
370
               </size>
371
              </property>
372
             </spacer>
373
            </item>
374
            <item>
375
             <layout class="QHBoxLayout" name="horizontalLayout_7">
376
              <item>
377
               <widget class="QLabel" name="label_5">
378
                <property name="text">
379
                 <string>Width</string>
380
                </property>
381
               </widget>
382
              </item>
383
              <item>
384
               <widget class="QSpinBox" name="spinBoxWidth">
385
                <property name="minimumSize">
386
                 <size>
387
                  <width>70</width>
388
                  <height>0</height>
389
                 </size>
390
                </property>
391
                <property name="maximum">
392
                 <number>999999</number>
393
                </property>
394
               </widget>
395
              </item>
396
              <item>
397
               <widget class="QLabel" name="label_7">
398
                <property name="text">
399
                 <string>Height</string>
400
                </property>
401
               </widget>
402
              </item>
403
              <item>
404
               <widget class="QSpinBox" name="spinBoxHeight">
405
                <property name="minimumSize">
406
                 <size>
407
                  <width>70</width>
408
                  <height>0</height>
409
                 </size>
410
                </property>
411
                <property name="maximum">
412
                 <number>999999</number>
413
                </property>
414
               </widget>
415
              </item>
416
             </layout>
417
            </item>
418
            <item>
419
             <spacer name="verticalSpacer_5">
420
              <property name="orientation">
421
               <enum>Qt::Vertical</enum>
422
              </property>
423
              <property name="sizeType">
424
               <enum>QSizePolicy::Fixed</enum>
425
              </property>
426
              <property name="sizeHint" stdset="0">
427
               <size>
428
                <width>20</width>
429
                <height>10</height>
430
               </size>
431
              </property>
432
             </spacer>
433
            </item>
434
            <item>
435
             <layout class="QHBoxLayout" name="horizontalLayout_6">
436
              <item>
437
               <widget class="QLabel" name="label_4">
438
                <property name="text">
439
                 <string>TextLabel</string>
440
                </property>
441
               </widget>
442
              </item>
443
              <item>
444
               <widget class="QSpinBox" name="spinBox_6">
445
                <property name="minimumSize">
446
                 <size>
447
                  <width>70</width>
448
                  <height>0</height>
449
                 </size>
450
                </property>
451
               </widget>
452
              </item>
453
             </layout>
454
            </item>
455
            <item>
456
             <spacer name="verticalSpacer_3">
457
              <property name="orientation">
458
               <enum>Qt::Vertical</enum>
459
              </property>
460
              <property name="sizeType">
461
               <enum>QSizePolicy::Fixed</enum>
462
              </property>
463
              <property name="sizeHint" stdset="0">
464
               <size>
465
                <width>20</width>
466
                <height>30</height>
467
               </size>
468
              </property>
469
             </spacer>
470
            </item>
471
            <item>
472
             <spacer name="horizontalSpacer_4">
473
              <property name="orientation">
474
               <enum>Qt::Horizontal</enum>
475
              </property>
476
              <property name="sizeType">
477
               <enum>QSizePolicy::Fixed</enum>
478
              </property>
479
              <property name="sizeHint" stdset="0">
480
               <size>
481
                <width>400</width>
482
                <height>20</height>
483
               </size>
484
              </property>
485
             </spacer>
486
            </item>
487
            <item>
488
             <layout class="QHBoxLayout" name="horizontalLayout_5">
489
              <item>
490
               <widget class="QPushButton" name="pushButton_14">
491
                <property name="text">
492
                 <string>PushButton</string>
493
                </property>
494
               </widget>
495
              </item>
496
              <item>
497
               <widget class="QPushButton" name="pushButton_13">
498
                <property name="text">
499
                 <string>PushButton</string>
500
                </property>
501
               </widget>
502
              </item>
503
             </layout>
504
            </item>
505
           </layout>
506
          </item>
507
         </layout>
508
        </widget>
493 509
       </item>
494 510
      </layout>
495 511
     </item>
DTI_PID/DTI_PID/UI/TrainingList.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>TraingingListDialog</class>
4
 <widget class="QDialog" name="TraingingListDialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>1146</width>
10
    <height>535</height>
11
   </rect>
12
  </property>
13
  <property name="windowTitle">
14
   <string>Training List</string>
15
  </property>
16
  <layout class="QGridLayout" name="gridLayout">
17
   <item row="0" column="0">
18
    <layout class="QVBoxLayout" name="verticalLayout">
19
     <item>
20
      <layout class="QHBoxLayout" name="horizontalLayout_2">
21
       <item>
22
        <layout class="QVBoxLayout" name="verticalLayout_3">
23
         <item>
24
          <widget class="QLabel" name="label_2">
25
           <property name="text">
26
            <string>List</string>
27
           </property>
28
           <property name="alignment">
29
            <set>Qt::AlignCenter</set>
30
           </property>
31
          </widget>
32
         </item>
33
         <item>
34
          <widget class="QTableWidget" name="tableWidgetList">
35
           <property name="columnCount">
36
            <number>1</number>
37
           </property>
38
           <attribute name="verticalHeaderVisible">
39
            <bool>false</bool>
40
           </attribute>
41
           <column/>
42
          </widget>
43
         </item>
44
        </layout>
45
       </item>
46
       <item>
47
        <layout class="QVBoxLayout" name="verticalLayout_2">
48
         <item>
49
          <widget class="QPushButton" name="pushButtonAddList">
50
           <property name="text">
51
            <string>추가</string>
52
           </property>
53
          </widget>
54
         </item>
55
         <item>
56
          <widget class="QPushButton" name="pushButton_5">
57
           <property name="text">
58
            <string>PushButton</string>
59
           </property>
60
          </widget>
61
         </item>
62
        </layout>
63
       </item>
64
       <item>
65
        <layout class="QVBoxLayout" name="verticalLayout_4">
66
         <item>
67
          <widget class="QLabel" name="label">
68
           <property name="text">
69
            <string>Selected</string>
70
           </property>
71
           <property name="alignment">
72
            <set>Qt::AlignCenter</set>
73
           </property>
74
          </widget>
75
         </item>
76
         <item>
77
          <widget class="QTableWidget" name="tableWidgetSelected">
78
           <property name="columnCount">
79
            <number>1</number>
80
           </property>
81
           <attribute name="horizontalHeaderVisible">
82
            <bool>true</bool>
83
           </attribute>
84
           <attribute name="horizontalHeaderHighlightSections">
85
            <bool>true</bool>
86
           </attribute>
87
           <attribute name="horizontalHeaderMinimumSectionSize">
88
            <number>34</number>
89
           </attribute>
90
           <attribute name="horizontalHeaderShowSortIndicator" stdset="0">
91
            <bool>false</bool>
92
           </attribute>
93
           <attribute name="verticalHeaderVisible">
94
            <bool>false</bool>
95
           </attribute>
96
           <attribute name="verticalHeaderMinimumSectionSize">
97
            <number>23</number>
98
           </attribute>
99
           <column/>
100
          </widget>
101
         </item>
102
         <item>
103
          <layout class="QHBoxLayout" name="horizontalLayout_4">
104
           <item>
105
            <widget class="QPushButton" name="pushButton_6">
106
             <property name="text">
107
              <string>PushButton</string>
108
             </property>
109
            </widget>
110
           </item>
111
           <item>
112
            <widget class="QPushButton" name="pushButtonMakeTrainingData">
113
             <property name="text">
114
              <string>학습 데이터 생성</string>
115
             </property>
116
            </widget>
117
           </item>
118
          </layout>
119
         </item>
120
        </layout>
121
       </item>
122
      </layout>
123
     </item>
124
     <item>
125
      <layout class="QHBoxLayout" name="horizontalLayout">
126
       <item>
127
        <widget class="QPushButton" name="pushButton_3">
128
         <property name="text">
129
          <string>PushButton</string>
130
         </property>
131
        </widget>
132
       </item>
133
       <item>
134
        <widget class="QLineEdit" name="lineEdit">
135
         <property name="maximumSize">
136
          <size>
137
           <width>80</width>
138
           <height>16777215</height>
139
          </size>
140
         </property>
141
        </widget>
142
       </item>
143
       <item>
144
        <spacer name="horizontalSpacer">
145
         <property name="orientation">
146
          <enum>Qt::Horizontal</enum>
147
         </property>
148
         <property name="sizeHint" stdset="0">
149
          <size>
150
           <width>40</width>
151
           <height>20</height>
152
          </size>
153
         </property>
154
        </spacer>
155
       </item>
156
       <item>
157
        <widget class="QPushButton" name="pushButton_2">
158
         <property name="text">
159
          <string>PushButton</string>
160
         </property>
161
        </widget>
162
       </item>
163
       <item>
164
        <widget class="QPushButton" name="pushButton">
165
         <property name="text">
166
          <string>PushButton</string>
167
         </property>
168
        </widget>
169
       </item>
170
      </layout>
171
     </item>
172
    </layout>
173
   </item>
174
  </layout>
175
 </widget>
176
 <resources/>
177
 <connections/>
178
</ui>

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)