1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| % --- Executes on button press in load_pic.
function load_pic_Callback(hObject, eventdata, handles)
[FileName,PathName] = uigetfile({'*.jpg';'*.png' ;'*.tiff';'*.bmp'},'File Selector');
I=imread(FileName);
axes(handles.axes1), imshow(I), title ('Image Originale'),
% --- Executes on button press in sorbel_filtre.
function sorbel_filtre_Callback(hObject, eventdata, handles)
I = imread (FileName); (erreur ici)
J=rgb2gray (I);
J=double(J)/255.0;
seuil=0.8;
H=fspecial('sobel');
V=-H';
Gh=filter2(H,J);
Gv=filter2(V,J);
G=sqrt(Gh.*Gh + Gv.*Gv);
Gs1=(G>seuil*4/3);
axes(handles.axes2),imshow(Gs1); |
Partager