绘制矩形框bug

This commit is contained in:
caoqianming 2023-02-13 16:25:48 +08:00
parent a7d60d69ae
commit 83467dceb4
1 changed files with 9 additions and 2 deletions

View File

@ -110,6 +110,13 @@ def draw(path, results):
font = cv2.FONT_HERSHEY_COMPLEX_SMALL
for i in results:
for m in results[i]:
cv2.rectangle(img, results[i][m][0], results[i][m][1], (0, 255, 0), 4)
cv2.putText(img, i, results[i][m][0], font, 2, (0, 0, 255), 1)
cv2.rectangle(img, m[0], m[1], (0, 255, 0), 4)
cv2.putText(img, i, m[0], font, 2, (0, 0, 255), 1)
cv2.imwrite(path, img)
{'qiping': [
[
(1142.2359619140625, 1295.6361083984375), (1363.11669921875, 1347.201904296875)
]
]
}