0

I am working on an iris recognition system. I want to find the pupil by analyzing connected components in the image using bwconncomp.

The algorithm for pupil detection is as follows:

  1. Connected component labeling works by scanning an image. It groups pixels into components based on pixel connectivity. All pixels in a connected component share similar pixel intensity values and are in some way connected with each other.
  2. Once all groups of pixels have been determined, each pixel in that group is labeled. The center and the diameter of all groups is determined and the one with the largest diameter is the pupil.
  3. The parts of the image that lie above and below the iris are occluded by eyelashes and eyelids. These pixels lie above and below the diameter of the pupil. To remove them, set these pixels to be NaNs (Not a Number).
  4. The min/max iris radius is found to be 90/125. Based on this, 45 pixels to the left and right of the pupil is considered to be the iris region for the proposed algorithm analysis.

My question is: how do I set the space above and below the iris to be NaNs. And how do I obtain the pixels that correspond to the iris?

My code is as follows:

%% Read the file and dilate it
I = imread('eye.jpg');  %See the comments for the image.
erodedBW = rgb2gray(I);
se2 = strel('disk',35); 
dilatedBW= imdilate(erodedBW ,se2);
imshow(dilatedBW);


%%pupil Detection
cc2=bwconncomp(dilatedBW);
labeled = labelmatrix(cc2);
L = bwlabel(dilatedBW);
[L, num] = bwlabel(dilatedBW);

%% Find the largest value of L
count=num;
largvalue=0;  
for i=0:count,
    L = bwlabel(dilatedBW);
    if  largvalue<=L
        largvalue=L; 
    end    
end
kitchenette
  • 1,625
  • 11
  • 12
Muna
  • 73
  • 1
  • 2
  • 10
  • 1
    you could add your code in pastebin.com and give link here. If possible, upload an image in imageshack.us and give link here. – Abid Rahman K May 10 '12 at 19:44
  • Do you really think that anybody wants to register on 4shared for downloading your docx? Use Dropbox for sharing or upload file to Google docs. – Singlet May 11 '12 at 07:20
  • Thank u Abid the code uploaded http://pastebin.com/YGEWL91m the image uploaded also http://imageshack.us/content_round.php?page=done&l=img405/7484/55988158.jpg – Muna May 11 '12 at 10:02

0 Answers0