필터 지우기
필터 지우기

How to convert uint8 to rgb image in MATLAB r2018b?

조회 수: 21 (최근 30일)
Kaniska Samanta
Kaniska Samanta 2019년 4월 24일
댓글: Kaniska Samanta 2019년 4월 29일
I have a 365x466x3 uint8 matrix and I need to convert it into RGB model. when I used the command "ind2rgb" i am getting the following problem, "Unable to perform assignment because the size of the left side is 365-by-466 and the size of the right side is 365-by-466-by-3." Any solution?? Thanks in advance.

채택된 답변

Walter Roberson
Walter Roberson 2019년 4월 24일
365 x 466 x 3 is already RGB, unless it is HSV or L*a*b* or similar.
If you had a 365 x 466 indexed image and a colormap then you could use ind2rgb() to convert it to RGB, but you would typically assign the result to an entire variable rather than to a portion of a variable. But it could be done, such as
for K = 1 : length(filenames)
[ind, cmap] = imread( filenames{K} );
all_images(:,:,:,K) = ind2rgb(ind, cmap);
end

추가 답변 (0개)

카테고리

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