Purpose: I am trying to get the size of the iris (width / radius) using video as input.
I tried HoughCircles, but it seems that it is not accurate, because the circle of the iris does not seem so accurate. What information do I already have the center of the pupil point of the eye and its radius.
Grayscale
I was asked to find the edge of the iris in order to try to measure the magnitude of the gradient, starting from the center of the pupil going out. Then use the histogram, using the accumulation of the maximum gradient to find the width of the aperture. I'm not quite sure how to implement this, starting from a certain point.
I used the Sobel operator on the eye's ROI to try to get the gradient with the output shown below.
Sobel eye
Sobel Image Code:
void irisFind(Mat gradMat, Point2i pupCenter, int pupRad){ imshow("original", gradMat); Mat gradX; Mat gradY; Mat absGradX; Mat absGradY; GaussianBlur(gradMat, gradMat, Size(3, 3), 0, 0, BORDER_DEFAULT); equalizeHist(gradMat, gradMat);
I am not quite sure how to proceed. Any suggestions or comments are appreciated. Also, please let me know if I missed any information, or if I am vague about something. Thank you very much in advance!
EDIT: I had to better explain the context of my application, so I apologize for that. I measure the pupil expansion of the eye over the frames from the video input. I already know the location of the center point of the pupil and the radius of the pupil. I am trying to find the size of the iris, so that changes in the distance from the eye to the camera can be used to compensate for the misinterpreted values โโof the pupil size, because if the eye gets closer to the camera, the pupil, of course, will appear more without dilatation. I could also try other ways to explain this, such as the angles of the eyes, but I thought that since I already have a few student functions that I will start with the diaphragm.
Again, sorry to leave this item before. Thanks!