tesseract  5.0.0-alpha-619-ge9db
shapeclustering.cpp File Reference
#include "commontraining.h"
#include "mastertrainer.h"
#include "params.h"
#include <tesseract/strngs.h>

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 47 of file shapeclustering.cpp.

47  {
48  tesseract::CheckSharedLibraryVersion();
49 
50  ParseArguments(&argc, &argv);
51 
52  STRING file_prefix;
53  tesseract::MasterTrainer* trainer =
54  tesseract::LoadTrainingData(argc, argv, false, nullptr, &file_prefix);
55 
56  if (!trainer)
57  return 1;
58 
59  if (FLAGS_display_cloud_font >= 0) {
60 #ifndef GRAPHICS_DISABLED
61  trainer->DisplaySamples(FLAGS_canonical_class1.c_str(),
62  FLAGS_display_cloud_font,
63  FLAGS_canonical_class2.c_str(),
64  FLAGS_display_canonical_font);
65 #endif // GRAPHICS_DISABLED
66  return 0;
67  } else if (!FLAGS_canonical_class1.empty()) {
68  trainer->DebugCanonical(FLAGS_canonical_class1.c_str(),
69  FLAGS_canonical_class2.c_str());
70  return 0;
71  }
72  trainer->SetupMasterShapes();
73  WriteShapeTable(file_prefix, trainer->master_shapes());
74  delete trainer;
75 
76  return 0;
77 } /* main */
tesseract::MasterTrainer::master_shapes
const ShapeTable & master_shapes() const
Definition: mastertrainer.h:192
STRING
Definition: strngs.h:45
tesseract::MasterTrainer::DisplaySamples
void DisplaySamples(const char *unichar_str1, int cloud_font, const char *unichar_str2, int canonical_font)
Definition: mastertrainer.cpp:695
tesseract::WriteShapeTable
void WriteShapeTable(const STRING &file_prefix, const ShapeTable &shape_table)
Definition: commontraining.cpp:179
tesseract::MasterTrainer
Definition: mastertrainer.h:69
tesseract::MasterTrainer::SetupMasterShapes
void SetupMasterShapes()
Definition: mastertrainer.cpp:245
tesseract::LoadTrainingData
MasterTrainer * LoadTrainingData(int argc, const char *const *argv, bool replication, ShapeTable **shape_table, STRING *file_prefix)
Definition: commontraining.cpp:211
ParseArguments
void ParseArguments(int *argc, char ***argv)
Definition: commontraining.cpp:122
tesseract::MasterTrainer::DebugCanonical
void DebugCanonical(const char *unichar_str1, const char *unichar_str2)
Definition: mastertrainer.cpp:635