小编Tho*_*257的帖子

将作为二进制字符串加载的图像转换为 numpy 数组

有没有一种方法可以将作为二进制字符串加载的图像转换为大小为 (im_height, im_width, 3) 的 numpy 数组?像这样的东西:

# read image as binary string
with open(img_path, "rb") as image_file:
  image_string = image_file.read()

# convert image string to numpy
image_np = convert_binary_string_to_numpy(image_string)
Run Code Online (Sandbox Code Playgroud)

那个转换函数会是什么样子?我正在处理解密,因此我需要处理二进制字符串。谢谢!

python opencv numpy rncryptor pillow

4
推荐指数
1
解决办法
3847
查看次数

标签 统计

numpy ×1

opencv ×1

pillow ×1

python ×1

rncryptor ×1