self_example/TensorFlow_eaxmple/OpenCV_try/随机生成数组并显示出来.py

7 lines
190 B
Python

import cv2
import numpy as np
import os
randomByteArray=bytearray(os.urandom(120000))
flatNumpArray=np.array(randomByteArray).reshape(300,400)
cv2.imshow("cool",flatNumpArray)
cv2.waitKey(0)