J'utilise l’opérateur intégro-différentiel pour segmenter l'iris et la pupille, je me suis inspiré d'un programme le voici:
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 to detect the pupil  boundary
%it searches a certain subset of the image
%with a given radius range(rmin,rmax)
%around a 10*10 neighbourhood of the point x,y given as input
%INPUTS:
%im:image to be processed
%rmin:minimum radius
%rmax:maximum radius
%x:x-coordinate of centre point
%y:y-coordinate of centre point
%OUTPUT:
%cp:centre coordinates of pupil(x,y) followed by radius
%Author:Anirudh S.K.
%Department of Computer Science and Engineering
%Indian Institute of Techology,Madras
function [cp]=search(im,rmin,rmax,x,y,option)
rows=size(im,1);
cols=size(im,2);
sigma=0.5;%(standard deviation of Gaussian)
R=rmin:rmax;
maxrad=zeros(rows,cols);
maxb=zeros(rows,cols);
% for i=(x-5):(x+5)
% for j=(y-5):(y+5)
for i=(x-5):(x+5)
for j=(y-5):(y+5)
 
        [b,r,blur]=partiald(im,[i,j],rmin,rmax,0.5,600,option);
        maxrad(i,j)=r;
        maxb(i,j)=b;
    end
end
B=max(max(maxb));
[X,Y]=find(maxb==B);
radius=maxrad(X,Y);
cp=[X,Y,radius];
Lorsque j'implémente mon programme principal :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
I=imread('001_1.jpg');
rmin=104;
rmax=152;
[ci,cp,out]=thresh(I,rmin,rmax); % I: image de l'iris, rmin,rmax: centre du circle de l'iris
subplot(1,2,1);imshow(I),title('Image d''origine');
subplot(1,2,2);imshow(out),title('Image segmentée ');
Matlab m'affiche l'erreur suivante:
Attempted to access maxrad(-4,-4); index must be a positive integer or logical.

Error in search (line 26)
        maxrad(i,j)=r;

Error in thresh (line 78)
ci=search(I,rmin,rmax,x,y,'iris');%fine search

Error in main_test (line 4)
[ci,cp,out]=thresh(I,rmin,rmax);
Est-ce-que je dois ajuster les indices i et j ? J'ai besoin de votre aide, merci d'avance.