eye detection is shaky [closed]

asked 2016-01-13 05:34:49 -0600

sarmad gravatar image

Hi everyone.

I have problem with eye detection , it is very shaky is there a way to make it stable . I have uploaded video of this :

eye detection

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-09-29 03:08:41.571202

Comments

In that video there is an error because there is no detection and you are trying to access some area in the frame that do not exists (outside of image border). For this you can do a verification like if (faces.empty()) { break; } (the same for the eyes) in your processing loop. I do not see to much shaking, but for remove it add some tracker for the face and for the eyes too. You will gain in speed too.

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-13 06:12:28 -0600 )edit

I run face detector and then eye detector after that I extract the eye region

sarmad gravatar imagesarmad ( 2016-01-13 08:06:42 -0600 )edit

Can you post the part of detection face, then eye, then the extraction of the eye (just the region)?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-14 02:34:35 -0600 )edit

Here is the code

sarmad gravatar imagesarmad ( 2016-01-14 06:03:34 -0600 )edit

your problems is in detectLargestObject: you are choosing the first object always, but it could be a wrong one. It is a little bit hard to find an example, but just print your rects on every frame see what you get. I am sure that you get a rectangle with tl corner with at least one coordinate negative...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-14 07:22:22 -0600 )edit

What can I do to resolve this problem

sarmad gravatar imagesarmad ( 2016-01-14 10:29:08 -0600 )edit

Start simple, add some lines that prints the rects of the face, and the 2 eyes to see exactly what is happening, then add the info in the question and I will try to help you further. Be careful to print them before displaying them ;)

thdrksdfthmn gravatar imagethdrksdfthmn ( 2016-01-15 03:23:14 -0600 )edit