개정판 94c4cd85
issue #478:
- connect text's onRemoved signal for other text
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1603 | 1603 |
item.size = (width, height) |
1604 | 1604 |
item.angle = angle |
1605 | 1605 |
item.area = textInfoMap[0] |
1606 |
#self.addTextItemToScene(item)
|
|
1606 |
item.transfer.onRemoved.connect(self.itemRemoved)
|
|
1607 | 1607 |
appDocData.texts.append(item) |
1608 | 1608 |
appDocData.allItems.append(item) |
1609 | 1609 |
except Exception as ex: |
DTI_PID/DTI_PID/OcrResultDialog.py | ||
---|---|---|
191 | 191 |
@brief Display this QDialog |
192 | 192 |
''' |
193 | 193 |
def showDialog(self): |
194 |
self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) |
|
195 |
#self.show() |
|
194 |
#self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) |
|
196 | 195 |
self.exec_() |
197 | 196 |
return (self.isAccepted, self.textInfoList) |
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
238 | 238 |
# remove equipment desc. area |
239 | 239 |
configs = appDocData.getConfigs('{} Equipment Desc Area'.format(appDocData.imgName)) |
240 | 240 |
for config in configs: |
241 |
found = re.findall('\d+', config.value) |
|
241 |
found = re.findall('\\d+', config.value) |
|
242 |
if len(found) == 4: |
|
243 |
cv2.rectangle(appDocData.imgSrc, (int(found[0]), int(found[1])), (int(found[0])+int(found[2]), int(found[1])+int(found[3])), 255, -1) |
|
244 |
|
|
245 |
configs = appDocData.getConfigs('{} Typical Area'.format(appDocData.imgName)) |
|
246 |
for config in configs: |
|
247 |
found = re.findall('\\d+', config.value) |
|
242 | 248 |
if len(found) == 4: |
243 | 249 |
cv2.rectangle(appDocData.imgSrc, (int(found[0]), int(found[1])), (int(found[0])+int(found[2]), int(found[1])+int(found[3])), 255, -1) |
244 | 250 |
# up to here |
DTI_PID/DTI_PID/TextDetector.py | ||
---|---|---|
209 | 209 |
y = tInfo.getY() - round(offset[1]) |
210 | 210 |
img = imgOCR[y:y+tInfo.getH(), x:x+tInfo.getW()] |
211 | 211 | |
212 |
cv2.imwrite('c:\\temp\\ocr.png', img) |
|
212 |
#cv2.imwrite('c:\\temp\\ocr.png', img)
|
|
213 | 213 | |
214 | 214 |
# set angle 0 if symbol contains the text area is instrumentation |
215 | 215 |
category = None |
내보내기 Unified diff