diff --git a/src/training/classifier_tester.cpp b/src/training/classifier_tester.cpp index 0a8ff01b..edbb81c9 100644 --- a/src/training/classifier_tester.cpp +++ b/src/training/classifier_tester.cpp @@ -32,7 +32,6 @@ static STRING_PARAM_FLAG(classifier, "", "Classifier to test"); static STRING_PARAM_FLAG(lang, "eng", "Language to test"); static STRING_PARAM_FLAG(tessdata_dir, "", "Directory of traineddata files"); -DECLARE_INT_PARAM_FLAG(debug_level); enum ClassifierName { CN_PRUNER, diff --git a/src/training/cntraining.cpp b/src/training/cntraining.cpp index c55fdaeb..b20282bb 100644 --- a/src/training/cntraining.cpp +++ b/src/training/cntraining.cpp @@ -1,13 +1,9 @@ /****************************************************************************** -** Filename: cntraining.cpp -** Purpose: Generates a normproto and pffmtable. -** Author: Dan Johnson -** Revisment: Christy Russon -** History: Fri Aug 18 08:53:50 1989, DSJ, Created. -** 5/25/90, DSJ, Adapted to multiple feature types. -** Tuesday, May 17, 1998 Changes made to make feature specific and -** simplify structures. First step in simplifying training process. -** + ** Filename: cntraining.cpp + ** Purpose: Generates a normproto and pffmtable. + ** Author: Dan Johnson + ** Revisment: Christy Russon + ** ** (c) Copyright Hewlett-Packard Company, 1988. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. @@ -37,8 +33,6 @@ #define PROGRAM_FEATURE_TYPE "cn" -DECLARE_STRING_PARAM_FLAG(D); - /*---------------------------------------------------------------------------- Private Function Prototypes ----------------------------------------------------------------------------*/ @@ -54,15 +48,14 @@ static void WriteProtos(FILE* File, uint16_t N, LIST ProtoList, ----------------------------------------------------------------------------*/ /* global variable to hold configuration parameters to control clustering */ //-M 0.025 -B 0.05 -I 0.8 -C 1e-3 -CLUSTERCONFIG CNConfig = -{ +static const CLUSTERCONFIG CNConfig = { elliptical, 0.025, 0.05, 0.8, 1e-3, 0 }; /*---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------*/ -/*---------------------------------------------------------------------------*/ + /** * This program reads in a text file consisting of feature * samples from a training page in the following format: diff --git a/src/training/commandlineflags.h b/src/training/commandlineflags.h index f9c67c6f..8c78ede4 100644 --- a/src/training/commandlineflags.h +++ b/src/training/commandlineflags.h @@ -62,6 +62,16 @@ #endif +// Flags from commontraining.cpp +DECLARE_INT_PARAM_FLAG(debug_level); +DECLARE_STRING_PARAM_FLAG(D); +DECLARE_STRING_PARAM_FLAG(O); +DECLARE_STRING_PARAM_FLAG(U); +DECLARE_STRING_PARAM_FLAG(X); +DECLARE_STRING_PARAM_FLAG(fonts_dir); +DECLARE_STRING_PARAM_FLAG(fontconfig_tmpdir); +DECLARE_STRING_PARAM_FLAG(test_ch); + namespace tesseract { // Parse commandline flags and values. Prints the usage string and exits on diff --git a/src/training/mftraining.cpp b/src/training/mftraining.cpp index b37ef0a5..30926d07 100644 --- a/src/training/mftraining.cpp +++ b/src/training/mftraining.cpp @@ -60,8 +60,6 @@ using tesseract::ShapeTable; // Max length of a fake shape label. const int kMaxShapeLabelLength = 10; -DECLARE_STRING_PARAM_FLAG(test_ch); - /*---------------------------------------------------------------------------- Public Code -----------------------------------------------------------------------------*/ diff --git a/src/training/pango_font_info.h b/src/training/pango_font_info.h index 810b16a5..f6b0948f 100644 --- a/src/training/pango_font_info.h +++ b/src/training/pango_font_info.h @@ -31,9 +31,6 @@ #include "pango/pangocairo.h" #include "util.h" -DECLARE_STRING_PARAM_FLAG(fonts_dir); -DECLARE_STRING_PARAM_FLAG(fontconfig_tmpdir); - using char32 = signed int; namespace tesseract { diff --git a/src/training/set_unicharset_properties.cpp b/src/training/set_unicharset_properties.cpp index bdd65989..a402d9f1 100644 --- a/src/training/set_unicharset_properties.cpp +++ b/src/training/set_unicharset_properties.cpp @@ -21,11 +21,6 @@ STRING_PARAM_FLAG(script_dir, "", "Directory name for input script unicharsets/xheights"); -// Flags from commontraining.cpp -DECLARE_STRING_PARAM_FLAG(U); -DECLARE_STRING_PARAM_FLAG(O); -DECLARE_STRING_PARAM_FLAG(X); - int main(int argc, char** argv) { tesseract::CheckSharedLibraryVersion(); tesseract::ParseCommandLineFlags(argv[0], &argc, &argv, true);