필터 지우기
필터 지우기

Assigning color to gray image

조회 수: 24 (최근 30일)
Karina
Karina 2014년 4월 21일
댓글: Karina 2014년 6월 16일
I have a gray image (it's a flame) like the image below and I want to get something like the next image. I think I need to apply color and contour maps. But I don't know how to apply them. Thank you.

채택된 답변

Image Analyst
Image Analyst 2014년 4월 21일
I'd just use colormap and not mess with contours unless you know what you're doing and what you want. To pseudocolor a grayscale image an leave it as grayscale but display it as colored:
imshow(grayImage);
colormap(jet(256));
colorbar;
To convert a grayscale image into a true color RGB image and display the RGB image instead of the pseudocolored image:
rgbImage = ind2rgb(grayImage, jet(256));
imshow(rgbImage);
You don't use color bars with RGB images.
  댓글 수: 1
Karina
Karina 2014년 6월 16일
Thank you. That was the answer I was looking for.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2014년 4월 21일
contourf(YourImageMatrix);
colormap(hot)

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by