tesseract  3.04.00
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 47 of file shapeclustering.cpp.

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