# Viola Jones Algorithm

• btb4198

#### btb4198

I am coding the Viola-Jones algorithm in C# and I have a few questions. For finding an eye, after I have my integral Image, I am passing a 24 X 24 Rectangle across the whole image from left to right and top to bottom. I subtract the black area from the white. So right now, I am solving for the area of A, B, C and D as I move across the integral Image and then I do
whiteRectangleArea = values.B + values.A;
blackRectangleArea = values.D + values.C;
double value = Math.Abs(whiteRectangleArea - blackRectangleArea);

1) For finding an eye would it be: white = A + B and Black = D + C?

2)How do I know when I have found the Eye? Like is there a specific value I am looking for? I watched a simulator that stopped right when it got to the object it was looking for, but I am not sure how it knows it found it.

3) Because the eyes are a two rectangles feature you only need to solve for the area of A, B, C and D. but for the Nose with is a 3 rectangles features you need to solve for the areas of A,B,C,D,E and F right?

Therefore, to find a nose you would do this.
double value = Math.Abs((values.A + values.D) - (values.B + values.E) - ( values.C + values.F));

Is this right?

Also, Yes I do know opencv does this, but I would like to learn how it code it.