All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
set_unicharset_properties.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include <string>
#include "commandlineflags.h"
#include "tprintf.h"
#include "unicharset_training_utils.h"

Go to the source code of this file.

Functions

 STRING_PARAM_FLAG (script_dir,"","Directory name for input script unicharsets/xheights")
 
 DECLARE_STRING_PARAM_FLAG (U)
 
 DECLARE_STRING_PARAM_FLAG (O)
 
 DECLARE_STRING_PARAM_FLAG (X)
 
int main (int argc, char **argv)
 

Function Documentation

DECLARE_STRING_PARAM_FLAG ( )
DECLARE_STRING_PARAM_FLAG ( )
DECLARE_STRING_PARAM_FLAG ( )
int main ( int  argc,
char **  argv 
)

This program reads in a text file consisting of feature samples from a training page in the following format:

   FontName UTF8-char-str xmin ymin xmax ymax page-number
    NumberOfFeatureTypes(N)
      FeatureTypeName1 NumberOfFeatures(M)
         Feature1
         ...
         FeatureM
      FeatureTypeName2 NumberOfFeatures(M)
         Feature1
         ...
         FeatureM
      ...
      FeatureTypeNameN NumberOfFeatures(M)
         Feature1
         ...
         FeatureM
   FontName CharName ...

The result of this program is a binary inttemp file used by the OCR engine.

Parameters
argcnumber of command line arguments
argvarray of command line arguments
Returns
none
Note
Exceptions: none
History: Fri Aug 18 08:56:17 1989, DSJ, Created.
History: Mon May 18 1998, Christy Russson, Revistion started.

Definition at line 22 of file set_unicharset_properties.cpp.

22  {
23  tesseract::ParseCommandLineFlags(argv[0], &argc, &argv, true);
24 
25  // Check validity of input flags.
26  if (FLAGS_U.empty() || FLAGS_O.empty()) {
27  tprintf("Specify both input and output unicharsets!\n");
28  exit(1);
29  }
30  if (FLAGS_script_dir.empty()) {
31  tprintf("Must specify a script_dir!\n");
32  exit(1);
33  }
34 
35  tesseract::SetPropertiesForInputFile(FLAGS_script_dir.c_str(),
36  FLAGS_U.c_str(), FLAGS_O.c_str(),
37  FLAGS_X.c_str());
38  return 0;
39 }
#define tprintf(...)
Definition: tprintf.h:31
void ParseCommandLineFlags(const char *usage, int *argc, char ***argv, const bool remove_flags)
void SetPropertiesForInputFile(const string &script_dir, const string &input_unicharset_file, const string &output_unicharset_file, const string &output_xheights_file)
STRING_PARAM_FLAG ( script_dir  ,
""  ,
"Directory name for input script unicharsets/xheights"   
)