필터 지우기
필터 지우기

Loaded Image Doesn't Retain Separate Colors

조회 수: 6 (최근 30일)
Amanda
Amanda 2012년 8월 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

채택된 답변

Walter Roberson
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
Amanda
Amanda 2012년 8월 30일
편집: Amanda 2012년 8월 30일
Walter -- I really appreciate it. Only a few people are plotting and imaging experts.
Image Analyst
Image Analyst 2012년 8월 31일
You're right, though it is the most used toolbox, according to the list at the left.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by