font = cv2.FONT_HERSHEY_SIMPLEX  # 使用默认字体
 cv2.rectangle(im, (10, 10), (110, 110), (0, 0, 255), thickness=2)
                    # cv2.floodFill()
                    cv2.rectangle(im, (113), int(110)), (int(300), int(135),
                                  (255, 0, 0), thickness=-1)
                    cv2.putText(im, class_name + ' ' + str(score), (int(113, int(126)), font, 0.6,
                                (255, 255, 255), 1)

效果图:

关于python使用cv画矩形并填充颜色同时填充文字

相关文章:

  • 2022-01-09
  • 2022-02-08
  • 2021-12-10
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-10
  • 2021-06-18
猜你喜欢
  • 2021-08-11
  • 2021-07-09
  • 2022-01-17
  • 2022-02-17
  • 2021-05-20
  • 2022-12-23
相关资源
相似解决方案