00001
00028 #ifndef __VETLIB_VETVISION_H__
00029 #define __VETLIB_VETVISION_H__
00030
00031 #include "vetDefs.h"
00032 #include "vetOutput.h"
00033 #include "vetObject.h"
00034
00035 #include "vetFrameYUV420.h"
00036 #include "vetFrameRGB24.h"
00037 #include "vetFrameT.h"
00038
00039
00040
00041 class vetVision : public vetOutput,
00042 public vetObject
00043 {
00044 protected:
00045
00046
00047
00048 void* (*alertCall)(void* argument);
00049 void* alertCallArgument;
00050
00051 void doAlert();
00052
00053
00054 public:
00055
00056
00057
00058 vetVision();
00059
00063 virtual ~vetVision();
00064
00065
00066
00067 void setAlertCall(void* (*functionCall)(void*) ) { alertCall = functionCall; };
00068 void setAlertCallArgument(void* arg) { alertCallArgument = arg; };
00069 void* getAlertCallArgument() { return alertCallArgument; };
00070
00071
00072
00073
00074 template<class T, class S, class J>
00075 static VETRESULT getDifference(vetFrameT<T>& diff_img, vetFrameT<S>& source_img, vetFrameT<J>& second_img);
00076
00077 static VETRESULT getDifference(vetFrameT<unsigned char>& diff_img, vetFrameT<unsigned char>& source_img, vetFrameT<unsigned char>& second_img);
00078 static VETRESULT getDifference(vetFrameT<int>& diff_img, vetFrameT<int>& source_img, vetFrameT<int>& second_img);
00079 static VETRESULT getDifference(vetFrameT<float>& diff_img, vetFrameT<float>& source_img, vetFrameT<float>& second_img);
00080
00081
00082 static VETRESULT getDifference(vetFrameYUV420& diff_img, vetFrameYUV420& source_img, vetFrameYUV420& second_img);
00083 static VETRESULT getDifference(vetFrameRGB24& diff_img, vetFrameRGB24& source_img, vetFrameRGB24& second_img);
00084
00085
00093 virtual VETRESULT reset() = 0;
00094
00095
00096
00097
00110 virtual VETRESULT importFrom(vetFrameYUV420& img) = 0;
00111
00124 virtual VETRESULT importFrom(vetFrameRGB24& img) = 0;
00125
00126
00139 virtual VETRESULT importFrom(vetFrameT<unsigned int>& img) = 0;
00140
00141
00142
00143
00144
00145
00146
00147 enum{ vetClassType = VETCLASS_TYPE_VISION };
00148 };
00149
00150
00151
00153
00154
00155 class vetVisionParameters
00156 {
00157
00158 protected:
00159
00160 bool doAlert;
00161 bool doEval;
00166 vetVisionParameters() { }
00167
00168 public:
00169
00173 virtual ~vetVisionParameters() {}
00174
00175
00176 void setDoEval(bool value = true);
00177 void setDoAlert(bool value = true);
00178
00188 VETRESULT saveToXML(const char* filename);
00189
00199 VETRESULT loadFromXML(const char* filename);
00200
00201
00202
00211 virtual VETRESULT saveToStreamXML(FILE *fp) = 0;
00212
00221 virtual VETRESULT loadFromStreamXML(FILE *fp) = 0;
00222
00223 };
00224
00225
00226 #endif //__VETLIB_VETVISION_H__
00227