views:

545

answers:

3

Hi,

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

A: 

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
For hough transformation, I can detect circles very wellFor 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 distortedFor the last comment, I don't understand : ) Do you suggest a bigger cropped image?
iva123
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
+1  A: 

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.
thx it works : ))
iva123
A: 

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();
}

}

mahdi from iran