matlab gui code for pushbutton1 want continue the process to pushbutton2
Afficher commentaires plus anciens
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??
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!