source: level2/competencies/DistanceCheck/README @ 170

Revision 170, 1.5 KB checked in by ginevra, 10 years ago (diff)
Line 
1************************************
2Check distance
3************************************
4
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.
8
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.
18
19The code has been written and tested in Windows, but it should work under Linux as well.
20
21You will need to install OpenCV on your machine.
Note: See TracBrowser for help on using the repository browser.