bonjour j'ai crée une interface graphique qui contient 2 bouton 1 pour ouvrir une image couleur originale et bouton 2 pour transformé cette image en image noir blanc ,Ceci est le code inscrit sur le bouton 1
Quel est le code qui doit être écrite dans le bouton pour mettre l'image en noir et blanc?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 % hObject handle to fichier_menu_ouvrir (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global fb global fn global Y3 global ind global ind2 global ind1 global fc Y3=''; [imageo, uc2] = uigetfile( ... {'*.bmp;*.gif;*.jpg;*', 'All Files (*.bmp, *.gif, *.jpg, *.tif,*.png)'; ... '*.*', 'All Files (*.*)'}, ... 'ouvrir image'); if isequal(imageo,0) || isequal(uc2,0) ind==0; else fo=imread(imageo); %fo=double(fo); ind=1; axes(handles.axes2);cla; imshow(fo); %Y3=im2bw(fo); end
merci d'avance .
Partager