6

I wrote the code for hough transformation and it works well. Also I can crop the eye location of a face. Now I want to detect the iris of the crop image with applying the Hough transformation(cvHoughCircle). However when I try this procedure, the system is not able to find any circle on the image.

Maybe, the reason is, there are noises in the image but I don't think it's the reason. So, how can I detect the iris? I have the code of binary thresholding maybe I can use it, but I don't know how to do?

If anyone helps I really appreciate it. thx :)

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
iva123
  • 3,395
  • 10
  • 47
  • 68

3 Answers3

1

You say that with binary thresold you get an iris that is pure white : that is not what you want to have. Use something like cvCanny in order to get only the edge of the iris.

Pascal T.
  • 3,866
  • 4
  • 33
  • 36
0

Are you detecting the edges correctly?
Can you display the binary image and see the iris clearly?

circular hough transforms normally have a radius window (otherwise you are searching a 3d solution space) are you setting the window to a reasonable value?

Martin Beckett
  • 94,801
  • 28
  • 188
  • 263
  • For hough transformation, I can detect circles very well For binary image, yes I can see the Iris very well(it's displayed as a white dots on a black face) but it's edges are some distorted For the last comment, I don't understand : ) Do you suggest a bigger cropped image? – iva123 May 21 '10 at 20:24
  • Not familiar with cvHoughCircle - but generally you have to give hough circle finding algorithm a range (window) of radii to search for. Otherwise it has to explore a x/y/radius 3d solution space to find the likelyhood. – Martin Beckett May 22 '10 at 02:21
  • Not neccesarily, if it uses gradient information a 2D accumulator is enough. – WebMonster Jun 13 '12 at 08:31
-2
void houghcircle()
{
    //cvSmooth( graybin,graybin, CV_GAUSSIAN, 5,5 );
    CvMemStorage* storage = cvCreateMemStorage(0);

    // smooth it, otherwise a lot of false circles may be detected
    CvSeq* circles = cvHoughCircles( edge, storage, CV_HOUGH_GRADIENT, 5, edge->height/4,1,1,2,50, 70 );
    int i;
    for( i = 0; i < circles->total; i++ )
    {
        float* p = (float*)cvGetSeqElem( circles, i);
        cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), 2, CV_RGB(0,255,0), -1, 2, 0 );
        cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(255,0,0), 1, 2, 0 );
        cvNamedWindow( "circles", 1 );
        cvShowImage( "circles", img );
        cvWaitKey();
    }
}
stealthyninja
  • 10,343
  • 11
  • 51
  • 59