フィルターのクリア

how to get color map of image before converting it to gray?

2 ビュー (過去 30 日間)
Arif Nouman Khan
Arif Nouman Khan 2016 年 2 月 21 日
回答済み: Image Analyst 2016 年 2 月 21 日
i want to convert an image to using rgb2gray for some purpose and then i want back that rgb image the problem is i dont know the way how to store colormap before converting it to gray scale and then apply that colormap later on to get back some what similar rgb if not the exactly the sameone . can any one help me please ? searched it like a day and couldnt find any thing which i understand . if any one know about this thing feel free to write small piece of code please

回答 (1 件)

Image Analyst
Image Analyst 2016 年 2 月 21 日
You can do this
[indexedImage, map] = rgb2ind(rgbImage, numColors);
Then to get back "an" rgb image (though not the original), you can do
rgbImage2 = ind2rgb(indexedImage, map);
The smaller numColors is, the more quantized/posterized the reconstructed RGB image will look.

カテゴリ

Help Center および File ExchangeRed についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by