1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| function gui_guidata_guihandles
fig = figure('units','pixels',...
'position',[250 250 500 500],...
'color',[0.925 0.913 0.687],...
'numbertitle','off',...
'name','Interface de test',...
'menubar','none',...
'tag','interface_test');
% Création de l'objet texte statique
uicontrol('units','normalized',...
'position',[0.3 0.8 0.3 0.05],...
'style','text',...
'string','Veuiilez saisir l''image de test:',...
'backgroundcolor','c')
% Création de l'objet texte editable
uicontrol('Style','edit',...
'backgroundcolor','w',...
'Position',[170 350 100 30],...
'tag', 'edit1');
%'Callback',{@editbutton_Callback});
% Création de l'objet bouton
uicontrol('style','pushbutton',...
'units','normalized',...
'backgroundcolor',[0.5 0.5 0.25],...
'position',[0.35 0.6 0.15 0.05],...
'string','valider',...
'fontsize',10.0,...
'callback',@valider,...
'tag','test_tag');
image_backgnd=imread ('visage.jpg','jpg');
%axes('Position',[0 0 1 1]);
axes('Position',[0 0 1 1]);
image(image_backgnd);
%axis image;
axis off;
axis tight
handles = guihandles(fig);
guidata(fig,handles);
function valider(obj,event)
load data
handles = guidata(gcbf);
InputImage = get(handles.edit1, 'String');
InputImage = imread(fullfile('D:\Documents and Settings\sis26\Desktop\',InputImage));
%InputImage = imread(strcat('D:\Documents and Settings\sis26\Desktop\',InputImage));
figure(5)
subplot(1,2,1)
imshow(InputImage); colormap('gray');title('Input image','fontsize',18)
save data |