python随机生成图片

#-*-coding:utf-8-*-
import tensorflow as tf
import numpy as np
import cv2
image = tf.random_uniform([200, 200, 3],minval=1,maxval=255, dtype=tf.int32)
with tf.Session()as sess:
    myImage=sess.run(image)
    print(myImage)
    cv2.imwrite("test.jpg", myImage)

  

猜你喜欢

转载自www.cnblogs.com/tangmiao/p/10175166.html