def draw_detections(img, detections, color = (0, 255, 0)):
for i in range(0, detections.shape[2]):
det_word = detections[0, 0, i]
if (det_word[0] == 0 and det_word[1] == 0) or det_word[5] < 0.05:
break
box = ((det_word[0], det_word[1]), (det_word[2], det_word[3]), det_word[4] * 180 / 3.14)
box = cv2.boxPoints(box)
box = np.array(box, dtype="int")
draw_box_points(img, box, color)
评论列表
文章目录