I have images like this:
They are from mouse eye reocording. I want to develop a code that can automatically draw the pupil on each image. At frist, I binarize the images like this and use the binarized image to find the pupil:
binaryImage = ~imbinarize(img,0.05);binaryImage=imfill(binaryImage,'holes');binaryImage=bwmorph(binaryImage,'open');
However, the method is not robust to corneal reflection (the super bright spot on the image), whisker arosal (the bright line). And when the pupil is large as the image shown above, it can't detect the pupil accurately around the edge. Here's the binarized result of the above image
I think the binarization method is not superior as it doesn't consider a condition that the pupil is round. Is there a better algorithm to solve it?