MATLAB Answers

Unable to detect Iris boundary using imfind circles

2 views (last 30 days)
Karthik Krishnan
Karthik Krishnan on 21 Jul 2021
Commented: Matt J on 25 Jul 2021
Canny_img = edge(newI,'canny');
title('Edge detected')
title('Circle Detected Image')
[centers, radii] = imfindcircles(Canny_img,[20 150],'Sensitivity',0.8);
centersStrong = centers(:,:);
radiiStrong = radii(:);
%metricStrong5 = metric(1:2);
viscircles(centersStrong, radiiStrong,'EdgeColor','b');
this is my code it detects the inner circle not the outer one. pls help

Sign in to comment.

Accepted Answer

Matt J
Matt J on 21 Jul 2021
Edited: Matt J on 21 Jul 2021
Increasing the lower radius bound as suggested by @Jonas as well as increasing the sensitivity setting seems to help:
A=any( imbinarize(imread('')) ,3);
[centers, radii] = imfindcircles(A,[50 150],'Sensitivity',0.96);
viscircles(centers, radii,'EdgeColor','b');
Matt J
Matt J on 25 Jul 2021
Because your posted image looks binary. It might indeed be better to try to detect the circles in the original color image.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by