Apply colormap and caxis directly to image matrix
1 次查看(过去 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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 White 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!