how to add labels in an image

6 ビュー (過去 30 日間)
dakhli mohamed
dakhli mohamed 2019 年 2 月 13 日
コメント済み: DGM 2024 年 11 月 18 日
Hello
I want to add labels that represents the color blue is water the color green is the tree and the color red is rock
here is the code as well as the attached images "
And thank you in advance
imgs(2) = load('C1fig.mat');
imgs(1) = load('C2fig.mat');
imgs(3) = load('C3fig.mat');
img = cat(3, imgs.ans);
imshow(img)
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 2 月 13 日
labels ? As in a legend? Or every area of a given type should have a text label drawn on the area if it is large enough and a label with an arrow pointing to the location if the area is not large enough to contain the label ?
dakhli mohamed
dakhli mohamed 2019 年 2 月 13 日
just a legend at the top left that indicates the color and its corespandances

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

採用された回答

Walter Roberson
Walter Roberson 2019 年 2 月 13 日
hh(1) = line(nan, nan, 'color', 'b')
same for the other two colors into hh 2 and hh 3
legend(hh,{'water','tree','rock'})

その他の回答 (1 件)

DANAH
DANAH 2024 年 11 月 17 日
How to add an image in matlab ?
  2 件のコメント
Image Analyst
Image Analyst 2024 年 11 月 17 日
@DANAH, that is way too vague. Add an image to what? Also, start your own discussion thread rather than here in @dakhli mohamed's 5 year old thread on an unrelated topic.
If you have any more questions, then attach your data and code to read it in with the paperclip icon in your new question/thread after you read this:
DGM
DGM 2024 年 11 月 18 日
% add an image in matlab
sum('an image in matlab')
ans = 1658

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

カテゴリ

Help Center および File ExchangeInteractive Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by