What is wrong with my image

1 view (last 30 days)
Yousef Shorrab
Yousef Shorrab on 11 Dec 2020
Answered: Walter Roberson on 11 Dec 2020
Hey guys, I have a Matlab code that is supposed to load images and it does. The problem is there is one image that I can’t pull up. I keep getting the error below. How do I fix my image or the code? The error: the error:
>> guide Error using rgb2gray>parse_inputs (line 80) MAP must be a m x 3 array.
Error in rgb2gray (line 52) isRGB = parse_inputs(X);
Error in corrosionTracker>b_01_Callback (line 184) testImg = imresize(rgb2gray(read(imgSet,1)), resizrFact);
Error in gui_mainfcn (line 95) feval(varargin{:});
Error in corrosionTracker (line 56) gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)corrosionTracker('b_01_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating UIControl Callback.

Answers (1)

Walter Roberson
Walter Roberson on 11 Dec 2020
The image is not in true color rgb format. Either it is grayscale, or indexed (pseudocolor) or CMYK or RGBA.

Community Treasure Hunt

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

Start Hunting!