【问题标题】:Adding extra dimension to multidimensional numpy images in Python3在 Python3 中为多维 numpy 图像添加额外维度
【发布时间】:2023-03-07 01:10:01
【问题描述】:

假设我有一张尺寸为 (160, 1, 256, 192) 的图像,即单通道尺寸为 256x192 的 160 张灰度图像。如何通过复制三通道中的256x192图像来制作尺寸为(160,3,256,192)的图像?

【问题讨论】:

    标签: arrays python-3.x image numpy


    【解决方案1】:

    您正在寻找np.repeat(x, 3, axis=1)

    【讨论】:

      猜你喜欢
      • 2016-11-07
      • 1970-01-01
      • 2019-11-19
      • 2021-02-13
      • 2019-06-18
      • 1970-01-01
      • 2019-01-17
      • 2021-02-16
      • 2013-07-08
      相关资源
      最近更新 更多