Error on ind2rgb

조회 수: 6 (최근 30일)
Arygianni Valentino
Arygianni Valentino 2017년 11월 8일
댓글: ASMA BOUDI 2020년 5월 25일
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
Stephen23
Stephen23 2017년 11월 8일
"Why not let imread read you image as an RGB immediately?"
imread does not convert indexed images to RGB.
Arygianni Valentino
Arygianni Valentino 2017년 11월 8일
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.

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

채택된 답변

KSSV
KSSV 2017년 11월 8일
Try this:
[RGB, MAP] = imread('test.jpg');
[X,map] = rgb2ind(RGB,32) ;
RGB = ind2rgb(X,map);
LAB = rgb2lab(RGB);
  댓글 수: 2
Arygianni Valentino
Arygianni Valentino 2017년 11월 8일
Thank you very much, It works!!!
ASMA BOUDI
ASMA BOUDI 2020년 5월 25일
Merci

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by