カラーで読み込む
プログラム(Python)
1 2 3 4 5 6 7 8 9 |
# -*- coding: utf-8 -*- import cv2 # 入力画像のロード img = cv2.imread('LegoFamily.jpg') cv2.imshow("input", img) cv2.waitKey(0) cv2.destroyAllWindows() |
データファイル
実行結果

モノクロで読み込む
プログラム(Python)
1 2 3 4 5 6 7 8 9 |
# -*- coding: utf-8 -*- import cv2 # 入力画像のロード img = cv2.imread('LegoFamily.jpg',0) cv2.imshow("input", img) cv2.waitKey(0) cv2.destroyAllWindows() |
実行結果
