Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shapeclustering.cpp File Reference
#include "base/commandlineflags.h"
#include "commontraining.h"
#include "mastertrainer.h"
#include "params.h"
#include "strngs.h"

Go to the source code of this file.

Functions

 INT_PARAM_FLAG (display_cloud_font,-1,"Display cloud of this font, canonical_class1")
 
 INT_PARAM_FLAG (display_canonical_font,-1,"Display canonical sample of this font, canonical_class2")
 
 STRING_PARAM_FLAG (canonical_class1,"","Class to show ambigs for")
 
 STRING_PARAM_FLAG (canonical_class2,"","Class to show ambigs for")
 
int main (int argc, char **argv)
 

Function Documentation

INT_PARAM_FLAG ( display_cloud_font  ,
1,
"Display cloud of this  font,
canonical_class1"   
)
INT_PARAM_FLAG ( display_canonical_font  ,
1,
"Display canonical sample of this  font,
canonical_class2"   
)
int main ( int  argc,
char **  argv 
)

Public Function Prototypes

Definition at line 48 of file shapeclustering.cpp.

48  {
49  ParseArguments(&argc, &argv);
50 
51  STRING file_prefix;
53  argc, argv, false, NULL, &file_prefix);
54 
55  if (!trainer)
56  return 1;
57 
58  if (FLAGS_display_cloud_font >= 0) {
59  #ifndef GRAPHICS_DISABLED
60  trainer->DisplaySamples(FLAGS_canonical_class1.c_str(),
61  FLAGS_display_cloud_font,
62  FLAGS_canonical_class2.c_str(),
63  FLAGS_display_canonical_font);
64  #endif // GRAPHICS_DISABLED
65  return 0;
66  } else if (!FLAGS_canonical_class1.empty()) {
67  trainer->DebugCanonical(FLAGS_canonical_class1.c_str(),
68  FLAGS_canonical_class2.c_str());
69  return 0;
70  }
71  trainer->SetupMasterShapes();
72  WriteShapeTable(file_prefix, trainer->master_shapes());
73  delete trainer;
74 
75  return 0;
76 } /* main */
MasterTrainer * LoadTrainingData(int argc, const char *const *argv, bool replication, ShapeTable **shape_table, STRING *file_prefix)
void ParseArguments(int *argc, char ***argv)
#define NULL
Definition: host.h:144
Definition: strngs.h:40
const ShapeTable & master_shapes() const
void DisplaySamples(const char *unichar_str1, int cloud_font, const char *unichar_str2, int canonical_font)
void DebugCanonical(const char *unichar_str1, const char *unichar_str2)
void WriteShapeTable(const STRING &file_prefix, const ShapeTable &shape_table)
STRING_PARAM_FLAG ( canonical_class1  ,
""  ,
"Class to show ambigs for"   
)
STRING_PARAM_FLAG ( canonical_class2  ,
""  ,
"Class to show ambigs for"   
)