1 | initial version |
Dear Dereyly,
I could not reply for your comment as there were many words in my reply so I am posting this as a new answer.
Actually the detection process is done on image pyramids, Which means the image of size 640x480 is resized w.r.t to the scale-factor and the feature rectangle is put at every point on the scaled image, which means , say suppose we are checking on the 640x480 image with scale-factor equal to 1, now a feature like mentioned above 2x4 rectangle is put at every point in a sliding window fashion and checked for the MB-LBP value w.r.t their neighbors. Similarly every feature is put at every point and checked. Now the rectangular box at which all the features got passed is where the face is located.
Basically we train a cascade with a 24x24 or 20x20 image. So in the test process we check in this 24x24 rectangular box(this is not feature rectangle) where the selected features rectangles are based on this 24x24 image only. Now say suppose your 640x480 image has only one face which is occupying the entire frame, then you will get a detection of the face only at the scale-factor which reduces the 640x480 image to 24x24. So at this pyramid image you have only one point(one rectangular box) to be checked. So if you have 64 features then at this pyramid your feature mat will be of size 64x1 size only with the mat containing the pointers on the image where the feature rectangles are to be placed.
Even at the scale-factor 1 on 640x480 image your features mat is still 64x1 but the CascadeClassifier::runAt will take care of placing the 24x24 rectangular box at appropriate point on the image.
Regards, Sandeep John.V