import cv2 as cv
import numpy as np
def access_pixel(image):
"""访问图像所有的像素"""
print(image.shape)
#获取图像的高度,图像的高度为shape的第一个值(维度)
height=image.shape[0]
#获取图像的宽读,图像的宽度为shape的第二个值(维度)
width=image.shape[1]
#获取图像通道数目,图像的通道数目为shape的第三个值(维度)
#加载进来的图像都有三个通道,三个通道是图像的RGB
channels=image.shape[2]
print("width: %s,height: %s channels: %s"%(width,height,channels))</