Working with color maps

1 次查看(过去 30 天)
Ana Gabriela Guedes
回答: 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