matlab gui code for pushbutton1 want continue the process to pushbutton2
显示 更早的评论
pushbutton1 to load the image from file
if true
% % --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
path = 'C:\Users\yazid-daa\Desktop\fyp\matlab\';
filter = '*.jpg';
selectedFile = uigetfile(fullfile(path , filter))
b =['C:\Users\yazid-daa\Desktop\fyp\matlab\',selectedFile]
a= imread(b);
figure,imshow(a),title('Face Recognition')
end
where pushbutton2 to process the image
if true
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
B=rgb2gray(a);
figure,imshow(B),title('GrayImage');
C=im2bw(B);
figure,imshow(C),title('im2bw');
D=medfilt2(B,[5 5]);
E=D(:,:,1);
threshold=160/255;
bw=im2bw(E,threshold);
figure,imshow(bw);
bw=bwareaopen(bw,10000);
se=strel('disk',20);
bw=imclose(bw,se);
bw=~bw;
bw=imfill(bw,'holes');
figure,imshow(bw);
end
how can the image choose from the file can be callback to pushbutton2 without load back from the file??
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!