matplotlib: how to draw a rectangle on image

How to draw a rectangle on an image, like this:
enter image description here

import matplotlib.pyplot as plt
from PIL import Image
import numpy as np
im = np.array(Image.open('dog.png'), dtype=np.uint8)
plt.imshow(im)

I don’t know how to proceed.

4 Answers
4

Leave a Comment