필터 지우기
필터 지우기

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 CenterFile Exchange에서 Red에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by