Hi i need a solution for this...while loading some of the CT images,i am getting an error like this....plz help me
1 view (last 30 days)
Show older comments
Error using rgb2gray>parse_inputs (line 81) MAP must be a m x 3 array.
Error in rgb2gray (line 35) X = parse_inputs(varargin{:});
Error in Untitled6 (line 8) I = rgb2gray(rgb);
2 Comments
Sivakumaran Chandrasekaran
on 25 Dec 2015
the input which you given is a gray image. since the input is itself a gray image already, you cant convert it to gray image.
if you use color image as input, you will not get this error
Walter Roberson
on 25 Dec 2015
That is possible, that the image is already grayscale. In my experience it is more likely that the image is an indexed image that has not been read properly, as people tend to forget about that possibility when they write their code.
Answers (1)
Walter Roberson
on 23 Dec 2015
Your image is not an rgb image, it is an indexed image. You need to read the color map when you read the image and use ind2gray
[non_rgb, map] = imread('YourFile.bmp');
I = ind2gray(non_rgb, map);
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!