【发布时间】: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