개정판 ae485d03
issue #506: fix img lost
Change-Id: Ia791b8c97fab8e6ac0257f27bedb9e169b499e23
DTI_PID/DTI_PID/OcrResultDialog.py | ||
---|---|---|
236 | 236 |
else: |
237 | 237 |
self.ui.detectResultTextEdit.setText(self.tr("Not Found")) |
238 | 238 |
else: |
239 |
cv_image = cv2.threshold(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), 200, 255, cv2.THRESH_BINARY)[1]
|
|
239 |
cv_image = cv2.threshold(cv2.cvtColor(self.img_ocr, cv2.COLOR_BGR2GRAY), 200, 255, cv2.THRESH_BINARY)[1]
|
|
240 | 240 |
# contours 추출 |
241 | 241 |
contours, _ = cv2.findContours(cv_image, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) |
242 | 242 |
text_info_list = [] |
... | ... | |
249 | 249 |
and text_info.contains(_text_info.center)])] |
250 | 250 |
|
251 | 251 |
detector = TextDetector() |
252 |
detector.recognizeText(img, (0, 0), text_info_list, None, None, None, None, onlyTextArea=True)
|
|
252 |
detector.recognizeText(self.img_ocr, (0, 0), text_info_list, None, None, None, None, onlyTextArea=True)
|
|
253 | 253 |
self.textInfoList = detector.textInfoList.copy() |
254 | 254 |
self.textInfoList.sort(key=lambda x: x.getY()) |
255 | 255 |
|
내보내기 Unified diff