개정판 bb3bbe10
issue #655: training merged img logic fix
DTI_PID/DTI_PID/TrainingImageListDialog.py | ||
---|---|---|
225 | 225 |
for imageArea in listHasBoxImage: |
226 | 226 |
areaW = imageArea.width |
227 | 227 |
areaH = imageArea.height |
228 |
preMaxLineH = maxLineH |
|
229 |
|
|
228 | 230 |
if maxLineH < areaH: |
229 | 231 |
maxLineH = areaH |
230 | 232 |
if lineW + areaW < totalBaseWidth: |
231 | 233 |
lineW += areaW |
232 | 234 |
else: |
235 |
maxLineH = preMaxLineH |
|
233 | 236 |
lineW = areaW |
234 | 237 |
totalHeight += maxLineH |
238 |
maxLineH = areaH ##sung |
|
235 | 239 |
totalHeight += maxLineH |
236 | 240 |
#print('total area real : ' + str(totalBaseWidth * totalHeight) +', total width : ' + str(totalBaseWidth) + ', total height : ' + str(totalHeight) + ', ratio : ' + str(totalHeight / totalBaseWidth)) |
237 | 241 |
|
... | ... | |
244 | 248 |
areaH = listHasBoxImage[index].height |
245 | 249 |
|
246 | 250 |
boxes = listBoxes[index].split('\n') |
247 |
|
|
251 |
preMaxLineH = maxLineH |
|
252 |
|
|
248 | 253 |
if maxLineH < areaH: |
249 | 254 |
maxLineH = areaH |
250 | 255 |
if lineW + areaW < totalBaseWidth: |
... | ... | |
261 | 266 |
currentX = lineW |
262 | 267 |
|
263 | 268 |
else: |
269 |
maxLineH = preMaxLineH |
|
264 | 270 |
lineW = areaW |
265 | 271 |
totalHeight += maxLineH |
266 | 272 |
currentX = 0 |
... | ... | |
275 | 281 |
boxComponent[4] = seedHeight - currentY - areaH + int(boxComponent[4]) |
276 | 282 |
outBox += boxComponent[0] + " " + str(boxComponent[1]) + " " + str(boxComponent[2]) + " " + str(boxComponent[3]) + " " + str(boxComponent[4]) + ' 0\n' |
277 | 283 |
currentX = areaW |
284 |
maxLineH = areaH ##sung |
|
278 | 285 |
|
279 | 286 |
trainingImgPath = os.path.join(project.getTrainingFilePath(), self.oCRLang + '.' + self.oCRLang + 'F.exp0.tif') |
280 | 287 |
trainingBoxPath = os.path.join(project.getTrainingFilePath(), self.oCRLang + '.' + self.oCRLang + 'F.exp0.box') |
내보내기 Unified diff