개정판 63d528f1
AreaEraserCommand, AreaOcrCommand 불필요한 코드 및 주석 삭제
DTI_PID/DTI_PID/Commands/AreaEraserCommand.py | ||
---|---|---|
54 | 54 |
pass |
55 | 55 |
|
56 | 56 |
def redo(self): |
57 |
pass |
|
58 |
|
|
59 |
def drawPixel(self, scenePos): |
|
60 |
image = self.imageViewer.image() |
|
61 |
point = QPoint(int(scenePos.x()), int(scenePos.y())) |
|
62 |
image.setPixel(point, 0xffffff) |
|
63 |
self.imageViewer.setImage(image) |
|
57 |
pass |
DTI_PID/DTI_PID/Commands/AreaOcrCommand.py | ||
---|---|---|
76 | 76 |
item.setPlainText(text) |
77 | 77 |
item.setDefaultTextColor(Qt.blue) |
78 | 78 |
item.addTextItemToScene(self.imageViewer.scene) |
79 |
#sx = 1 |
|
80 |
#sy = 1 |
|
81 |
#rect = None |
|
82 |
#transform = QTransform() |
|
83 |
#transform.translate(int(selectionBBox.x()), int(selectionBBox.y())) |
|
84 |
#if (1.57 == angle) or (4.71 == angle): |
|
85 |
# font = QFont('Arial', width*1.2) |
|
86 |
# item.setFont(font) |
|
87 |
# rect = item.boundingRect() |
|
88 |
# sx = width/rect.height() |
|
89 |
# sy = height/rect.width() |
|
90 |
|
|
91 |
# transform.translate(x, y) |
|
92 |
# transform.translate(width*0.5, height*0.5) |
|
93 |
# transform.scale(1, sy) |
|
94 |
# transform.rotateRadians(-angle) |
|
95 |
# transform.translate(-rect.width()*0.5, -rect.height()*0.5) |
|
96 |
#elif 3.14 == angle: |
|
97 |
# font = QFont('Arial', height*1.2) |
|
98 |
# item.setFont(font) |
|
99 |
# rect = item.boundingRect() |
|
100 |
# sx = width/rect.width() |
|
101 |
# sy = height/rect.height() |
|
102 |
|
|
103 |
# transform.translate(x, y - round((rect.height()-height)*0.5)) |
|
104 |
# transform.scale(sx, 1) |
|
105 |
# transform.rotateRadians(-angle) |
|
106 |
# transform.translate(-width*0.5, -height*0.5) |
|
107 |
#else: |
|
108 |
# font = QFont('Arial', height*1.2) |
|
109 |
# item.setFont(font) |
|
110 |
# rect = item.boundingRect() |
|
111 |
# sx = width/rect.width() |
|
112 |
# sy = height/rect.height() |
|
113 |
|
|
114 |
# #if '\n' not in text: |
|
115 |
# transform.translate(x, y - round((rect.height()-height)*0.5)) |
|
116 |
# transform.scale(sx, 1) |
|
117 |
# #else: |
|
118 |
# # transform.translate(x, y) |
|
119 |
# # transform.scale(sx, sy) |
|
120 |
#item.setTransform(transform) |
|
121 |
##item.setTextWidth(width) |
|
122 |
|
|
123 |
#self.imageViewer.scene.addItem(item) |
|
124 | 79 |
else: |
125 | 80 |
QMessageBox.about(self.imageViewer, "알림", "텍스트 검출 실패") |
126 | 81 |
finally: |
... | ... | |
133 | 88 |
pass |
134 | 89 |
|
135 | 90 |
def redo(self): |
136 |
pass |
|
137 |
|
|
138 |
#def convertQImageToCvMat(image): |
|
139 |
# format = image.format() |
|
140 |
# if format == QImage.Format_ARGB32 or format == QImage.Format_ARGB32_Premultiplied: |
|
91 |
pass |
내보내기 Unified diff