source: level2/competencies/DistanceCheck/src/distanceCheck.h @ 233

Revision 170, 2.1 KB checked in by ginevra, 11 years ago (diff)
Line 
1// AUTHOR: Ginevra Castellano
2// Queen Mary University of London
3// DATE: 03/2009
4// VERSION: 1.0
5
6// Copyright (C) 2009 Ginevra Castellano
7
8// This file is part of the DistanceCheck program.
9
10// DistanceCheck is free software: you can redistribute it and/or modify
11// it under the terms of the GNU Lesser General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14
15// This program is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18// GNU Lesser General Public License for more details.
19
20// You should have received a copy of the GNU Lesser General Public License
21// along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23// DistanceCheck is based on the face detection code provided by OpenCV.
24// OpenCV: Copyright (C) 2000-2006, Intel Corporation, all rights reserved.
25// Third party copyrights are property of their respective owners.
26// See OpenCV_license.txt, in the program folder, for details.
27
28
29
30#ifndef _DISTANCE_CHECK
31#define _DISTANCE_CHECK
32
33
34#include <vector>
35
36enum MovementType {
37       
38        UNDEFINED = 0,
39        STAYING_STILL = 1,
40        APPROACHING = 2,
41        WITHDRAWING = 3
42};
43
44class DistanceCheck
45{
46        public:
47        DistanceCheck(int windowSize);
48        ~DistanceCheck();
49
50        double getAverageVal(int startValIndex, int endValIndex); // Calculate the average of the areas of the face bounding box
51        double getAverageValInWindow(void);     // Calculate the average of the areas of the face bounding box in a temporal window
52        int getMovementType(void);         // Detect the type of movement
53
54        void addFaceVal(int val);  // Store the values of the area of the face bounding box in a vector
55        void setFaceVal(int index, int val);   // Set a specific value for the area of the face bounding box
56
57        int getNumElements(void);  // Get the number of element in a vector
58
59        private:
60               
61                int windowSize;
62                std::vector<int> faceAreaVals;
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.