Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
查看数据类型
print(image.dtype)
unit8 转换成 float32
先将图片转化为float32类型,再除以255,得到0-1之间的数
import numpy as np
image = image.astype(np.float32) / 255
float32 转换成 uint8
每个数乘以255,再转化为uint8
import numpy as np
image = (image * 255).astype(np.uint8)
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/192562.html原文链接:https://javaforall.net
