画像のダウンロードとその画像を画面に表示させる
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
# 画像のダウンロード | |
import urllib.request as req | |
url = "https://amd.c.yimg.jp/amd/20190331-00000059-asahi-000-2-view.jpg" | |
req.urlretrieve(url,"sakura.jpg") | |
# ダウンロードした画像を画面に表示する | |
import matplotlib.pyplot as plt | |
import cv2 | |
# 画像を読み込む | |
img = cv2.imread("sakura.jpg") | |
# axisの表示オフ | |
plt.axis("off") | |
plt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB)) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment