Viola Jones Algorithm

  • Thread starter btb4198
  • Start date
  • Tags
    Algorithm
  • #1
572
10
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.
 

Answers and Replies

  • #2
1) Yes, for finding an eye, white = A + B and Black = D + C.2) You can set a threshold to determine when the eye has been found. If the value computed from subtracting the white area from the black area exceeds the threshold, then it is considered that the eye has been found.3) For a 3-rectangle feature such as the nose, you would need to solve for the areas of A, B, C, D, E and F. To find the nose, you would calculate the value as follows:double value = Math.Abs((values.A + values.D) - (values.B + values.E) - ( values.C + values.F));This is correct.
 

Suggested for: Viola Jones Algorithm

Replies
0
Views
380
Replies
1
Views
435
Replies
1
Views
512
Replies
4
Views
756
Replies
1
Views
559
Replies
28
Views
898
Replies
9
Views
802
Replies
30
Views
3K
Replies
7
Views
718
Back
Top