Error on ind2rgb
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Arygianni Valentino
el 8 de Nov. de 2017
Comentada: ASMA BOUDI
el 25 de Mayo de 2020
Greetings everyone.
[X, MAP] = imread('test.jpg');
RGB = ind2rgb(X,MAP);
LAB = rgb2lab(RGB);
Here I tried to convert from index to RGB image using 'ind2rgb' command, but the result is like this: Index exceeds matrix dimensions.
Error in ind2rgb (line 26) r = zeros(size(a)); r(:) = cm(a,1);
I already tried to looking for the solution on the internet, but I couldn't find it.
Hope someone who knew how to fix it, kindly give me a lead here.
Here I also attached the file that I used for this command.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169296/image.jpeg)
Thank you before.
4 comentarios
Stephen23
el 8 de Nov. de 2017
"Why not let imread read you image as an RGB immediately?"
imread does not convert indexed images to RGB.
Respuesta aceptada
KSSV
el 8 de Nov. de 2017
Try this:
[RGB, MAP] = imread('test.jpg');
[X,map] = rgb2ind(RGB,32) ;
RGB = ind2rgb(X,map);
LAB = rgb2lab(RGB);
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!