Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
hi,
i need a quick help.
i'm writing iris identity project in c# and i faced 2 problems.

the first is that i want to remove the pupil from the image put dont know how to do it? i draw an ellipse above it but if i can remove it that will be better.


the second is i want to unwrapped the image (the donat shape) and save it in a 512 , 64 image. i tried so hard but fail to find solution.

would anybody help me please?
C#
int int_Width =512;
                      int int_Height =64 ;

                      //Create the buffered image with the correct size
                      Bitmap bImage = new Bitmap(int_Width, int_Height, b.PixelFormat);

                      //Get the graphics of the buffered image
                      Graphics g = Graphics.FromImage(bImage);

                      MemoryStream ms = new MemoryStream();
                      finalImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
                      byte[] ary = ms.ToArray();


this is my last try, i dont know how to continue.
Posted
Updated 28-Dec-12 10:45am
v2
Comments
Member 8475480 28-Dec-12 16:51pm    
i have a funtion to unwrapped the image but it is in matlab and i couldnt convert it to c#

here is the function:

% this function converts the localized iris image to a normailzed one
% the input arguments are localized image(gray scale),iris radius,Puble radius,Center x,Center y
% the output is the normailized image (gray scale)

function Nor=Normalize(Loc,Ri,Rp,Xo,Yo)
m=round(2*pi*Ri); %m,n are the sizes of the normailized image before resizing
n=Ri-Rp;
Y=ones(1,n);
X=ones(1,m);
for y=1:n-1
k=1;
step=((y+Rp)/(Ri*pi))*2;
for l=Yo-y-Rp:step:Yo+y+Rp
Y(k)=round(l);
Y(m-k+1)=round(l);
X(k)=round(Xo+sqrt((y+Rp)^2-(l-Yo)^2));
X(m-k+1)=round(Xo-sqrt((y+Rp)^2-(l-Yo)^2));
k=k+1;
end
for x=1:m
try
Nor(x,y)=Loc(X(x),Y(x));
catch
Nor(x,y)=0;
end
end
end
Nor=imresize(Nor,[512 64],'bilinear');%resizing the image to have the required dimensions.
Nor=imrotate(Nor,-90);
Sergey Alexandrovich Kryukov 28-Dec-12 18:01pm    
Sorry, but you are too far away to discuss it seriously... You will cut the image to have only the iris, which is, by your description, is way too easy (ellipse is already known, suggested by the user, right?), now what? I you even cannot clean the outer area... OK, just one hint: use LockBits.
—SA

1 solution

hi,

as far as i understand your problem, you want your program to automatically cut out the pupil!?! So it has to find it. Maybe you have to get in contact with OpenCV:
http://opencv.willowgarage.com/wiki/[^]
there is an wrapper for .net:
http://www.emgu.com/wiki/index.php/Main_Page[^]
hope this helps...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900