개정판 385c48f3
issue #506: add setting text area expansion offset
Change-Id: Idf9dfbda9053a9d0aa07ac5926a81a7314fa1684
DTI_PID/DTI_PID/ConfigurationDialog.py | ||
---|---|---|
79 | 79 |
self.set_ocr_engine_modes() |
80 | 80 |
configs = docData.getConfigs('Text Recognition', 'White Single Text') |
81 | 81 |
self.ui.lineEditSingleText.setText(configs[0].value) if 1 == len(configs) else \ |
82 |
self.ui.lineEditSingleText.setText('H,L') |
|
82 |
self.ui.lineEditSingleText.setText('H,L,1,2,3,4,5,6,7,8,9,0') |
|
83 |
configs = docData.getConfigs('Text Recognition', 'Area Offset') |
|
84 |
self.ui.spinBoxTextAreaOffset.setValue(int(configs[0].value)) if 1 == len(configs) else \ |
|
85 |
self.ui.spinBoxTextAreaOffset.setValue(20) |
|
83 | 86 |
|
84 | 87 |
configs = docData.getConfigs('Text Size', 'Min Text Size') |
85 | 88 |
self.ui.minTextSizeSpinBox.setValue(int(configs[0].value)) if 1 == len(configs) else \ |
... | ... | |
887 | 890 |
configs.append(Config('Text Recognition', 'Expand Size', self.ui.spinBoxExpandSize.value())) |
888 | 891 |
configs.append(Config('Text Recognition', 'Shrink Size', self.ui.spinBoxShrinkSize.value())) |
889 | 892 |
configs.append(Config('Text Recognition', 'Merge Size', self.ui.spinBoxMergeSize.value())) |
893 |
configs.append(Config('Text Recognition', 'Area Offset', self.ui.spinBoxTextAreaOffset.value())) |
|
890 | 894 |
|
891 | 895 |
configs.append(Config('Text Size', 'Min Text Size', self.ui.minTextSizeSpinBox.value())) |
892 | 896 |
configs.append(Config('Text Size', 'Max Text Size', self.ui.maxTextSizeSpinBox.value())) |
DTI_PID/DTI_PID/Configuration_UI.py | ||
---|---|---|
1 | 1 |
# -*- coding: utf-8 -*- |
2 | 2 |
|
3 |
# Form implementation generated from reading ui file '.\UI\Configuration.ui'
|
|
3 |
# Form implementation generated from reading ui file './UI/Configuration.ui'
|
|
4 | 4 |
# |
5 |
# Created by: PyQt5 UI code generator 5.14.1
|
|
5 |
# Created by: PyQt5 UI code generator 5.11.3
|
|
6 | 6 |
# |
7 | 7 |
# WARNING! All changes made in this file will be lost! |
8 | 8 |
|
9 |
|
|
10 | 9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
11 | 10 |
|
12 |
|
|
13 | 11 |
class Ui_ConfigurationDialog(object): |
14 | 12 |
def setupUi(self, ConfigurationDialog): |
15 | 13 |
ConfigurationDialog.setObjectName("ConfigurationDialog") |
... | ... | |
110 | 108 |
self.gridLayout_14.setObjectName("gridLayout_14") |
111 | 109 |
self.gridLayout_25 = QtWidgets.QGridLayout() |
112 | 110 |
self.gridLayout_25.setObjectName("gridLayout_25") |
111 |
self.comboBoxOCRData = QtWidgets.QComboBox(self.groupBoxText) |
|
112 |
self.comboBoxOCRData.setMinimumSize(QtCore.QSize(200, 0)) |
|
113 |
self.comboBoxOCRData.setMaximumSize(QtCore.QSize(200, 16777215)) |
|
114 |
self.comboBoxOCRData.setObjectName("comboBoxOCRData") |
|
115 |
self.gridLayout_25.addWidget(self.comboBoxOCRData, 0, 1, 1, 1) |
|
116 |
self.label_22 = QtWidgets.QLabel(self.groupBoxText) |
|
117 |
self.label_22.setObjectName("label_22") |
|
118 |
self.gridLayout_25.addWidget(self.label_22, 7, 0, 1, 1) |
|
113 | 119 |
self.label_7 = QtWidgets.QLabel(self.groupBoxText) |
114 | 120 |
self.label_7.setObjectName("label_7") |
115 | 121 |
self.gridLayout_25.addWidget(self.label_7, 1, 0, 1, 1) |
116 | 122 |
self.lineEditSingleText = QtWidgets.QLineEdit(self.groupBoxText) |
117 | 123 |
self.lineEditSingleText.setObjectName("lineEditSingleText") |
118 | 124 |
self.gridLayout_25.addWidget(self.lineEditSingleText, 4, 1, 1, 1) |
125 |
self.spinBoxExpandSize = QtWidgets.QSpinBox(self.groupBoxText) |
|
126 |
self.spinBoxExpandSize.setMinimumSize(QtCore.QSize(100, 0)) |
|
127 |
self.spinBoxExpandSize.setObjectName("spinBoxExpandSize") |
|
128 |
self.gridLayout_25.addWidget(self.spinBoxExpandSize, 5, 1, 1, 1) |
|
119 | 129 |
self.maxTextSizeSpinBox = QtWidgets.QSpinBox(self.groupBoxText) |
120 | 130 |
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) |
121 | 131 |
sizePolicy.setHorizontalStretch(0) |
... | ... | |
125 | 135 |
self.maxTextSizeSpinBox.setProperty("value", 60) |
126 | 136 |
self.maxTextSizeSpinBox.setObjectName("maxTextSizeSpinBox") |
127 | 137 |
self.gridLayout_25.addWidget(self.maxTextSizeSpinBox, 6, 3, 1, 1) |
128 |
self.spinBoxExpandSize = QtWidgets.QSpinBox(self.groupBoxText) |
|
129 |
self.spinBoxExpandSize.setMinimumSize(QtCore.QSize(100, 0)) |
|
130 |
self.spinBoxExpandSize.setObjectName("spinBoxExpandSize") |
|
131 |
self.gridLayout_25.addWidget(self.spinBoxExpandSize, 5, 1, 1, 1) |
|
132 | 138 |
self.comboBoxPageSegmentationModes = QtWidgets.QComboBox(self.groupBoxText) |
133 | 139 |
self.comboBoxPageSegmentationModes.setObjectName("comboBoxPageSegmentationModes") |
134 | 140 |
self.gridLayout_25.addWidget(self.comboBoxPageSegmentationModes, 2, 1, 1, 3) |
135 | 141 |
self.label_17 = QtWidgets.QLabel(self.groupBoxText) |
136 | 142 |
self.label_17.setObjectName("label_17") |
137 | 143 |
self.gridLayout_25.addWidget(self.label_17, 6, 0, 1, 1) |
138 |
self.label_22 = QtWidgets.QLabel(self.groupBoxText) |
|
139 |
self.label_22.setObjectName("label_22") |
|
140 |
self.gridLayout_25.addWidget(self.label_22, 7, 0, 1, 1) |
|
141 | 144 |
self.lineEditWhiteCharList = QtWidgets.QLineEdit(self.groupBoxText) |
142 | 145 |
self.lineEditWhiteCharList.setObjectName("lineEditWhiteCharList") |
143 | 146 |
self.gridLayout_25.addWidget(self.lineEditWhiteCharList, 1, 1, 1, 3) |
144 |
self.comboBoxOCRData = QtWidgets.QComboBox(self.groupBoxText) |
|
145 |
self.comboBoxOCRData.setMinimumSize(QtCore.QSize(200, 0)) |
|
146 |
self.comboBoxOCRData.setMaximumSize(QtCore.QSize(200, 16777215)) |
|
147 |
self.comboBoxOCRData.setObjectName("comboBoxOCRData") |
|
148 |
self.gridLayout_25.addWidget(self.comboBoxOCRData, 0, 1, 1, 1) |
|
147 |
self.spinBoxMergeSize = QtWidgets.QSpinBox(self.groupBoxText) |
|
148 |
self.spinBoxMergeSize.setMinimumSize(QtCore.QSize(100, 0)) |
|
149 |
self.spinBoxMergeSize.setObjectName("spinBoxMergeSize") |
|
150 |
self.gridLayout_25.addWidget(self.spinBoxMergeSize, 7, 1, 1, 1) |
|
151 |
self.comboBoxOCREngineMode = QtWidgets.QComboBox(self.groupBoxText) |
|
152 |
self.comboBoxOCREngineMode.setObjectName("comboBoxOCREngineMode") |
|
153 |
self.gridLayout_25.addWidget(self.comboBoxOCREngineMode, 3, 1, 1, 3) |
|
149 | 154 |
self.label_18 = QtWidgets.QLabel(self.groupBoxText) |
150 | 155 |
self.label_18.setObjectName("label_18") |
151 | 156 |
self.gridLayout_25.addWidget(self.label_18, 6, 2, 1, 1) |
152 |
self.label_39 = QtWidgets.QLabel(self.groupBoxText) |
|
153 |
self.label_39.setObjectName("label_39") |
|
154 |
self.gridLayout_25.addWidget(self.label_39, 2, 0, 1, 1) |
|
155 |
self.label_20 = QtWidgets.QLabel(self.groupBoxText) |
|
156 |
self.label_20.setObjectName("label_20") |
|
157 |
self.gridLayout_25.addWidget(self.label_20, 5, 0, 1, 1) |
|
158 | 157 |
self.label_21 = QtWidgets.QLabel(self.groupBoxText) |
159 | 158 |
self.label_21.setObjectName("label_21") |
160 | 159 |
self.gridLayout_25.addWidget(self.label_21, 5, 2, 1, 1) |
160 |
self.label_37 = QtWidgets.QLabel(self.groupBoxText) |
|
161 |
self.label_37.setObjectName("label_37") |
|
162 |
self.gridLayout_25.addWidget(self.label_37, 4, 0, 1, 1) |
|
163 |
self.spinBoxShrinkSize = QtWidgets.QSpinBox(self.groupBoxText) |
|
164 |
self.spinBoxShrinkSize.setMinimumSize(QtCore.QSize(100, 0)) |
|
165 |
self.spinBoxShrinkSize.setObjectName("spinBoxShrinkSize") |
|
166 |
self.gridLayout_25.addWidget(self.spinBoxShrinkSize, 5, 3, 1, 1) |
|
167 |
self.label_43 = QtWidgets.QLabel(self.groupBoxText) |
|
168 |
self.label_43.setObjectName("label_43") |
|
169 |
self.gridLayout_25.addWidget(self.label_43, 3, 0, 1, 1) |
|
170 |
self.labelTesseractVersion = QtWidgets.QLabel(self.groupBoxText) |
|
171 |
self.labelTesseractVersion.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) |
|
172 |
self.labelTesseractVersion.setObjectName("labelTesseractVersion") |
|
173 |
self.gridLayout_25.addWidget(self.labelTesseractVersion, 0, 2, 1, 2) |
|
174 |
self.label_39 = QtWidgets.QLabel(self.groupBoxText) |
|
175 |
self.label_39.setObjectName("label_39") |
|
176 |
self.gridLayout_25.addWidget(self.label_39, 2, 0, 1, 1) |
|
161 | 177 |
self.label_19 = QtWidgets.QLabel(self.groupBoxText) |
162 | 178 |
self.label_19.setObjectName("label_19") |
163 | 179 |
self.gridLayout_25.addWidget(self.label_19, 0, 0, 1, 1) |
164 |
self.spinBoxMergeSize = QtWidgets.QSpinBox(self.groupBoxText) |
|
165 |
self.spinBoxMergeSize.setMinimumSize(QtCore.QSize(100, 0)) |
|
166 |
self.spinBoxMergeSize.setObjectName("spinBoxMergeSize") |
|
167 |
self.gridLayout_25.addWidget(self.spinBoxMergeSize, 7, 1, 1, 1) |
|
168 | 180 |
self.minTextSizeSpinBox = QtWidgets.QSpinBox(self.groupBoxText) |
169 | 181 |
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) |
170 | 182 |
sizePolicy.setHorizontalStretch(0) |
... | ... | |
175 | 187 |
self.minTextSizeSpinBox.setProperty("value", 30) |
176 | 188 |
self.minTextSizeSpinBox.setObjectName("minTextSizeSpinBox") |
177 | 189 |
self.gridLayout_25.addWidget(self.minTextSizeSpinBox, 6, 1, 1, 1) |
178 |
self.spinBoxShrinkSize = QtWidgets.QSpinBox(self.groupBoxText) |
|
179 |
self.spinBoxShrinkSize.setMinimumSize(QtCore.QSize(100, 0)) |
|
180 |
self.spinBoxShrinkSize.setObjectName("spinBoxShrinkSize") |
|
181 |
self.gridLayout_25.addWidget(self.spinBoxShrinkSize, 5, 3, 1, 1) |
|
182 |
self.label_37 = QtWidgets.QLabel(self.groupBoxText) |
|
183 |
self.label_37.setObjectName("label_37") |
|
184 |
self.gridLayout_25.addWidget(self.label_37, 4, 0, 1, 1) |
|
185 |
self.labelTesseractVersion = QtWidgets.QLabel(self.groupBoxText) |
|
186 |
self.labelTesseractVersion.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) |
|
187 |
self.labelTesseractVersion.setObjectName("labelTesseractVersion") |
|
188 |
self.gridLayout_25.addWidget(self.labelTesseractVersion, 0, 2, 1, 2) |
|
189 |
self.label_43 = QtWidgets.QLabel(self.groupBoxText) |
|
190 |
self.label_43.setObjectName("label_43") |
|
191 |
self.gridLayout_25.addWidget(self.label_43, 3, 0, 1, 1) |
|
192 |
self.comboBoxOCREngineMode = QtWidgets.QComboBox(self.groupBoxText) |
|
193 |
self.comboBoxOCREngineMode.setObjectName("comboBoxOCREngineMode") |
|
194 |
self.gridLayout_25.addWidget(self.comboBoxOCREngineMode, 3, 1, 1, 3) |
|
190 |
self.label_20 = QtWidgets.QLabel(self.groupBoxText) |
|
191 |
self.label_20.setObjectName("label_20") |
|
192 |
self.gridLayout_25.addWidget(self.label_20, 5, 0, 1, 1) |
|
193 |
self.label_44 = QtWidgets.QLabel(self.groupBoxText) |
|
194 |
self.label_44.setObjectName("label_44") |
|
195 |
self.gridLayout_25.addWidget(self.label_44, 8, 0, 1, 1) |
|
196 |
self.spinBoxTextAreaOffset = QtWidgets.QSpinBox(self.groupBoxText) |
|
197 |
self.spinBoxTextAreaOffset.setObjectName("spinBoxTextAreaOffset") |
|
198 |
self.gridLayout_25.addWidget(self.spinBoxTextAreaOffset, 8, 1, 1, 1) |
|
195 | 199 |
self.gridLayout_14.addLayout(self.gridLayout_25, 0, 0, 1, 1) |
196 | 200 |
self.gridLayout_2.addWidget(self.groupBoxText, 0, 1, 1, 1) |
197 | 201 |
self.groupBoxAttribute = QtWidgets.QGroupBox(self.Recognition) |
... | ... | |
756 | 760 |
_translate = QtCore.QCoreApplication.translate |
757 | 761 |
ConfigurationDialog.setWindowTitle(_translate("ConfigurationDialog", "Configuration")) |
758 | 762 |
self.groupBoxFilter.setTitle(_translate("ConfigurationDialog", "Filter")) |
763 |
self.lineEditBinaryValue.setText(_translate("ConfigurationDialog", "0")) |
|
759 | 764 |
self.radioButtonNoThreshold.setText(_translate("ConfigurationDialog", "No")) |
760 | 765 |
self.radioButtonOTSU.setText(_translate("ConfigurationDialog", "OTSU")) |
761 | 766 |
self.radioButtonBinary.setText(_translate("ConfigurationDialog", "Binary")) |
762 | 767 |
self.label_41.setText(_translate("ConfigurationDialog", "thres = ")) |
763 | 768 |
self.label_42.setText(_translate("ConfigurationDialog", "thres = ")) |
769 |
self.lineEditOTSUValue.setText(_translate("ConfigurationDialog", "0")) |
|
764 | 770 |
self.label_32.setText(_translate("ConfigurationDialog", "Drawing Flattening Step : ")) |
765 | 771 |
self.label_38.setText(_translate("ConfigurationDialog", "Gaussian Blur")) |
766 | 772 |
self.label_33.setText(_translate("ConfigurationDialog", "Unrecognition Ignore Step : ")) |
... | ... | |
769 | 775 |
self.label_29.setText(_translate("ConfigurationDialog", "Drawing Thickness Reinforcement Step : ")) |
770 | 776 |
self.checkBoxApplyGaussianBlur.setText(_translate("ConfigurationDialog", "Apply")) |
771 | 777 |
self.groupBoxText.setTitle(_translate("ConfigurationDialog", "Text Detection")) |
778 |
self.label_22.setText(_translate("ConfigurationDialog", "Merge Size : ")) |
|
772 | 779 |
self.label_7.setText(_translate("ConfigurationDialog", "Detected string : ")) |
773 | 780 |
self.label_17.setText(_translate("ConfigurationDialog", "Minimum Text Size : ")) |
774 |
self.label_22.setText(_translate("ConfigurationDialog", "Merge Size : ")) |
|
775 | 781 |
self.label_18.setText(_translate("ConfigurationDialog", "Maximum Text Size : ")) |
776 |
self.label_39.setText(_translate("ConfigurationDialog", "Page segmentations modes")) |
|
777 |
self.label_20.setText(_translate("ConfigurationDialog", "Expansion Size : ")) |
|
778 | 782 |
self.label_21.setText(_translate("ConfigurationDialog", "Erosion Size : ")) |
779 |
self.label_19.setText(_translate("ConfigurationDialog", "OCR Source : ")) |
|
780 | 783 |
self.label_37.setText(_translate("ConfigurationDialog", "Allowed Single Text : ")) |
781 |
self.labelTesseractVersion.setText(_translate("ConfigurationDialog", "TextLabel")) |
|
782 | 784 |
self.label_43.setText(_translate("ConfigurationDialog", "OCR Engine Mode")) |
785 |
self.labelTesseractVersion.setText(_translate("ConfigurationDialog", "TextLabel")) |
|
786 |
self.label_39.setText(_translate("ConfigurationDialog", "Page segmentations modes")) |
|
787 |
self.label_19.setText(_translate("ConfigurationDialog", "OCR Source : ")) |
|
788 |
self.label_20.setText(_translate("ConfigurationDialog", "Expansion Size : ")) |
|
789 |
self.label_44.setText(_translate("ConfigurationDialog", "Text Area Offset : ")) |
|
783 | 790 |
self.groupBoxAttribute.setTitle(_translate("ConfigurationDialog", "Attribute")) |
784 | 791 |
self.label_6.setText(_translate("ConfigurationDialog", "Size Delimiter : ")) |
785 | 792 |
self.label_24.setText(_translate("ConfigurationDialog", "Line Flow Mark Position(Percent) : ")) |
... | ... | |
850 | 857 |
self.radioButtonSaveUnknownNo.setText(_translate("ConfigurationDialog", "No")) |
851 | 858 |
self.pushButtonClearAccessInfo.setText(_translate("ConfigurationDialog", "Clear")) |
852 | 859 |
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabETC), _translate("ConfigurationDialog", "ETC")) |
860 |
|
|
853 | 861 |
import MainWindow_rc |
862 |
|
|
863 |
if __name__ == "__main__": |
|
864 |
import sys |
|
865 |
app = QtWidgets.QApplication(sys.argv) |
|
866 |
ConfigurationDialog = QtWidgets.QDialog() |
|
867 |
ui = Ui_ConfigurationDialog() |
|
868 |
ui.setupUi(ConfigurationDialog) |
|
869 |
ConfigurationDialog.show() |
|
870 |
sys.exit(app.exec_()) |
|
871 |
|
DTI_PID/DTI_PID/UI/Configuration.ui | ||
---|---|---|
7 | 7 |
<x>0</x> |
8 | 8 |
<y>0</y> |
9 | 9 |
<width>768</width> |
10 |
<height>739</height>
|
|
10 |
<height>766</height>
|
|
11 | 11 |
</rect> |
12 | 12 |
</property> |
13 | 13 |
<property name="font"> |
... | ... | |
47 | 47 |
<item row="2" column="1"> |
48 | 48 |
<layout class="QGridLayout" name="gridLayout_35"> |
49 | 49 |
<item row="2" column="2"> |
50 |
<widget class="QLineEdit" name="lineEditBinaryValue"/> |
|
50 |
<widget class="QLineEdit" name="lineEditBinaryValue"> |
|
51 |
<property name="text"> |
|
52 |
<string>0</string> |
|
53 |
</property> |
|
54 |
</widget> |
|
51 | 55 |
</item> |
52 | 56 |
<item row="0" column="0"> |
53 | 57 |
<widget class="QRadioButton" name="radioButtonNoThreshold"> |
... | ... | |
85 | 89 |
</widget> |
86 | 90 |
</item> |
87 | 91 |
<item row="1" column="2"> |
88 |
<widget class="QLineEdit" name="lineEditOTSUValue"/> |
|
92 |
<widget class="QLineEdit" name="lineEditOTSUValue"> |
|
93 |
<property name="text"> |
|
94 |
<string>0</string> |
|
95 |
</property> |
|
96 |
</widget> |
|
89 | 97 |
</item> |
90 | 98 |
</layout> |
91 | 99 |
</item> |
... | ... | |
205 | 213 |
<layout class="QGridLayout" name="gridLayout_14"> |
206 | 214 |
<item row="0" column="0"> |
207 | 215 |
<layout class="QGridLayout" name="gridLayout_25"> |
216 |
<item row="0" column="1"> |
|
217 |
<widget class="QComboBox" name="comboBoxOCRData"> |
|
218 |
<property name="minimumSize"> |
|
219 |
<size> |
|
220 |
<width>200</width> |
|
221 |
<height>0</height> |
|
222 |
</size> |
|
223 |
</property> |
|
224 |
<property name="maximumSize"> |
|
225 |
<size> |
|
226 |
<width>200</width> |
|
227 |
<height>16777215</height> |
|
228 |
</size> |
|
229 |
</property> |
|
230 |
</widget> |
|
231 |
</item> |
|
232 |
<item row="7" column="0"> |
|
233 |
<widget class="QLabel" name="label_22"> |
|
234 |
<property name="text"> |
|
235 |
<string>Merge Size : </string> |
|
236 |
</property> |
|
237 |
</widget> |
|
238 |
</item> |
|
208 | 239 |
<item row="1" column="0"> |
209 | 240 |
<widget class="QLabel" name="label_7"> |
210 | 241 |
<property name="text"> |
... | ... | |
215 | 246 |
<item row="4" column="1"> |
216 | 247 |
<widget class="QLineEdit" name="lineEditSingleText"/> |
217 | 248 |
</item> |
249 |
<item row="5" column="1"> |
|
250 |
<widget class="QSpinBox" name="spinBoxExpandSize"> |
|
251 |
<property name="minimumSize"> |
|
252 |
<size> |
|
253 |
<width>100</width> |
|
254 |
<height>0</height> |
|
255 |
</size> |
|
256 |
</property> |
|
257 |
</widget> |
|
258 |
</item> |
|
218 | 259 |
<item row="6" column="3"> |
219 | 260 |
<widget class="QSpinBox" name="maxTextSizeSpinBox"> |
220 | 261 |
<property name="sizePolicy"> |
... | ... | |
228 | 269 |
</property> |
229 | 270 |
</widget> |
230 | 271 |
</item> |
231 |
<item row="5" column="1"> |
|
232 |
<widget class="QSpinBox" name="spinBoxExpandSize"> |
|
233 |
<property name="minimumSize"> |
|
234 |
<size> |
|
235 |
<width>100</width> |
|
236 |
<height>0</height> |
|
237 |
</size> |
|
238 |
</property> |
|
239 |
</widget> |
|
240 |
</item> |
|
241 | 272 |
<item row="2" column="1" colspan="3"> |
242 | 273 |
<widget class="QComboBox" name="comboBoxPageSegmentationModes"/> |
243 | 274 |
</item> |
... | ... | |
248 | 279 |
</property> |
249 | 280 |
</widget> |
250 | 281 |
</item> |
251 |
<item row="7" column="0"> |
|
252 |
<widget class="QLabel" name="label_22"> |
|
253 |
<property name="text"> |
|
254 |
<string>Merge Size : </string> |
|
255 |
</property> |
|
256 |
</widget> |
|
257 |
</item> |
|
258 | 282 |
<item row="1" column="1" colspan="3"> |
259 | 283 |
<widget class="QLineEdit" name="lineEditWhiteCharList"/> |
260 | 284 |
</item> |
261 |
<item row="0" column="1">
|
|
262 |
<widget class="QComboBox" name="comboBoxOCRData">
|
|
285 |
<item row="7" column="1">
|
|
286 |
<widget class="QSpinBox" name="spinBoxMergeSize">
|
|
263 | 287 |
<property name="minimumSize"> |
264 | 288 |
<size> |
265 |
<width>200</width>
|
|
289 |
<width>100</width>
|
|
266 | 290 |
<height>0</height> |
267 | 291 |
</size> |
268 | 292 |
</property> |
269 |
<property name="maximumSize"> |
|
270 |
<size> |
|
271 |
<width>200</width> |
|
272 |
<height>16777215</height> |
|
273 |
</size> |
|
274 |
</property> |
|
275 | 293 |
</widget> |
276 | 294 |
</item> |
295 |
<item row="3" column="1" colspan="3"> |
|
296 |
<widget class="QComboBox" name="comboBoxOCREngineMode"/> |
|
297 |
</item> |
|
277 | 298 |
<item row="6" column="2"> |
278 | 299 |
<widget class="QLabel" name="label_18"> |
279 | 300 |
<property name="text"> |
... | ... | |
281 | 302 |
</property> |
282 | 303 |
</widget> |
283 | 304 |
</item> |
284 |
<item row="2" column="0"> |
|
285 |
<widget class="QLabel" name="label_39"> |
|
286 |
<property name="text"> |
|
287 |
<string>Page segmentations modes</string> |
|
288 |
</property> |
|
289 |
</widget> |
|
290 |
</item> |
|
291 |
<item row="5" column="0"> |
|
292 |
<widget class="QLabel" name="label_20"> |
|
293 |
<property name="text"> |
|
294 |
<string>Expansion Size : </string> |
|
295 |
</property> |
|
296 |
</widget> |
|
297 |
</item> |
|
298 | 305 |
<item row="5" column="2"> |
299 | 306 |
<widget class="QLabel" name="label_21"> |
300 | 307 |
<property name="text"> |
... | ... | |
302 | 309 |
</property> |
303 | 310 |
</widget> |
304 | 311 |
</item> |
305 |
<item row="0" column="0">
|
|
306 |
<widget class="QLabel" name="label_19">
|
|
312 |
<item row="4" column="0">
|
|
313 |
<widget class="QLabel" name="label_37">
|
|
307 | 314 |
<property name="text"> |
308 |
<string>OCR Source : </string>
|
|
315 |
<string>Allowed Single Text : </string>
|
|
309 | 316 |
</property> |
310 | 317 |
</widget> |
311 | 318 |
</item> |
312 |
<item row="7" column="1">
|
|
313 |
<widget class="QSpinBox" name="spinBoxMergeSize">
|
|
319 |
<item row="5" column="3">
|
|
320 |
<widget class="QSpinBox" name="spinBoxShrinkSize">
|
|
314 | 321 |
<property name="minimumSize"> |
315 | 322 |
<size> |
316 | 323 |
<width>100</width> |
... | ... | |
319 | 326 |
</property> |
320 | 327 |
</widget> |
321 | 328 |
</item> |
329 |
<item row="3" column="0"> |
|
330 |
<widget class="QLabel" name="label_43"> |
|
331 |
<property name="text"> |
|
332 |
<string>OCR Engine Mode</string> |
|
333 |
</property> |
|
334 |
</widget> |
|
335 |
</item> |
|
336 |
<item row="0" column="2" colspan="2"> |
|
337 |
<widget class="QLabel" name="labelTesseractVersion"> |
|
338 |
<property name="text"> |
|
339 |
<string>TextLabel</string> |
|
340 |
</property> |
|
341 |
<property name="alignment"> |
|
342 |
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
|
343 |
</property> |
|
344 |
</widget> |
|
345 |
</item> |
|
346 |
<item row="2" column="0"> |
|
347 |
<widget class="QLabel" name="label_39"> |
|
348 |
<property name="text"> |
|
349 |
<string>Page segmentations modes</string> |
|
350 |
</property> |
|
351 |
</widget> |
|
352 |
</item> |
|
353 |
<item row="0" column="0"> |
|
354 |
<widget class="QLabel" name="label_19"> |
|
355 |
<property name="text"> |
|
356 |
<string>OCR Source : </string> |
|
357 |
</property> |
|
358 |
</widget> |
|
359 |
</item> |
|
322 | 360 |
<item row="6" column="1"> |
323 | 361 |
<widget class="QSpinBox" name="minTextSizeSpinBox"> |
324 | 362 |
<property name="sizePolicy"> |
... | ... | |
338 | 376 |
</property> |
339 | 377 |
</widget> |
340 | 378 |
</item> |
341 |
<item row="5" column="3"> |
|
342 |
<widget class="QSpinBox" name="spinBoxShrinkSize"> |
|
343 |
<property name="minimumSize"> |
|
344 |
<size> |
|
345 |
<width>100</width> |
|
346 |
<height>0</height> |
|
347 |
</size> |
|
348 |
</property> |
|
349 |
</widget> |
|
350 |
</item> |
|
351 |
<item row="4" column="0"> |
|
352 |
<widget class="QLabel" name="label_37"> |
|
353 |
<property name="text"> |
|
354 |
<string>Allowed Single Text : </string> |
|
355 |
</property> |
|
356 |
</widget> |
|
357 |
</item> |
|
358 |
<item row="0" column="2" colspan="2"> |
|
359 |
<widget class="QLabel" name="labelTesseractVersion"> |
|
379 |
<item row="5" column="0"> |
|
380 |
<widget class="QLabel" name="label_20"> |
|
360 | 381 |
<property name="text"> |
361 |
<string>TextLabel</string> |
|
362 |
</property> |
|
363 |
<property name="alignment"> |
|
364 |
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> |
|
382 |
<string>Expansion Size : </string> |
|
365 | 383 |
</property> |
366 | 384 |
</widget> |
367 | 385 |
</item> |
368 |
<item row="3" column="0">
|
|
369 |
<widget class="QLabel" name="label_43">
|
|
386 |
<item row="8" column="0">
|
|
387 |
<widget class="QLabel" name="label_44">
|
|
370 | 388 |
<property name="text"> |
371 |
<string>OCR Engine Mode</string>
|
|
389 |
<string>Text Area Offset : </string>
|
|
372 | 390 |
</property> |
373 | 391 |
</widget> |
374 | 392 |
</item> |
375 |
<item row="3" column="1" colspan="3">
|
|
376 |
<widget class="QComboBox" name="comboBoxOCREngineMode"/>
|
|
393 |
<item row="8" column="1">
|
|
394 |
<widget class="QSpinBox" name="spinBoxTextAreaOffset"/>
|
|
377 | 395 |
</item> |
378 | 396 |
</layout> |
379 | 397 |
</item> |
... | ... | |
1550 | 1568 |
</connection> |
1551 | 1569 |
</connections> |
1552 | 1570 |
<buttongroups> |
1553 |
<buttongroup name="buttonGroup_4"/> |
|
1554 |
<buttongroup name="buttonGroup"/> |
|
1555 | 1571 |
<buttongroup name="buttonGroup_2"/> |
1572 |
<buttongroup name="buttonGroup"/> |
|
1556 | 1573 |
<buttongroup name="buttonGroup_3"/> |
1574 |
<buttongroup name="buttonGroup_4"/> |
|
1557 | 1575 |
</buttongroups> |
1558 | 1576 |
</ui> |
DTI_PID/DTI_PID/tesseract_ocr_module.py | ||
---|---|---|
100 | 100 |
allowed_single_chars = [] |
101 | 101 |
# up to here |
102 | 102 |
|
103 |
thickness = 10 |
|
103 |
configs = app_doc_data.getConfigs('Text Recognition', 'Area Offset') |
|
104 |
thickness = int(configs[0].value) if 1 == len(configs) else 20 |
|
105 |
|
|
104 | 106 |
im = Image.fromarray(img) |
105 | 107 |
# add padding to increase text recognition |
106 | 108 |
im = ImageOps.expand(im, border=thickness, fill='white') |
내보내기 Unified diff