why can't it find the Iris Boundaries

1 view (last 30 days)
Yannick Mermet
Yannick Mermet on 16 Aug 2015
Before i apply the algorithm above, I use the following code to Localize and fill in the Reflections in the image:
function [eyeClose] = findReflections(eye, r, c);
%Since Images are already greyscale, no need to convert them.
%Average Intensity Value of image
iAve = mean2(eye);
%*Maximum Intensity Value of image calculated*%
%Gets the 0.04% of the Total amount of pixels in the image
iMaxS = r*c*0.04;
%Sort the values in descending order
[sortedValues,sortIndex] = sort(eye(:),'descend');
%Get a linear index into Eye image of the iMaxS largest values
highValues = sortedValues(1:iMaxS);
%Fixed amount of Brighest Pixels averaged
iMaxB = mean(highValues);
%P (fixed proportion) is between 0 to 1
%After trial and error 0.8 seems to gather the best of the reflections in
%the Iris
P = 0.6;
%Intensity Threshold
tRef = iAve + P*(iMaxB-iAve)
indicies = uint8(double(eye<=tRef));
eyeTref = eye.*indicies;
out = eyeTref; % Initialize
%creates a nonflat, ball-shaped structuring element (actually an ellipsoid)
%whose radius in the X-Y plane is R and whose height is H.
se = strel('ball',5,50);
%Dilation Operator
eyeMorph = imdilate(eyeTref,se);
out(~indicies) = eyeMorph(~indicies); % Replace specular reflections with dilated.
% %Closure Operator
eyeMorph2 = imclose(out,se);
eyeClose = eyeMorph2;
any help would be grateful. Here is the image of the eye

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!