00001 00029 #ifndef __VETLIB_VETMOTIONLAME_H__ 00030 #define __VETLIB_VETMOTIONLAME_H__ 00031 00032 #include "../vetDefs.h" 00033 #include "../vetVision.h" 00034 00035 #include "../vetFilter.h" // vetFilterParameters ! 00036 00037 #include "../vetFrameYUV420.h" 00038 #include "../vetFrameRGB24.h" 00039 #include "../vetFrameT.h" 00040 00041 00042 class vetMotionLameParameters; 00043 00044 00051 class vetMotionLame : public vetVision 00052 { 00053 protected: 00054 00055 vetMotionLameParameters* myParams; 00056 00057 vetFrameRGB24* buffer; 00058 00059 vetFrameRGB24* diff; 00060 00061 // parametri x soglia 00062 00063 long lastDiffValue; 00064 00065 00066 //TODO..int alertCallArgumentScript; 00067 00068 void initFrame(vetFrameRGB24& img); 00069 00070 VETRESULT evalDifference(vetFrameRGB24& diff_img); 00071 00072 public: 00073 00074 00075 vetMotionLame(vetMotionLameParameters* initParams = NULL ); 00076 ~vetMotionLame(); 00077 00078 VETRESULT setParameters(vetMotionLameParameters* initParams); 00079 vetMotionLameParameters& getParameters() { return *myParams; }; 00080 00081 VETRESULT reset(); 00082 00083 unsigned int getLastDifferenceValue() { return lastDiffValue; }; 00084 00085 00086 00087 static long getDifferenceBrightnessValue(vetFrameRGB24& diff_img); 00088 00089 00090 00091 00092 00093 // used into operator >> 00094 VETRESULT importFrom(vetFrameYUV420& img); 00095 VETRESULT importFrom(vetFrameRGB24& img); 00096 VETRESULT importFrom(vetFrameT<unsigned char>& img); 00097 00098 00099 }; 00100 00101 00102 00104 00105 00106 00107 class vetMotionLameParameters : public vetVisionParameters 00108 { 00109 00110 protected: 00111 00112 00113 long threshold; 00114 00115 friend class vetMotionLame; 00116 00117 public: 00118 00119 vetMotionLameParameters(long threshold = 1, bool doAlert = false, bool doEval = true); 00120 // ~vetMotionLameParameters() {} 00121 00122 void reset(); 00123 00124 void setThresholdValue(long value); 00125 long getThresholdValue() { return threshold; }; 00126 00127 00136 VETRESULT saveToStreamXML(FILE *fp); 00137 00146 VETRESULT loadFromStreamXML(FILE *fp); 00147 00148 }; 00149 00150 #endif //__VETLIB_VETMOTIONLAME_H__ 00151
1.4.4