개정판 01d50054
issue #478:
- fixed progress of recognition
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
107 | 107 |
configs = appDocData.getConfigs('Small Object Size', 'Max Area') |
108 | 108 |
maxArea = int(configs[0].value) if 1 == len(configs) else 50 |
109 | 109 |
|
110 |
_,contours,_ = cv2.findContours(image, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE);
|
|
110 |
_,contours,_ = cv2.findContours(image, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) |
|
111 | 111 |
selectedContours=[] |
112 | 112 |
for contour in contours: |
113 | 113 |
area = cv2.contourArea(contour) |
... | ... | |
271 | 271 |
else: |
272 | 272 |
maxProgressValue += 1 |
273 | 273 |
### up to here |
274 |
maxProgressValue = maxProgressValue*2 |
|
274 | 275 |
threadLock.release() |
275 | 276 |
|
276 | 277 |
if worker.isSymbolChecked: |
... | ... | |
319 | 320 |
titleBlockTextInfoList = None |
320 | 321 |
if worker.isTextChecked: |
321 | 322 |
textAreas = textDetector.detectTextAreas(area.img if area is not None else appDocData.imgSrc, offset) |
322 |
maxProgressValue = len(textAreas) + 1 |
|
323 |
if maxProgressValue < 2*len(textAreas): |
|
324 |
for _ in range(len(textAreas)-int(maxProgressValue*0.5)): |
|
325 |
worker.updateProgress.emit(2*len(textAreas), None) |
|
326 |
maxProgressValue = 2*len(textAreas) |
|
327 |
else: |
|
328 |
maxProgressValue = int(maxProgressValue*0.5) + len(textAreas) |
|
323 | 329 |
|
324 | 330 |
worker.displayTitle.emit('텍스트 인식 중...') |
325 | 331 |
#textDetector.recognizeText(appDocData.imgSrc, (0,0), textAreas, searchedSymbolList, worker, listWidget, maxProgressValue) |
내보내기 Unified diff