我运行此代码:
import cv2
import numpy as np
img_file='pokemon.jpg'
img=cv2.imread(img_file)
# print total number of rows, columns and channels that are provided in the picture
print 'Image shape: ',img.shape # rows = 630, columns = 900
# now let us print the total number of pixels that the picture has
print 'Number of pixels: ', img.size # 1701000
print 630*900 # 56700
为什么最后两个输出有所不同?列和行的数量不是表示在像素矩阵内组织的像素数吗?