#ifndef svm_rbf_H #define svm_rbf_H #include #include namespace mpt { class svm_rbf { public: static const unsigned int feature_vector_length = 1104; static const unsigned int num_support_vectors = 52; public: svm_rbf( const std::string &ay_path, const std::string &vs_path ); ~svm_rbf(); double decision( const std::vector &histogram, double g ); private: void load_ay( const std::string &path ); void load_vs( const std::string &path ); private: std::vector ay; std::vector vs; }; } // end namespace mpt /* * filename = path to text file containing support vector coefficients (e.g., "ay.txt"). * Returns ay [NUM_SUPPORT_VECTORS], which must be freed by the caller. */ //double *load_ay (char *filename); /* * filename = path to text file containing support vectors (e.g., "VS.txt"). * Returns VS [NUM_SUPPORT_VECTORSxFEATURE_VECTOR_LENGTH], which must be freed by the caller. */ //double *load_VS (char *filename); /* h=histogram representation [1xFEATURE_VECTOR_LENGTH] VS = support vector in histogram representation [NUM_SUPPORT_VECTORSxFEATURE_VECTOR_LENGTH]. ay = coefficients of support [NUM_SUPPORT_VECTORSx1] g = gaussian width [1x1] Returns y [1x1] */ //double svm_rbf (double *h, double *VS, double *ay, double g); #endif