How to robustly find the pupil on an image automatically?

10 ビュー (過去 30 日間)
Yuhan Yang
Yuhan Yang 2020 年 10 月 30 日
コメント済み: Stephan 2020 年 10 月 31 日
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?

採用された回答

Stephan
Stephan 2020 年 10 月 30 日
Using the imfindcircles function and giving some additional informations by using the options could help - play with sensitivity option and maybe other options. The following code worked for your example picture:
I = imread('image.png');
[c, r] = imfindcircles(I,[20 40],'ObjectPolarity','dark','Sensitivity',0.9)
imshow(I)
viscircles(c, r,'EdgeColor','b');
  2 件のコメント
Yuhan Yang
Yuhan Yang 2020 年 10 月 30 日
That works! Thanks for your help. By the way, what's the definition of the "metric" in the imfindcircles function? Can I use it as a measure of the accuracy of the segmentation?
Stephan
Stephan 2020 年 10 月 31 日
Not sure about that. Maybe Image Analyst knows.

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by