7

I am newbie to openCV, but I want to create iris recognition program. Although the system with webcam can detect the eyes, it cannot, however, detect the circular iris. I am using the Hough Circle Transformation. But in case iris in an image is not circular enough, system can't detect it. Any solution for it?

the algorithm used is Hough Circle Transformation.

IplImage *capturedImg = cvLoadImage("circle.jpg",1);
IplImage *grayscaleImg = cvCreateImage(cvGetSize(capturedImg), 8, 1);

cvCvtColor(capturedImg, grayscaleImg, CV_BGR2GRAY);

// Gaussian filter for less noise
cvSmooth(grayscaleImg, grayscaleImg, CV_GAUSSIAN,9, 9 );

//Detect the circles in the image
CvSeq* circles = cvHoughCircles(grayscaleImg,
                         storage,
                         CV_HOUGH_GRADIENT,
                         2,
                         grayscaleImg->height/4,
                         200,
                     100 );

for (i = 0; i < circles->total; i++) 
{
     float* p = (float*)cvGetSeqElem( circles, i );
     cvCircle( capturedImg, cvPoint(cvRound(p[0]),cvRound(p[1])), 
        3, CV_RGB(0,255,0), -1, 8, 0 );
     cvCircle( capturedImg, cvPoint(cvRound(p[0]),cvRound(p[1])), 
         cvRound(p[2]), CV_RGB(0,0,255), 3, 8, 0 );
}
// cvCircle( img,cvPoint( r->x, r->y ),67, CV_RGB(255,0,0), 3, 8, 0 );      
cvNamedWindow( "circles", 1 );
cvShowImage( "circles", capturedImg );
karlphillip
  • 92,053
  • 36
  • 243
  • 426
Din Hee
  • 123
  • 1
  • 2
  • 7
  • Please reformat your question. You should write an understandable English statement. – Sam Sep 24 '12 at 15:48
  • Posting your algorithm or code will help you more. – Tae-Sung Shin Sep 25 '12 at 02:21
  • You may can try to track eye boundaries and extract the iris location with segmentation/morphological tools. As said before, posting your current algorithm will help us to guide you. – Eric Sep 25 '12 at 10:18
  • Except for Hough Circle, any other algorithm can be used to detect the iris? Thx – Din Hee Sep 25 '12 at 13:37

1 Answers1

6

Add a call to cvCanny() between cvSmooth() and cvHoughCircles(). This will execute an edge detection algorithm which is going to provide a better input image for cvHoughCircles() and will probably improve your results.

There's a lot of similar questions on Stackoverflow, I suggest you use the search box.

Community
  • 1
  • 1
karlphillip
  • 92,053
  • 36
  • 243
  • 426
  • 1
    Great. Click on the checkbox near the answer to select it as the official answer to your question. This way you are helping future visitors. – karlphillip Sep 26 '12 at 17:38