11 lines
349 B
Python
11 lines
349 B
Python
import numpy as np
|
||
import cv2
|
||
|
||
image = np.mat(np.zeros((200, 200)))
|
||
imageByteArray = bytearray(image)
|
||
print(imageByteArray)
|
||
#imageBGR = np.array(imageByteArray).reshape(200, 200) 报错?显示cannot reshape array of size 320000 into shape (200,200)
|
||
imageBGR = np.array(imageByteArray).reshape(400, 800)
|
||
cv2.imshow("cool", imageBGR)
|
||
cv2.waitKey(0)
|