Colorbars of image in matab
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi i have a image in .JPG format. I have imported the image into matlab and have used the imshow command to plot the image. Know i want to display the color-bar containing the same colors in the image. I am using MATLAB R2015a. Can anyone suggest any codes which i can use.
0 comentarios
Respuestas (2)
Walter Roberson
el 11 de Sept. de 2018
No, that is not possible.
In order to draw a colorbar you have to have a scalar value for each distinct color. You arrange the scalar values in order and draw the corresponding color at the correct relative position according to the scalar values, and call the result a colorbar.
However you can never do that for color jpeg. Jpeg supports scalar values at positions for grayscale (though this is very rare to encounter in practice), and jpeg supports RGB in which there are three values per pixel (not a scalar). Jpeg does not support indexed (colormapped) images, which is a system of linear values per pixel and an associated colormap indicating which color is associated with which pixel.
So color jpeg are never composed of scalar values, only of triplets per pixel. Therefore you cannot associate a scalar with each location as required to construct a colorbar.
0 comentarios
Image Analyst
el 11 de Sept. de 2018
You need to use the function colorcloud(). This will show you the 3 dimensional color gamut of your image. The complete color gamut cannot be shown in a bar, it has to be shown in a scatterplot-like format like colorcloud() gives you.
0 comentarios
Ver también
Categorías
Más información sobre Red en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!