개정판 f8f80cba
issue #1366: improve label
Change-Id: Ia50296d335583b689c628a1ac1b4c2e09d2b4d1c
DTI_PID/DTI_PID/RecognitionDialog.py | ||
---|---|---|
1509 | 1509 |
symbolName = targetSymbol.getName() |
1510 | 1510 |
symbolType = targetSymbol.getType() |
1511 | 1511 |
symbolPath = targetSymbol.getPath() |
1512 |
symbolThreshold = targetSymbol.getThreshold() if not forTraining else targetSymbol.getThreshold() * 0.85
|
|
1512 |
symbolThreshold = targetSymbol.getThreshold() if not forTraining else targetSymbol.getThreshold() * 0.90
|
|
1513 | 1513 |
symbolMinMatchCount = targetSymbol.getMinMatchCount() |
1514 | 1514 |
isDetectOnOrigin = targetSymbol.getIsDetectOnOrigin() |
1515 | 1515 |
symbolRotateCount = targetSymbol.getRotationCount() |
... | ... | |
2054 | 2054 |
c_x, c_y, c_w, c_h = cv2.boundingRect(contour) |
2055 | 2055 |
area = cv2.contourArea(contour) |
2056 | 2056 |
if c_x <= x and c_x + c_w >= x and c_y <= y and c_y + c_h >= y: |
2057 |
if flange_count * flange_max * 2 >= area: |
|
2057 |
if flange_count * flange_max * 2.5 >= area:
|
|
2058 | 2058 |
#not_image[y, x] = 0 |
2059 | 2059 |
#from PIL import Image |
2060 | 2060 |
#Image.fromarray(not_image).show() |
DTI_PID/DTI_PID/TrainingSymbolImageListDialog.py | ||
---|---|---|
98 | 98 |
for symbol in symbol_list: |
99 | 99 |
if symbol.width and symbol.height: |
100 | 100 |
classes.append(symbol.getName()) |
101 |
if symbol.width > 450 or symbol.height > 450:
|
|
101 |
if symbol.width > 300 or symbol.height > 300:
|
|
102 | 102 |
bigs.append(symbol.getName()) |
103 | 103 |
|
104 | 104 |
app_web_service = AppWebService() |
... | ... | |
271 | 271 |
symbol_list = appDocData.getTargetSymbolList(all=True) |
272 | 272 |
for symbol in symbol_list: |
273 | 273 |
if symbol.width and symbol.height: |
274 |
if symbol.width > 450 or symbol.height > 450:
|
|
274 |
if symbol.width > 300 or symbol.height > 300:
|
|
275 | 275 |
bigs.append(symbol.getName()) |
276 | 276 |
|
277 | 277 |
for root in rootList: |
... | ... | |
468 | 468 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) |
469 | 469 |
imgNot = np.ones(img.shape, np.uint8) |
470 | 470 |
cv2.bitwise_not(img, imgNot) |
471 |
imgNot = cv2.dilate(imgNot, np.ones((8,8), np.uint8))
|
|
471 |
imgNot = cv2.dilate(imgNot, np.ones((4,4), np.uint8))
|
|
472 | 472 |
|
473 | 473 |
contours, hierarchy = cv2.findContours(imgNot, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) |
474 | 474 |
if len(contours) == 0: |
... | ... | |
476 | 476 |
else: |
477 | 477 |
for cnt in contours: |
478 | 478 |
x, y, w, h = cv2.boundingRect(cnt) |
479 |
boundarySymbolData.append([x, y, w, h]) |
|
479 |
if not (w < 30 or h < 30): |
|
480 |
boundarySymbolData.append([x, y, w, h]) |
|
480 | 481 |
except Exception as ex: |
481 | 482 |
from App import App |
482 | 483 |
from AppDocData import MessageType |
DTI_PID/DTI_PID/UI/TrainingSymbolImageList.ui | ||
---|---|---|
99 | 99 |
</item> |
100 | 100 |
<item> |
101 | 101 |
<widget class="QSpinBox" name="spinBox"> |
102 |
<property name="enabled"> |
|
103 |
<bool>false</bool> |
|
104 |
</property> |
|
102 | 105 |
<property name="maximum"> |
103 | 106 |
<number>2048</number> |
104 | 107 |
</property> |
... | ... | |
116 | 119 |
</item> |
117 | 120 |
<item> |
118 | 121 |
<widget class="QSpinBox" name="spinBox_2"> |
122 |
<property name="enabled"> |
|
123 |
<bool>false</bool> |
|
124 |
</property> |
|
119 | 125 |
<property name="maximum"> |
120 | 126 |
<number>2024</number> |
121 | 127 |
</property> |
내보내기 Unified diff