Created
August 26, 2018 19:28
-
-
Save MrDavidYu/f5ee5321452e18fbb4872dd0060a925a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import matplotlib.pyplot as plt | |
import matplotlib.patches as patches | |
from PIL import Image | |
import numpy as np | |
input_test_img = '/your/path/Utah_AGRC-HRO_15.0cm_12TVK220980-CROP.0.0.jpg' | |
im = np.array(Image.open(input_test_img), dtype=np.uint8) | |
# Create figure and axes | |
fig,ax = plt.subplots(figsize=(10, 10)) | |
# Display the image | |
ax.imshow(im) | |
# Create a Rectangle patch | |
rect1 = patches.Rectangle((8.99999999997,2.0000000000099987),0.0466666666667*600,0.0466666666667*600,linewidth=1,edgecolor='r',facecolor='none') | |
# Add the patch to the Axes | |
ax.add_patch(rect1) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment