bonjour
Je veux faire une interface graphique qui lit une image et faire quelque traitement sur elle c'est ma première foi que j'ai essayée de réaliser une interface voici mon code:
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
27
28
29
30
31
32
33
34
35
36
37
function varargout = Segmentation(varargin)
 
 % Création de l'objet Figure
b(1)=figure('units','pixels','position',[360 50 1000 680],'color','black','numbertitle','off','name','AUTENTIFICATION DES PERSONNE PAR LEURS IRIS',...
    'menubar','none','tag','interface');
b(2)=uicontrol('style','pushbutton','units','normalized','position',[0.1 0.1 0.8 0.09],'string','choisir l''image que vous voulez ','callback', @filtrage ,...
    'tag','bouton');
 
b(3)=uicontrol('style','pushbutton','units','characters','parent',b(1),'position',[11 2 18 2],...
            'string','Fermer','callback','close',...
            'foregroundcolor','BLACK',...
            'fontsize',10,'fontweight','bold','visible','on');
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% menu de sauvegarde
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    menu= uimenu('Label','Outils','separator','on');
    m1=uimenu(menu,'Label','Enregistrer Sous','Callback','sauv','separator','on','enable','on');
    uimenu(menu,'Label','Quit','Callback','close',... 
           'Separator','on','Accelerator','Q');
 
    function filtrage(obj,event)
 global img 
        [file,path]=uigetfile({'*.bmp;*.tiff;*.jpg;*.png;*.pgm;*.pgm'},'Ouvrir Une Image'); 
Img=imread(fullfile(path,file));
 Im = rgb2gray(i);
Resize_Image = imresize(Im,[128 128]);
 whichFilter = 'gaussian';
% initialize the parameters (look at the source code of init_HMAX.m
% to see them)
init_HMAX;
% ...and now calculate the C2 response by calling calcCSSITC2new:
c2Resp=calcCSSITC2new(Resize_Image,0);
save(['personne' '.mat'], 'c2Resp');
%axis on
 end
end
il m'affiche cette erreur que je n'ai pas compris:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
Error using rgb2gray>parse_inputs (line 81)
MAP must be a m x 3 array.
 
Error in rgb2gray (line 35)
X = parse_inputs(varargin{:});
 
Error in iris_lire_image/filtrage (line 27)
 Im = rgb2gray(i);
 
Error while evaluating uicontrol Callback

svp que doit je faire aide