SegmentatorConfig.hxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SegmentatorConfig_
00023 #define _SegmentatorConfig_
00024
00025 #include "SearchArray.hxx"
00026 #include "ProcessingConfig.hxx"
00027 #include <iosfwd>
00028
00029 namespace CLAM {
00030
00031 typedef struct
00032 {
00033 TIndex id;
00034 TData threshold;
00035 TData percentil;
00036 TData nPreviousFrames;
00037 } TDescriptorsParams;
00038
00039 inline bool operator<(const TDescriptorsParams& param1,const TDescriptorsParams& param2)
00040 {
00041 if (param1.id<param2.id) return true;
00042 else return false;
00043 }
00044
00045 inline bool operator>=(const TDescriptorsParams& param1,const TDescriptorsParams& param2)
00046 {
00047 if (param1.id>=param2.id) return true;
00048 else return false;
00049 }
00050
00051 inline bool operator==(const TDescriptorsParams& param1,const TDescriptorsParams& param2)
00052 {
00053 if (param1.id==param2.id) return true;
00054 else return false;
00055 }
00056
00057 inline bool operator==(const TDescriptorsParams& param1,TIndex id)
00058 {
00059 if (param1.id==id) return true;
00060 else return false;
00061 }
00062
00063 std::ostream& operator << (std::ostream& myStream, const TDescriptorsParams& a);
00064
00065 std::istream& operator >> (std::istream& myStream, const TDescriptorsParams& a);
00066
00070 class SegmentatorConfig : public ProcessingConfig
00071 {
00072 friend class Segmentator;
00073 public:
00074 DYNAMIC_TYPE_USING_INTERFACE(SegmentatorConfig,2,ProcessingConfig);
00075 DYN_ATTRIBUTE (0, public, int, MinSegmentLength);
00076 DYN_ATTRIBUTE (1, public, Array<TDescriptorsParams>, DescriptorsParams);
00077 protected:
00078 void DefaultInit();
00079
00080 public:
00081 void AddDescParams(const TDescriptorsParams& descParams);
00082 bool FindDescParams(TDescriptorsParams& descParams);
00083 void ClearDescParams();
00084
00085 void SetDescriptorsSearch (const SearchArray<TDescriptorsParams> & frame) {
00086 mDescriptorsSearch=frame;
00087 }
00088 const SearchArray<TDescriptorsParams> & GetDescriptorsSearch () const {
00089 return mDescriptorsSearch;
00090 }
00091 SearchArray<TDescriptorsParams> & GetDescriptorsSearch () {
00092 return mDescriptorsSearch;
00093 }
00094 ~SegmentatorConfig(){};
00095 private:
00096 SearchArray<TDescriptorsParams> mDescriptorsSearch;
00097 };
00098
00099 }
00100
00101 #endif
00102