# How does the vision.Cas​cadeObject​Detector detect left and right eyes separately? It is constantly detecting left and right as the same eye.

조회 수: 3 (최근 30일)
Louis Quinn 2014년 9월 17일
I am using the vision.CascadeObjectDetector to find eyes in facial images.
I am reading in the image, converting to gray scale and performing the detection similar to the face detection tutorial here: http://www.mathworks.com.au/help/vision/ref/vision.cascadeobjectdetector-class.html
and using 'LeftEyeCART' and 'RightEyeCART' as classification models.
The for some images in my database the detector is finding the left and right eyes to be the same eyes, with no notable variation in image causing the false detection. See the images below:
How does it work? Does it scan the image from the right hand side to find eyes and simply missed the left eye? Therefore will I have to do some pre - processing on the images to aid the detection? Will I have to train a Cascade Object Detector like this example: http://www.mathworks.com.au/help/vision/ug/train-a-cascade-object-detector.html
for my dataset?

댓글을 달려면 로그인하십시오.

### 답변 (3개)

Dima Lisin 2014년 9월 17일
If both eyes are visible, you would be better off trying to detect the pair of eyes using 'EyePairBig' and 'EyePairSmall' models. Single eye detectors are more useful in cases when only one eye is visible.
##### 댓글 수: 2없음 표시없음 숨기기
Ushna Asif 2015년 11월 21일
I want to detect left and right separately and I also having the same problem kindly help.
Dima Lisin 2016년 1월 26일
Why not detect both eyes, and then split the resulting bounding box in half?

댓글을 달려면 로그인하십시오.

ibrahim thamary 2017년 12월 26일
try this:
BB=step(EyeDetect,I);
x=length(BB(:,4));
%To detect Eyes
I2 = imcrop(I,BB(x,:));
figure,imshow(I2);
rectangle('Position',BB,'LineWidth',4,'LineStyle','-','EdgeColor','b');
%To detect the left
na1 = I2(:, 1 : floor(end/2.3));
figure,imshow(na1);
%To detect the right
na2 = I2(:, floor(end/(2.24))+1 : end );
figure,imshow(na2);
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Luis Orlando Mendoza Guerrero 2020년 11월 10일
hi,
when i copy, line 8 has error... 'Value must be a 4 element vector'

댓글을 달려면 로그인하십시오.

Karbala'a Unvi. Science 2019년 10월 14일
Thank you for this explanation

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Video Formats and Interfaces에 대해 자세히 알아보기

### Community Treasure Hunt

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

Start Hunting!

Translated by