2
votes

I have been trying to detect the iris region of an eye and thereafter draw a circle around the detected area. I have managed to obtain a clear black and white eye image containing just the pupil, upper eyelid line and eyebrow using threshold function.

Once this is achieved HoughCircles is applied to detect if there are circles appearing in the image. However, it never detects any circular regions. After reading up on HoughCircles, it states that

the Hough gradient method works as follows:

First the image needs to be passed through an edge detection phase (in this case, cvCanny()).

I then added a canny detector after the threshold function. This still produced zero circles detected. If I remove the threshold function, the eye image becomes busy with unnecessary lines; hence I included it in.

cv::equalizeHist(gray, img);
medianBlur(img, img, 1);

IplImage img1 = img;
cvAddS(&img1, cvScalar(70,70,70), &img1);
//converting IplImage to cv::Mat  
Mat imgg = cvarrToMat(&img1);

medianBlur(imgg, imgg, 1);
cv::threshold(imgg, imgg, 120, 255, CV_THRESH_BINARY);
cv::Canny(img, img, 0, 20);

medianBlur(imgg, imgg, 1);

vector<Vec3f> circles;
/// Apply the Hough Transform to find the circles
HoughCircles(imgg, circles, CV_HOUGH_GRADIENT, 1, imgg.rows/8, 100, 30, 1, 5);
  • How can I overcome this problem?
  • Would hough circle method work?
  • Is there a better solution to detecting the iris region?
  • Are the parameters chosen correct?

Also note that the image is directly obtained from the webcam.

2
I'm doing similar project, but i need to detect many small dots and all of them are imperfect circles with lot of noises. I successfully detect them all using findContours(). Beforehand, i need to apply binary image and canny edgeazer89
I was also thinking findContours() method will be the route to go.Taking into account that my pupil does produce imperfect circles/semi-circles when a persons graze is directed at the bottom of the screen.I will try this method out and will post an update about the outcomes,asap. -Thank you.Sade
FindContours method isn't that reliable,at times it draws a random outline within the eye region.Is there an alternative or an improvement?Sade
My project is the development of an eye mouse and light seems to play a huge factor on the image.Help with regards to the detection of the pupil will be much appreciated as I have been stuck at this point for awhile.The threshold method gives a very clear,visible image of the pupil.Sade
I have discovered that when drawing the contours ,it outlines the white regions and therefore I needed to negate the image.Since there is discontinuity along the eyelid,only one enclosed region is outlined.How can I outline the largest/circular area(the region with the pupil) and disregard the eyebrow region(non circular region)?Sade

2 Answers

0
votes

Try using Daugman's Integro differential operator. It calculates the centre of the iris and pupil and draws an accurate circle on the iris and pupil boundaries. The MATLAB code is available here iris boundary detection using Daugman's method. Since I'm not familiar with OpenCV you could convert it.

0
votes

The binary eye image contained three different aspects eyelashes ,the eye and the eyebrow.The main aim is to get to the region of interest which is the eye/iris, excluding eyebrows and eyelashes.I followed these steps:-

Step 1: Discard the upper half of the eye image ,therefore we are left with eyelashes,eye region and small shadow regions .

Step 2:Find the contours

Step 3:Find largest contour so that we have just the eye region

Step 4:Use bounding box to create a rectangle around the eye area http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.html

Now we have the region of interest.From this point I am now exacting these images and using neural network to train the system to emulate properties of a mouse. Im currently learning about the neural network link1 and how to use it in opencv.

Using the previous methods which included detecting the iris point,creating an eye vector,tracking it and calculating the graze on the screen is time consuming .Also there is light reflected on the iris making it difficult to detect.