00001 #ifndef _CSU_RECOGNIZER_H
00002 #define _CSU_RECOGNIZER_H
00003
00004 #include "csu/csuPreprocessNormalize.h"
00005 #include "csu/csuSubspaceTrain.h"
00006 #include <string>
00007 #include "common.h"
00008
00009 class csu_recognizer{
00010 public:
00011 csu_recognizer(string filename);
00012 csu_recognizer();
00013 void add_image(GrayImage & to_add, string name, unsigned int lx, unsigned int ly
00014 , unsigned int rx, unsigned int ry);
00015 void compute_distance(GrayImage & test, double & distance, string & name);
00016 void compute_distance(GrayImage & test, double & distance, string & name,
00017 unsigned int lx, unsigned int ly, unsigned int rx, unsigned int ry);
00018 void update(void);
00019 void save(string fileName);
00020 private:
00021 vector<string> names;
00022 csu::Matrix mean;
00023 csu::Matrix values;
00024 csu::Matrix basis;
00025 csu::Matrix images;
00026 csu::Matrix projected_images;
00027 string filename;
00028 bool set;
00029 };
00030
00031 #ifndef NO_GTK
00032 void eigentrainTest(GrayImage *input, vector<unsigned int> lx,
00033 vector<unsigned int> ly, vector<unsigned int> rx,
00034 vector<unsigned int> ry);
00035
00036
00037 GrayImage * preprocess_test(GrayImage * input, unsigned int lx,unsigned int ly
00038 , unsigned int rx, unsigned int ry);
00039
00040 #endif
00041 #endif