Apply colormap and caxis directly to image matrix

조회 수: 1 (최근 30일)
gbos
gbos 2020년 6월 30일
Hello,
I have and image and a colormap, that I usually apply like this:
my_colormap = ....;
my_image = imread(....);
figure(1);
imshow(my_image);
colormap(my_colormap);
caxis([minVal maxVal]);
What I'd like to do is, instead of applying the colormap and the caxis to the figure, I'd like to apply it directly to the image matrix (my_image) for further processing.
At the moment, this is what I tried:
(IMPORTANT: my_image is actually a matrix with double values, also negative values. I figured that when I do imshow, it gets converted to 8 bits or 16 bits uint. I verified this by using im2uint16 to my image and then using imwrite and opening that image with an image viewer. It indeed look the same as the one in the figure).
my_colormap = ....;
% this is a 64 bits values with sign
my_image = imread(....);
% This works and the image looks the same as just doing imshow(my_image)
my_image = im2uint16(my_image);
% This does not work, when I show my_image it looks different than just applying colormap(my_colormap) to a figure
my_image = ind2rgb(my_image, SigColourMap);
% ?? caxis: I still do not know what to do to the matrix to apply the caxis
Any help?
Kind regards

답변 (0개)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by