用单独的颜色图叠加两个图像
Overlay two images with separate colormaps
我正在 matlab 中处理一些 landsat tiff 文件,我想在特定场景的基础图像上叠加热图。底图是灰度图像,对于热图像,我通常使用显示范围有限的 jet 色图。
例如,我通常会创建两个并排显示的图形:
figure
imshow(temp,[-2,2])
colormap jet
figure
imshow(base)
其中 temp 是一个包含温度数据的 MxN 数组,base 是一个包含基本图像的 MxN 数组。
我更喜欢将温度叠加在单个图形中的基本图像上,如下图所示。任何帮助将非常感激。
您将希望为图像使用真彩色,而不是依赖色彩图。您可以使用 gray2ind
和 ind2rgb
.
将值转换为颜色图值
% Just use grayscale for the base
hbase = ind2rgb(gray2ind(base), gray);
% Have the temperature use the builtin colormap
hold on
htemp = imshow(temp, [-2,2]);
colormap jet
我正在 matlab 中处理一些 landsat tiff 文件,我想在特定场景的基础图像上叠加热图。底图是灰度图像,对于热图像,我通常使用显示范围有限的 jet 色图。
例如,我通常会创建两个并排显示的图形:
figure
imshow(temp,[-2,2])
colormap jet
figure
imshow(base)
其中 temp 是一个包含温度数据的 MxN 数组,base 是一个包含基本图像的 MxN 数组。
我更喜欢将温度叠加在单个图形中的基本图像上,如下图所示。任何帮助将非常感激。
您将希望为图像使用真彩色,而不是依赖色彩图。您可以使用 gray2ind
和 ind2rgb
.
% Just use grayscale for the base
hbase = ind2rgb(gray2ind(base), gray);
% Have the temperature use the builtin colormap
hold on
htemp = imshow(temp, [-2,2]);
colormap jet