Segmentator.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 _Segmentator_hxx_
00023 #define _Segmentator_hxx_
00024
00025 #include "Processing.hxx"
00026 #include "SegmentatorConfig.hxx"
00027
00028 #include "Matrix.hxx"
00029
00030
00031
00032
00033
00034
00035 namespace CLAM
00036 {
00037
00038 class Segment;
00039 class SegmentDescriptors;
00040 class SegmentBoundaries;
00041
00042 enum {
00043 SpectralDescBase=150,
00044 SpectralMeanId = SpectralDescBase,
00045 SpectralGeometricMeanId = SpectralDescBase+1,
00046 SpectralEnergyId = SpectralDescBase+2,
00047 SpectralCentroidId = SpectralDescBase+3,
00048 SpectralMoment2Id = SpectralDescBase+4,
00049 SpectralMoment3Id = SpectralDescBase+5,
00050 SpectralMoment4Id = SpectralDescBase+6,
00051 SpectralMoment5Id = SpectralDescBase+7,
00052 SpectralMoment6Id = SpectralDescBase+8,
00053 SpectralFlatnessId = SpectralDescBase+9,
00054 SpectralKurtosisId = SpectralDescBase+10,
00055
00056 FrameDescBase = 175,
00057 FundamentalId = FrameDescBase,
00058
00059 SegmentatorBase = 200,
00060 MinSegmentLenghtId = SegmentatorBase,
00061
00062 AudioDescriptorBase = 250,
00063 AudioMeanId = AudioDescriptorBase,
00064 AudioEnergyId = AudioDescriptorBase + 1,
00065 AudioVarianceId = AudioDescriptorBase + 2,
00066 AudioCentroidId = AudioDescriptorBase + 3,
00067 AudioZeroCrossingRateId = AudioDescriptorBase + 4
00068 };
00069
00070
00071 class Segmentator : public Processing
00072 {
00073 public:
00074 Segmentator();
00075 Segmentator(const SegmentatorConfig& c);
00076 virtual ~Segmentator();
00077 const char * GetClassName() const {return "Segmentator";}
00078 const ProcessingConfig& GetConfig() const {return mConfig;}
00079 bool Do();
00080 bool Do(Segment& originalSegment,SegmentDescriptors& descriptors);
00081
00082 protected:
00083 SegmentatorConfig mConfig;
00084 private:
00085 void DataFusion(Segment& s,const SegmentBoundaries& segmentBoundaries);
00086 bool ConcreteConfigure(const ProcessingConfig& c);
00087
00088
00089
00090 virtual void Algorithm(Segment& s,const Matrix& values);
00091 protected:
00092 virtual void UnwrapDescriptors(const Segment& originalSegment,SegmentDescriptors& descriptors ,Matrix& descriptorsValues);
00093 };
00094
00095 }
00096
00097 #endif // _Segmentator_hxx_
00098