源码:
import cv2 as cv
import numpy as np
def get_imgage_info(image):
print(type(image))
print(image.shape)
print(image.size)
print(image.dtype)
pix_data = np.array(image)
print(pix_data)
src = cv.imread("/home/jon/logo.png")
get_imgage_info(src)
cv.namedWindow("input image", cv.WINDOW_AUTOSIZE)
gray = cv.cvtColor(src,cv.COLOR_BGR2GRAY)
cv.imshow("input image", gray)
cv.waitKey(0)
cv.destroyAllWindows()
图像: