Main Page | Namespace List | Class List | Directories | File List | Class Members | File Members

TestingClass.h

Go to the documentation of this file.
00001 /* TestingClass.h
00002 */
00003 
00004 #include "utility.h"
00005 #include "../PageLayoutLib/objectPairClass.h"
00006 #include "../Layout_hm/layout.h"
00007 #include "../PairVector_hm/pairshape.h"
00008 #include "../Utility_hm/TArray.h"
00009 
00010 class TestingClass
00011 {
00012 public:
00013         //TestingClass();
00014         TestingClass(string sourcedataset, string outputfile, int method);
00015         ~TestingClass();
00016 
00017         void    LoadTrainingResults(string trainrstfile);
00018         
00019         void    Run();
00020         void    Reset();
00021         
00022         // parameter setting routines
00023         void    SetSortFlag(bool flag) { m_sortflag = flag; }
00024         void    SetMaxNbTextlines(int m) { m_maxNbTxline = m; } 
00025         void    SetPairStyle( int m) { m_psv_style = m; }
00026         void    SetScoringMethod(int m) { m_neighbor = m; } //choices are: BEST_NEIGHBOR, NEAREST_NEIGHBOR and GAUSS_NEIGHBORHOOD
00027                                                                                                            // default is NEAREST_NEIGHBOR       
00028 private:
00029         string                          m_sDataPath;            // filefolder that holds the testing document images
00030         string                          m_outputFname;          // file for output testing scores
00031         cstring_array           m_FnameList;            // testing file name list
00032         int                                     m_nTestDoc;     
00033 
00034         CTArray<double>     m_scoreList;        // testing results/scores
00035         bool                            m_sortflag;                     // if true, then sort the scores
00036 
00037         int                                     m_method;
00038         int                                     m_psv_style; 
00039         int                                     m_neighbor;                     // methods to determine the neighbor of a testing polygon
00040         
00041         int                                     m_maxNbTxline;      // maximum number of textlines to be detected in the given document image 
00042         
00043 
00044         // parameters used with different training method
00045         pairshape_cluster_list *        m_wanted_pairshape_cluster;
00046         Clayout *                                       m_wanted_objcluster;
00047         objectPairClass *                       m_wanted_objPairClass;
00048 
00049         void    SortScores(cstring_array & source, CTArray<double> & scorearray, FILE *fp);
00050         
00051         /* trainig routines called with different m_method */
00052     void        RunPairGeneric();
00053 
00054         void    RunPairVector();
00055         
00056         void    RunObjVector();
00057 
00058 };

Generated on Tue Aug 29 11:42:40 2006 for PageLayoutDOCLIB by  doxygen 1.4.2