프로젝트

일반

사용자정보

개정판 aa576697

IDaa576697923307d63703040c6418f7999ec28217
상위 4cf27a9b
하위 5e1adb5c

함의성이(가) 약 5년 전에 추가함

issue #506: fix text sort, text area, symbol creation

Change-Id: Ibd08ffb603ec0388fbbbc566477db68edb9aa917

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
523 523
        with self.project.database.connect() as conn:
524 524
            try:
525 525
                sql = self.project.database.to_sql("""
526
                    INSERT INTO Symbol(name, SymbolType_UID, threshold, minMatchPoint, isDetectOrigin, rotationCount, ocrOption, isContainChild, originalPoint, connectionPoint, baseSymbol, additionalSymbol, isExceptDetect, hasInstrumentLabel, width, height, flip) 
527
                    VALUES(?, (select UID from SymbolType where Type=?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
526
                    INSERT INTO Symbol(name, SymbolType_UID, threshold, minMatchPoint, isDetectOrigin, rotationCount, ocrOption, isContainChild, originalPoint, connectionPoint, baseSymbol, additionalSymbol, isExceptDetect, hasInstrumentLabel, width, height, flip, TextArea) 
527
                    VALUES(?, (select UID from SymbolType where Type=?), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
528 528
                """)
529 529

  
530 530
                cursor = conn.cursor()
......
534 534
                         , symbol.getOriginalPoint(), symbol.getConnectionPoint()
535 535
                         , symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getIsExceptDetect(),
536 536
                         symbol.getHasInstrumentLabel()
537
                         , symbol.width, symbol.height, symbol.detectFlip)
537
                         , symbol.width, symbol.height, symbol.detectFlip, symbol.text_area_str)
538 538
                cursor.execute(sql, query)
539 539
                conn.commit()
540 540
                isAdded = True
DTI_PID/DTI_PID/OcrResultDialog.py
228 228
                                                     conf=white_char_list[0].value if white_char_list else '')
229 229

  
230 230
                if self.textInfoList:
231
                    self.textInfoList = sorted(self.textInfoList, key=lambda param: param.getY())
231 232
                    self.ui.detectResultTextEdit.setText(self.getPlainText(self.textInfoList))
232 233
                    self.display_text_rect()
233 234

  
......
321 322
                            self.textInfoList[index].setText(splitText[index])
322 323
                    else:
323 324
                        self.textInfoList = self.getMergedTextInfo(text)
324
            elif len(self.textInfoList) > 1 or len(self.textInfoList) == 0:
325
            elif not self._text_item or len(self.textInfoList) > 1 or len(self.textInfoList) == 0:
325 326
                self.textInfoList = self.getMergedTextInfo(text)
326 327

  
327 328
            radian = round(math.radians(abs(self.angle)), 2)
DTI_PID/DTI_PID/tesseract_ocr_module.py
38 38

  
39 39
tesseract_path = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID', 'Tesseract-OCR')
40 40
DEFAULT_CONF = """
41
    --psm {} -c tessedit_char_whitelist=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-~.,/!@#$%&*(){}[]<>:;+=?\\"
41
    --psm {} -c tessedit_char_whitelist=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-~.,/z !@#$%&*(){}[]<>:;+=?\\"
42 42
"""
43 43
DEFAULT_CONF_COMM = "--psm {}"
44 44

  

내보내기 Unified diff

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