1. 程式人生 > >matplotlib畫矩形框

matplotlib畫矩形框

import matplotlib.patches as patches
import matplotlib.pyplot as plt
import cv2

img=cv2.imread("images/1.jpg")
plt.figure(8)
plt.imshow(imgSrc)
currentAxis=plt.gca()
rect=patches.Rectangle((200, 600),550,650,linewidth=1,edgecolor='r',facecolor='none')
currentAxis.add_patch(rect)

這裡寫圖片描述