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

TrainingClass.h

Go to the documentation of this file.
00001 /* TrainingClass.h
00002  */
00003 #include "../ObjectVector_hm/objcluster.h"
00004 #include "../Layout_hm/layout.h"
00005 #include "../PageLayoutLib/objectPairClass.h"
00006 #include "utility.h"
00007 
00008 
00009 class TrainingClass
00010 {
00011 public: 
00012         //TrainingClass();
00013         TrainingClass(char * wantedfiles, char* unwantedfiles, char* wantedoutput, char * unwantedoutput, int method = PAIR_GENERIC);
00014         ~TrainingClass();
00015 
00016         void    Run();
00017         void    Reset();
00018         
00019         // parameter setting routines
00020         void    SetMethod(int m){ m_method = m; }
00021         void    SetMergyStyle(int m) { m_mergy_style = m; }
00022         void    SetMaxNbTextlines(int m) { m_maxNbTxline = m; }
00023 
00024         // for kmeans clustering for SINGLE_VECTOR_XXX methods only
00025         void    SetNbIterations(int m) {m_maxIter = m; }
00026         void    SetWantedObjClusterNumber(int m) { m_nWantedObjCluster = m;}
00027         void    SetUnwantedObjClusterNumber(int m) { m_nUnwantedObjCluster = m;}
00028         void    SetPairStyle( int m) { m_psv_style = m; }
00029 
00030 private:
00031         string                  m_sWanted_input_path;
00032         string                  m_sUnwanted_input_path;
00033         string                  m_sWanted_output_fname;
00034         string                  m_sUnwanted_output_fname;
00035 
00036         int                             m_method;                               // training method
00037         int                             m_mergy_style;          // mergy method used in PairGeneric training process 
00038 
00039         cstring_array   m_WantedFnameList;          // training filename list (wanted)
00040         int                             m_nWantedDoc;
00041 
00042         cstring_array   m_UnwantedFnameList;    // training filename list (unwanted)
00043         int                             m_nUnwantedDoc;
00044 
00045         int                             m_maxNbTxline;         // maximum number of textlines to be detected in the given document image 
00046         int                             m_nWantedObjCluster;   // Targeted number of wanted object(5d textline description vector) cluter
00047         int                             m_nUnwantedObjCluster; // .....              unwanted
00048 
00049         int                             m_maxIter;             // maximum interations in Kmeans clustering    
00050 
00051         int                             m_psv_style;               // for PAIR_VECTOR_XXXX method, choices are :PSV_N_1 and PSV_N_2     
00052 
00053 private:
00054         
00055         // mergy objPairs from one or multiple documents into several clusters
00056         // called in PairGeneric method, with mergy style DYN_APPROXIMATED.
00057         void    MergePairs(objectPairClass *dest, objectPairClass** source, int nDoc); 
00058 
00059         /* training routines called with different m_method */
00060         
00061         void    RunPairGeneric();
00062         
00063         void    RunPairVRoutines();
00064         
00065         void    RunObjVRoutines();
00066 
00067 };

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