【问题标题】:Skimage/LAB-Transformation and grayscale imagesSkimage/LAB-变换和灰度图像
【发布时间】:2021-09-03 05:07:57
【问题描述】:

我正在将几个图像从 rgb-colorspace 转换为 LAB-colorspace usign skimage.rgb2lab。 一般来说,这工作得很好,除了一些灰度图像,因为它们只包含 2 个颜色通道,因此 2 维数组和 rgb2lab 需要 3 维数组。

有没有办法将只有 2 个通道的灰度图像转换为 LAB 空间?

【问题讨论】:

    标签: transform scikit-image grayscale lab-color-space


    【解决方案1】:

    您的问题有一些奇怪的方面,但为了尝试让您继续前进,我建议您合成一个零填充的附加通道,并将其与您现有的 2 个通道堆叠成 3 个。沿着这些线:

    extraChannel = np.zeros_like(twoChannel[...,0])
    threeChannel = np.dstack((twoChannel, extraChannel))
    

    【讨论】:

      猜你喜欢
      • 2020-03-07
      • 1970-01-01
      • 2017-11-17
      • 1970-01-01
      • 1970-01-01
      • 2018-11-28
      • 1970-01-01
      • 2010-11-20
      相关资源
      最近更新 更多