OpenCV-Python學習--像素的讀寫

首先需要讀入一副圖像,可以根據像素的行和列獲取它的像素值。對BGR圖像而言,返回值是B,G,R的值,對RGB圖像而言,返回值是R,G,B的值。對灰度圖像而言,會返回它的灰度值。 import cv2 img = cv2.imread('lena.jpg') height,width,channel=img.shape #圖片的高度,寬度和通道數 print("height,width,chan
相關文章
相關標籤/搜索