필터 지우기
필터 지우기

Convert it into index type

조회 수: 2 (최근 30일)
Nour George
Nour George 2020년 7월 12일
답변: Walter Roberson 2020년 7월 12일
I have this two Question :
1)Read the image (‘flage.png’)?
2)Convert it into index type and display it ?
I solved the first one :
image_mat = imread('flage.png');
But How can i solve the second one ?
  댓글 수: 1
madhan ravi
madhan ravi 2020년 7월 12일
What do you mean by index type?

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 7월 12일
[image_mat, cmap] = imread('flage.png');
if isempty(cmap)
if ndims(image_mat) > 2
image_rgb = image_mat;
else
image_rgb = repmat(image_mat, [1 1 3]);
end
else
image_rgb = ind2rgb(image_mat, cmap);
end
imshow(image_rgb)

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by