프로젝트

일반

사용자정보

개정판 88165102

ID88165102f3189a79448abc11989718d101ce2fde
상위 4f79bc95
하위 2e37d8ef, acc85f56

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

issue #506: fix text

Change-Id: Ibbb274188803e5e3a26cd0686f8042b0eb75975e

차이점 보기:

DTI_PID/DTI_PID/TextInfo.py
4 4

  
5 5
class TextInfo:
6 6
    def __init__(self, text, x, y, w, h, angle):
7
        self._text = text.replace('—', '-')  # TODO: check this code!!!
7
        self._text = text
8 8
        self.text_area = QRect(x, y, w, h)
9 9
        """
10 10
        self.x = x
DTI_PID/DTI_PID/tesseract_ocr_module.py
219 219
                    transform.translate(-imgWidth * 0.5, -imgHeight * 0.5)
220 220
                    text_rect = transform.mapRect(text_rect)
221 221

  
222
                text_info = ti.TextInfo(text, startPoint[0] + text_rect.left() - thickness,
222
                text_info = ti.TextInfo(text_filter(text), startPoint[0] + text_rect.left() - thickness,
223 223
                                        startPoint[1] + text_rect.top() - thickness,
224 224
                                        text_rect.width(), text_rect.height(), angle)
225 225
                textInfoList.append(text_info)
......
236 236
        App.mainWnd().addMessage.emit(MessageType.Error, message)
237 237
        return None
238 238

  
239
    def text_filter(self, text):
240
        """ fix input text """
241
        text = text.replace('—', '-').replace('--', '-')
242
        return text

내보내기 Unified diff

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