フィルターのクリア

how can I handle colors

2 ビュー (過去 30 日間)
dakhli mohamed
dakhli mohamed 2019 年 1 月 22 日
コメント済み: dakhli mohamed 2019 年 1 月 24 日
hello I have a code that turns my image of black and white in color but I am stuck at the level of color segment I want the red part to be black
(attached image)
function [ ] = imageLabels(image)
figure,imagesc(image)
colormap(hsv)
axis image;
hold on;
for K = 1 : 4; hidden_h(K) = surf(uint8(K-[1 1;1 1]), 'edgecolor', 'none'); end
hold off
uistack(hidden_h, 'bottom');
legend(hidden_h, {'tree','rock','water'} )
axis off;
end
  9 件のコメント
Stephen23
Stephen23 2019 年 1 月 24 日
編集済み: Stephen23 2019 年 1 月 24 日
190x190 double, inappropriately named ans, and with values ranging from 0 to 1.
Guillaume
Guillaume 2019 年 1 月 24 日
Judging by the files and variable names, I would think the question is related to 441221-fusion-of-satellite-images

サインインしてコメントする。

採用された回答

Guillaume
Guillaume 2019 年 1 月 24 日
Possibly, this will do what you want:
matcontent = load('C1fig.mat'); %load ans variable (bad name!) as matcontent.ans
greyimage = matcontent.ans; %the grey image as a 2D matrix in the range 0-1
greenimage = cat(3, zeros(size(greyimage)), greyimage, zeros(size(greyimage))); %make the greyimage the 2nd channel of a RGB image
imshow(greenimage);
  1 件のコメント
dakhli mohamed
dakhli mohamed 2019 年 1 月 24 日
thank you Guillaume

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecialized Messages についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by