Apply colormap and caxis directly to image matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre White en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!