Filter löschen
Filter löschen

Error on ind2rgb

9 Ansichten (letzte 30 Tage)
Arygianni Valentino
Arygianni Valentino am 8 Nov. 2017
Kommentiert: ASMA BOUDI am 25 Mai 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.
Thank you before.
  4 Kommentare
Stephen23
Stephen23 am 8 Nov. 2017
"Why not let imread read you image as an RGB immediately?"
imread does not convert indexed images to RGB.
Arygianni Valentino
Arygianni Valentino am 8 Nov. 2017
Actually I was trying to use the image processing just as mentioned in this page,
https://www.mathworks.com/help/images/ref/adapthisteq.html
But I got stuck on the ind2rgb part, so I ask some help here.
Anyway, thank you very much for your comment.
I wonder, is there any way to improve the sharpness and quality of the color image?
Since I was tried to improve the quality of my picture, but all the available solution I found was for greyscale image. Thank you before.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KSSV
KSSV am 8 Nov. 2017
Try this:
[RGB, MAP] = imread('test.jpg');
[X,map] = rgb2ind(RGB,32) ;
RGB = ind2rgb(X,map);
LAB = rgb2lab(RGB);
  2 Kommentare
Arygianni Valentino
Arygianni Valentino am 8 Nov. 2017
Thank you very much, It works!!!
ASMA BOUDI
ASMA BOUDI am 25 Mai 2020
Merci

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by