write a gray scale image to a color image and keep the intensities unchanged

1 visualización (últimos 30 días)
Hi All
I am pretty new in matlab. I have a set of images that are "uint16" and gray sclae. I am going to convert the images to a different colormap, say jet or hot, and write them. But I do not want the pixel intensity changes. Is it possible at all? Or as soon as I change the colormap ever pixel intensity is changed? Many thanks in advance!

Respuestas (1)

Image Analyst
Image Analyst el 15 de Dic. de 2019
How are you defining intensity? If the color goes from gray to some vivid hue, obviously something has changed in the display. But it's only the image as displayed that is changed. You can apply whatever colormap you want with imshow() or colormap() and the underlying gray scale image variable does not change -- it's only how it looks that is different. So if you did anything with the gray scale image like filtered it, thresholded it, saved it to disk, or whatever, it will be the same regardless of what it looks like in the axes on the figure window.
  1 comentario
Amir Rowhani
Amir Rowhani el 16 de Dic. de 2019
Thanks a lot for the comment. By "intensity" I mean the pixel counts.
You're write. I am using the imagesc() with a desired colormap (say parula) and everything is fine. The issue is that when I want to WRITE the gray file with a deifferent colormap. I thought I need to convert the gray to indexed image but it also did not work,
Here I am re-stating my question. If I have a set of (more than 1000 ) gray scale uint16 images. How I can convert these images to color images withour changing the pixel counts? I mean I need to read the images, (which is straightforward), apply a colormap (any standard colormap), and finally write the image with a new color. By color I mean any standard colormap that is available in Matlab like jet or hot or etc.
Many thanks!

Iniciar sesión para comentar.

Categorías

Más información sobre Red en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by