How to convert uint8 to rgb image in MATLAB r2018b?
23 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Kaniska Samanta
il 24 Apr 2019
Commentato: Kaniska Samanta
il 29 Apr 2019
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.
0 Commenti
Risposta accettata
Walter Roberson
il 24 Apr 2019
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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Modify Image Colors in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!