MATLAB Answers


Circle detection for eye

Asked by Teik Jin Lim on 18 Nov 2019 at 13:55
Latest activity Commented on by Image Analyst
on 19 Nov 2019 at 12:30
Hi everyone, I am stuck with this for weeks. After I input a face image,
First: I perform the viola jones eye region detection by using the vision.CascadeObjectDetector
Second: I perform the Canny edge detection based on the eye region that was detected during the first stage.
a = imread('face.jpg');
detector = vision.CascadeObjectDetector('EyePairSmall');
bbox = step(detector,a);
out = insertObjectAnnotation (a,'rectangle',bbox,'detection');
outb = imcrop(out,bbox);
[hog1,visualization] = extractHOGFeatures(outb,'CellSize',[8 8]);
I = rgb2gray(outb);
BW = edge(I,'canny');
After that, the image shown is like this:
May I know how can I detect the iris (circle shape) based on the output of Canny edge detection ?
As the region has will only have two circles detected, how is it possible to be implemented ?
I read about the imfindcircle before, but it doesn't work out. Might need the community helps and some guidance on this.
Much appreciated. Thank you !


KALYAN ACHARJYA on 18 Nov 2019 at 14:00
Iris circle?
Teik Jin Lim on 19 Nov 2019 at 0:15
Yaya. Iris circle

Sign in to comment.

1 Answer

Image Analyst
Answer by Image Analyst
on 19 Nov 2019 at 1:34

Why are you using edge detection???
I'd first try thresholding the red channel, and if that is not robust enough, try imfindcircles().


Show 1 older comment
Image Analyst
on 19 Nov 2019 at 3:39
mask = rgbImage(:,:,1) < someThresholdValue; % You pick what someThresholdValue is.
Try adjusting some of the parameters to imfindcircles().
Teik Jin Lim on 19 Nov 2019 at 12:16
Can you write it in complete form ? I donno what are you talking about. Too random haha.
I am new to Matlab
Image Analyst
on 19 Nov 2019 at 12:30
OK, what is the name of your image? What did you call the variable?
Can you attach the cropped eye image alone? (Use imwrite()).

Sign in to comment.