rgb2hsv function gives error for some images, but gives good result for some other, in the code shown below.
[fname path] = uigetfile('*.*','open image file');%*.*
%dn=path;
[path,name,ext,ver] = fileparts(fname);
handles.fname = strcat(name,ext);
[handles.queryx, handles.querymap] = imread(fname);
figure
imshow(handles.queryx, handles.querymap); %This displays the image.
question_Callback(hObject, eventdata, handles)
% Obtain HSV format of the image...
handles.queryhsv = rgb2hsv(handles.querymap);
guidata(hObject,handles)
if i run this for stone sculpture images results in error
??? Attempted to access r(:,2); index out of bounds because size(r)=[0,0,1].
Error in ==> rgb2hsv at 74
g = r(:,2); b = r(:,3); r = r(:,1);
Error in ==> CBIR_MJP>insert_Callback at 101
handles.queryhsv = rgb2hsv(handles.querymap);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> CBIR_MJP at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)CBIR_MJP('insert_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Y IS IT SO?