hello, i have problem using imread. i want to process 4 images in 4 different axes. but it says error using imread. here is the codes.

1 view (last 30 days)
function buttondeteksi_Callback(hObject, eventdata, handles)
s = get(handles.edit1, 'String');
file = char(s);
[pathstr,name,ext] = fileparts(file);
img_path=[pathstr,name,ext];
addpath(img_path);
image1=imread(file,['\','1.bmp']);
[ci, cp, out] = thresh(image1,100,400);
axes(handles.axes1);
imshow(out);
setappdata(handles.edit1,'localImg',image1);
setappdata(handles.edit1,'IrisParam',ci);
setappdata(handles.edit1,'PupilParam',cp);
image2=imread(file, ['\','2.bmp']);
[ci, cp, out] = thresh(image2,100,400);
axes(handles.axes2);
imshow(out);
setappdata(handles.edit1,'localImg',image2);
setappdata(handles.edit1,'IrisParam',ci);
setappdata(handles.edit1,'PupilParam',cp);
image3=imread(file, ['\','3.bmp']);
[ci, cp, out] = thresh(image3,100,400);
axes(handles.axes3);
imshow(out);
setappdata(handles.edit1,'localImg',image3);
setappdata(handles.edit1,'IrisParam',ci);
setappdata(handles.edit1,'PupilParam',cp);
image4=imread(file, ['\','4.bmp']);
[ci, cp, out] = thresh(image4,100,400);
axes(handles.axes4);
imshow(out);
setappdata(handles.edit1,'localImg',image4);
setappdata(handles.edit1,'IrisParam',ci);
setappdata(handles.edit1,'PupilParam',cp);
set(handles.buttonnormal,'Enable','on');

Accepted Answer

Walter Roberson
Walter Roberson on 27 May 2017
Due to a lack of documentation about the expected inputs and outputs, I had to make some guesses as to how the routine should work.
function buttondeteksi_Callback(hObject, eventdata, handles)
s = get(handles.edit1, 'String');
file = char(s);
[pathstr,name,ext] = fileparts(file);
img_path = pathstr;
image1 = imread( fullfile(pathstr, '1.bmp') );
[ci, cp, out] = thresh(image1,100,400);
axes(handles.axes1);
imshow(out);
setappdata(handles.axes1,'localImg',image1);
setappdata(handles.axes1,'IrisParam',ci);
setappdata(handles.axes1,'PupilParam',cp);
image2 = imread( fullfile(pathstr, '2.bmp') );
[ci, cp, out] = thresh(image2,100,400);
axes(handles.axes2);
imshow(out);
setappdata(handles.axes2,'localImg',image2);
setappdata(handles.axes2,'IrisParam',ci);
setappdata(handles.axes2,'PupilParam',cp);
image3 = imread( fullfile(pathstr, '3.bmp'));
[ci, cp, out] = thresh(image3,100,400);
axes(handles.axes3);
imshow(out);
setappdata(handles.axes3,'localImg',image3);
setappdata(handles.axes3,'IrisParam',ci);
setappdata(handles.axs3,'PupilParam',cp);
image4 = imread( fillefile( pathstr, '4.bmp') );
[ci, cp, out] = thresh(image4,100,400);
axes(handles.axes4);
imshow(out);
setappdata(handles.axes4,'localImg',image4);
setappdata(handles.axes4,'IrisParam',ci);
setappdata(handles.axes4,'PupilParam',cp);
set(handles.buttonnormal,'Enable','on');
  8 Comments
Glenn
Glenn on 28 May 2017
Edited: Glenn on 28 May 2017
sorry, im a newbie, would you tell me where to put that codes or which codes that i should change?

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!