Loaded Image Doesn't Retain Separate Colors
3 ビュー (過去 30 日間)
古いコメントを表示
I have an image of a map loaded in MATLAB.
BEFORE the map is loaded into MATLAB the appearance is:
US Continent: Green
Ocean: Blue
Canada: Yellow
AFTER I load the map it is displaying:
Canada and the US as one color BUT I need to separate them by colors.
My code is:
im = double(imread('US.png'))
figure;
colormap summer;
...
Thanks,
Amanda
0 件のコメント
採用された回答
Walter Roberson
2012 年 8 月 30 日
Try
fig = figure;
ax = axes('Parent', fig);
[im, cmap] = imread('US.png');
if isempty(cmap)
im = im2double(im);
cmap = summer;
end
image(im, 'Parent', ax);
colormap(cmap);
3 件のコメント
Image Analyst
2012 年 8 月 31 日
You're right, though it is the most used toolbox, according to the list at the left.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!