Hough transformation for iris detection in OpenCV
Asked Answered
C

3

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 :)

Ceraceous answered 21/5, 2010 at 20:10 Comment(0)
A
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.

Austenite answered 23/5, 2010 at 11:58 Comment(0)
T
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?

Timmy answered 21/5, 2010 at 20:18 Comment(3)
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?Ceraceous
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.Timmy
Not neccesarily, if it uses gradient information a 2D accumulator is enough.Pescara
P
-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();
    }
}
Philter answered 3/8, 2010 at 10:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.