Why the image color bar doesn't contain certain color (Red, in particular)
5 次查看(过去 30 天)
显示 更早的评论
I used the following code in order to explore RGB images
X = imread ('parrot.jpg');
image(X);
colorbar
The output
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/349733/image.jpeg)
Why doesn't the color bar contain red color even when the image does?
0 个评论
采纳的回答
Image Analyst
2020-8-22
If you want to see the 3-D color gamut, you can use colorcloud
colorcloud(rgbImage);
更多回答(1 个)
Walter Roberson
2020-8-21
编辑:Walter Roberson
2020-8-22
image() never changes the active colormap. (imshow() on the other hand changes the colormap for 2d arrays but not for rgb arrays.) You were displaying an rgb image so it had no need for a colormap.
colorbar never analyzes the contents of the display. colorbar only ever puts up a copy of the current colormap and associated numeric scale. In this case the default parula map was displayed.
See also https://www.mathworks.com/help/matlab/creating_plots/color-analysis-with-bivariate-histogram.html
Image Analyst has a better analysis tool but I cannot find it at the moment.
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Red 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!