필터 지우기
필터 지우기

How can an color image can be changed have only four color in desire area.

조회 수: 2 (최근 30일)
Hello , i am doing with image segmentation and have an gray image segmented with only four different intensity level .Now how can be it convert to four different color rgb format.

채택된 답변

Walter Roberson
Walter Roberson 2012년 10월 21일
[indimg, map] = rgb2ind(YourImage, 4);
newimg = ind2rgb(indimg, map);
  댓글 수: 2
Tabish Raza
Tabish Raza 2012년 10월 21일
can it be done with desire pixel intensity.suppose i need only four color red blue green and yellow in output correspond four different gray scale intensity
Image Analyst
Image Analyst 2012년 10월 21일
You can create up any colormap you want to assign any graylevel range you want to the color you want. Then pass it in to ind2rgb to make a new rgb image, or just call colormap if you want to not create a new RGB image and just view your grayscale image in a pseudocolor image on the display. Do you just want to view it in color with colormap, or do you actually need a new variable in your program that represents the RGB image?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by