Working with color maps

조회 수: 4 (최근 30일)
Ana Gabriela Guedes
Ana Gabriela Guedes 2021년 11월 2일
답변: DGM 2021년 11월 2일
Hi!
Can someone please help me solving the following exercise? I think the way it is written is not very clear and I'm not beeing able to understand what I'm supposed to do or how after reading the image.
input: spine.tif from MATLAB
a) read the indexed image with the associated colormap
b) display:
• display 4 axes in one figure
• in the top left axes, show the colormap functions of all color channels with the corresponding color
• in the bottom left axes, show the image histogram with the same x-axis limits of the colormap functions
• in the top right axes, show the image with the colormap
• in the bottom right axes, show the image using the default linear mapping with the display range the same as the index value range
Thank you so much to anyone who can help even if with just one of the tasks

답변 (1개)

DGM
DGM 2021년 11월 2일
You'll probably have to label things and whatnot. Could be done with tiledlayout() too, but I never use that.
[A map] = imread('spine.tif');
maxidx = max(A(:))+1;
subplot(2,2,1)
hold on;
plot(map(1:maxidx,1),'r')
plot(map(1:maxidx,2),'g')
plot(map(1:maxidx,3),'b')
subplot(2,2,3)
histogram(A,maxidx,'binmethod','integers')
subplot(2,2,2)
imshow(A,map)
subplot(2,2,4)
imshow(A,gray(double(maxidx)))

카테고리

Help CenterFile Exchange에서 Blue에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by