Created
January 29, 2019 01:14
-
-
Save qmaruf/728fa20cacb70332b028764a917b2776 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def draw_rectangle(path, x1, y1, x2, y2): | |
im = np.array(Image.open(path), dtype=np.uint8) | |
fig,ax = plt.subplots(1) | |
ax.imshow(im) | |
rect = patches.Rectangle((x1,y1),x2-x1,y2-y1,linewidth=1,edgecolor='r',facecolor='none') | |
ax.add_patch(rect) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment