Skip to content

Commit fef6192

Browse files
authored
Merge pull request opencv#17394 from huningxin:fix_segmentation_py
* Fix window title of python segmentation example * Fix float text position of python segmentation examples
1 parent 7d9e1be commit fef6192

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

samples/dnn/mask_rcnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def showLegend(classes):
4343
for i in range(len(classes)):
4444
block = legend[i * blockHeight:(i + 1) * blockHeight]
4545
block[:,:] = colors[i]
46-
cv.putText(block, classes[i], (0, blockHeight/2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255))
46+
cv.putText(block, classes[i], (0, blockHeight//2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255))
4747

4848
cv.namedWindow('Legend', cv.WINDOW_NORMAL)
4949
cv.imshow('Legend', legend)

samples/dnn/segmentation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def showLegend(classes):
6565
for i in range(len(classes)):
6666
block = legend[i * blockHeight:(i + 1) * blockHeight]
6767
block[:,:] = colors[i]
68-
cv.putText(block, classes[i], (0, blockHeight/2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255))
68+
cv.putText(block, classes[i], (0, blockHeight//2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255))
6969

7070
cv.namedWindow('Legend', cv.WINDOW_NORMAL)
7171
cv.imshow('Legend', legend)
@@ -76,7 +76,7 @@ def showLegend(classes):
7676
net.setPreferableBackend(args.backend)
7777
net.setPreferableTarget(args.target)
7878

79-
winName = 'Deep learning image classification in OpenCV'
79+
winName = 'Deep learning semantic segmentation in OpenCV'
8080
cv.namedWindow(winName, cv.WINDOW_NORMAL)
8181

8282
cap = cv.VideoCapture(args.input if args.input else 0)

0 commit comments

Comments
 (0)