00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ARACTIONCOLORFOLLOW_H
00028 #define ARACTIONCOLORFOLLOW_H
00029
00030 #include "ariaTypedefs.h"
00031 #include "ariaUtil.h"
00032 #include "ArFunctor.h"
00033 #include "ArAction.h"
00034 #include "ArACTS.h"
00035 #include "ArPTZ.h"
00036
00039 class ArActionColorFollow : public ArAction
00040 {
00041
00042 public:
00043
00044 ArActionColorFollow(const char *name,
00045 ArACTS_1_2 *acts,
00046 ArPTZ *camera,
00047 double speed = 200,
00048 int width = 160,
00049 int height = 120);
00050
00051
00052 virtual ~ArActionColorFollow(void);
00053
00054
00055 virtual ArActionDesired *fire(ArActionDesired currentDesired);
00056
00057
00058 bool setChannel(int channel);
00059
00060
00061 void setCamera(ArPTZ *camera);
00062
00063
00064
00065 void setAcquire(bool acquire);
00066
00067
00068 void stopMovement(void);
00069
00070
00071 void startMovement(void);
00072
00073
00074 int getChannel();
00075
00076
00077
00078 bool getAcquire();
00079
00080
00081 bool getMovement();
00082
00083
00084 bool getBlob();
00085
00086
00087 enum TargetState
00088 {
00089 NO_TARGET,
00090 TARGET
00091 };
00092
00093
00094 enum MoveState
00095 {
00096 FOLLOWING,
00097 ACQUIRING,
00098 STOPPED
00099 };
00100
00101
00102 enum LocationState
00103 {
00104 LEFT,
00105 RIGHT,
00106 CENTER
00107 };
00108
00109 protected:
00110 ArActionDesired myDesired;
00111 ArACTS_1_2 *myActs;
00112 ArPTZ *myCamera;
00113 ArTime myLastSeen;
00114 TargetState myState;
00115 MoveState myMove;
00116 LocationState myLocation;
00117 bool myAcquire;
00118 bool killMovement;
00119 int myChannel;
00120 int myMaxTime;
00121 int myHeight;
00122 int myWidth;
00123 double mySpeed;
00124 };
00125
00126
00127 #endif // ARACTIONCOLORFOLLOW_H