カラー画像をグレーレベル画像に重ねようとしています。ただし、「カラーバー」をプロットして「clim」を設定しようとすると。Matlab は常に下のグレー レベル イメージに従ってカラーバーを生成します。
ただし、オーバーレイされたカラー画像のカラーバーを取得したいです。任意の提案をいただければ幸いです。どうもありがとう。
%% Example codes:
greyImage = imread('AT3_1m4_08.tif');
colorImage = imread('hestain.png');
figure,
greyImagePlot = image(greyImage); colormap(gray); hold on;
overlayImage = imagesc(colorImage, ...
'CDataMapping', 'scaled', 'HitTest', 'off');
alF = 0.5.*ones(size(colorImage, 1), size(colorImage, 2));
set(overlayImage, 'AlphaData', alF);
colorbar; % This will show a grey scale colorbar not the colour one I want
set('CLim', [0 100]); % Also, the colormap limit here is not working
axis off
axis image