00001 #pragma once
00002
00003 #include <cstdio>
00004 #include <cstdlib>
00005
00006
00007 #include "libutil.h"
00008
00009 #ifdef WIN32
00010 #if defined _USRDLL
00011 #define DllExport _declspec(dllexport)
00012 #else
00013 #define DllExport _declspec(dllimport)
00014 #endif
00015 #else
00016 #define DllExport
00017 #endif
00018
00019
00020 class DllExport CHLabDTW
00021 {
00022 const float*** m_pppfTestFeat;
00023 const float*** m_pppfRefFeat;
00024
00025 int m_iTestFeatLen;
00026 int m_iRefFeatLen;
00027 int m_iTestFeatDim;
00028 int m_iRefFeatDim;
00029
00030 int m_iT;
00031 float m_fBestScore;
00032
00033 const float INF;
00034
00035
00036
00037 float** m_ppfScoreTable;
00038 float* m_pfLocalDist;
00039
00040 float m_fPruneTH;
00041
00042
00043
00044 public:
00045 CHLabDTW(void);
00046 virtual ~CHLabDTW(void);
00047
00048 void SetTestFeat(const float*** pppfTestFeat, int iTestFeatLen, int iTestFeatDim)
00049 {
00050 m_pppfTestFeat = pppfTestFeat;
00051 m_iTestFeatLen = iTestFeatLen;
00052 m_iTestFeatDim = iTestFeatDim;
00053 }
00054
00055 void SetRefFeat(const float*** pppfRefFeat, int iRefFeatLen, int iRefFeatDim)
00056 {
00057 m_pppfRefFeat = pppfRefFeat;
00058 m_iRefFeatLen = iRefFeatLen;
00059 m_iRefFeatDim = iRefFeatDim;
00060 }
00061
00062 int Init(void);
00063
00064 float Run(float fTH);
00065
00066 float EuclideanDistance(int iTestFrameIndex, int iRefFrameIndex);
00067
00068 float GetFinalScore(void);
00069
00070
00071 };