【问题标题】:Merging greyscale channels into a color composite将灰度通道合并为彩色合成
【发布时间】:2016-04-06 20:00:29
【问题描述】:

我想知道如何(在代码中)使用颜色查找表 (LUT) 将多个灰度图像合并为一个 16 位 RGB 彩色图像。

在 ImageJ 中,可以拍摄 7 张不同的 16 位灰度图像,并将它们的值合并为单色合成。

对于您拥有<= 3 图像的情况来说,这是微不足道的,并且输入图像到颜色通道的所需映射是唯一的。也就是说,如果我有三个 16 位灰度图像,并且我希望图像 1 为红色,2 为蓝色,3 为绿色,那么我只需将相应的输出图像像素设置为RGB(input1, input2, input3) .

但是,在 ImageJ 中,有一个选项可以合并三个以上的颜色通道,包括本身是 R、G 或 B 组合的颜色。可以选择具有以下所需输出颜色的五个灰度图像:

Input image: desired color in output image
==
input 1: Red
input 2: Green
input 3: Blue
input 4: Magenta // Combination of R + B
input 5: Cyan // Combination of R + G

假设将输入(灰度)映射到输出(RGB)的 LUT 是:

Red:     input -> (input, 0,     0    )
Green:   input -> (0,     input, 0    )
Blue:    input -> (0,     0,     input)
Magenta: input -> (input, 0,     input)
Cyan:    input -> (input, input, 0    )

在输出图像中,是否应该通过简单地对所有有助于颜色通道的输入图像进行平均来创建合成?还是有更复杂的方法?我幼稚的做法是:

Output pixel = R: (input1+input4+input5)/3
               G: (input2+input5)/2
               B: (input3+input4)/2

我不确定使用 ImageJ 混合颜色的正确算法是什么。事实上,代码在这里但对我来说是不可理解的:https://github.com/imagej/ImageJA/blob/3ed2e1a1d785eda3c9dfdb330030aee968c242b8/src/main/java/ij/plugin/RGBStackMerge.java

提前感谢您的任何指点!

【问题讨论】:

    标签: image-processing


    【解决方案1】:

    我通过玩弄它找到了答案——事实证明 ImageJ 使用简单的颜色通道相加(使用钳位),而不是平均它们。对来自输入的 R、G、B 值进行平均会产生暗值,而求和和钳位会产生明亮的值,这正是我所寻找的。​​p>

    更多信息请看这篇文章:Algorithm for Additive Color Mixing for RGB Values

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-14
      • 2018-02-08
      • 1970-01-01
      • 2011-12-28
      • 1970-01-01
      • 2019-03-04
      • 2016-01-11
      相关资源
      最近更新 更多