Image + bbox using matplotlib / cv2

import matplotlib.pyplot as plt

from matplotlib import patches

fig, ax = plt.subplots(1)

ax.imshow(IMAGE)

ax.add_patch(patches.Rectangle((LEFT_TOP_X_Y), WIDTH, HEIGHT, fill=False, edgecolor='blue')




출처: https://www.delftstack.com/ko/howto/matplotlib/how-to-draw-rectangle-on-image-in-matplotlib/




img = cv2.rectangle(img, (384, 0), (510, 128), (0,255,0), 3)

출처: https://opencv-python.readthedocs.io/en/latest/doc/03.drawShape/drawShape.html

댓글

이 블로그의 인기 게시물

sklearn tsne + matplotlib scatter

Implementation of Focal Loss using Pytorch