Tesseract  3.02
tesseract-ocr/training/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 43 of file shapeclustering.cpp.

                                {
  ParseArguments(&argc, &argv);

  STRING file_prefix;
  tesseract::MasterTrainer* trainer = tesseract::LoadTrainingData(
      argc, argv, false, NULL, &file_prefix);

  if (FLAGS_display_cloud_font >= 0) {
        #ifndef GRAPHICS_DISABLED 
    trainer->DisplaySamples(FLAGS_canonical_class1.c_str(),
                            FLAGS_display_cloud_font,
                            FLAGS_canonical_class2.c_str(),
                            FLAGS_display_canonical_font);
    #endif  // GRAPHICS_DISABLED
    return 0;
  } else if (!FLAGS_canonical_class1.empty()) {
    trainer->DebugCanonical(FLAGS_canonical_class1.c_str(),
                            FLAGS_canonical_class2.c_str());
    return 0;
  }
  trainer->SetupMasterShapes();
  WriteShapeTable(file_prefix, trainer->master_shapes());
  delete trainer;

  return 0;
} /* main */
STRING_PARAM_FLAG ( canonical_class1  ,
""  ,
"Class to show ambigs for"   
)
STRING_PARAM_FLAG ( canonical_class2  ,
""  ,
"Class to show ambigs for"   
)