OpenCV/OpenCV 강좌
Python OpenCV에서 이미지 크기 (width, height) 가져오기
Python OpenCV에서 이미지 크기(width, height)를 가져오는 방법입니다. 2021. 11. 14 컬러 이미지의 경우에는 shape 함수를 통해 height, width, channels를 얻을 수 있습니다. import numpy as np import cv2 img = cv2.imread('apple.png', cv2.IMREAD_COLOR) print('img.shape ', img.shape) h, w, c = img.shape print('height ', h) print('width ', w) print('channel ', c) img.shape (618, 641, 3) height 618 width 641 channel 3 흑백 이미지의 경우에는 shape 함수를 통해 he..
2021. 11. 14. 21:09