source: QMUL/trunk/DistanceCheck/README @ 19

Revision 19, 1.4 KB checked in by ginevra, 11 years ago (diff)
2Check distance
5This code is based on the face detection code provided by OpenCV and allows for the prediction of whether the user is staying still, approaching the camera or withdrawing.
7In the function detect_and_draw of the file face.cpp, the face is detected and the area of the face bounding box is returned for each frame.
8The values of the area are stored and used for the prediction of the type of movement (staying still, approaching the camera or withdrawing) using the functions of the class "DistanceCheck".
9The area of the face bounding box in the current frame is compared with the values of the area in a temporal window (currently set to size 4 frames) preceding it.
10If the area in the current frame does not change much from the area in the first frame of the window (a percentage of 0.1 has been defined in the code) then the user is regarded as staying still.
11If the area in the current frame is greater than the average area over the temporal window preceding it, then the user is predicted to be approaching the camera, otherwise to be withdrawing from it.
12You can experiment with the size of the window and with the percentage (see "percent" in the file distanceCheck.cpp) to see which values better suit your specific application.
14The code has been written and tested in Windows, but it should work under Linux as well.
15You will need to install OpenCV on your machine.
Note: See TracBrowser for help on using the repository browser.