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 Center および File ExchangeBlue についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by