source: level2/competencies/DistanceCheck/README @ 171

Revision 171, 1.5 KB checked in by ginevra, 11 years ago (diff)
2Check distance
5This code is based on the face detection code provided by OpenCV
6and allows for the prediction of whether the user is staying still,
7approaching the camera or withdrawing.
9In the function detect_and_draw of the file face.cpp, the face is
10detected and the area of the face bounding box is returned for each frame.
11The values of the area are stored and used for the prediction of the type of movement (staying still, approaching the camera or withdrawing)
12using the functions of the class "DistanceCheck".
13The area of the face bounding box in the current frame is compared with
14the values of the area in a temporal window (currently set to size 4 frames) preceding it.
15If 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.
16If 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.
17You 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.
19The code has been written and tested in Windows, but it should work under Linux as well.
21You will need to install OpenCV on your machine.
23Questions to:
Note: See TracBrowser for help on using the repository browser.