mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-06-28 01:11:00 +08:00
doxygen training/cntraining.cpp
This commit is contained in:
parent
aa1df05321
commit
cc5f466ac6
@ -21,9 +21,9 @@
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
/*----------------------------------------------------------------------------
|
||||
Include Files and Type Defines
|
||||
----------------------------------------------------------------------------**/
|
||||
----------------------------------------------------------------------------*/
|
||||
#include "oldlist.h"
|
||||
#include "efio.h"
|
||||
#include "emalloc.h"
|
||||
@ -42,16 +42,16 @@
|
||||
|
||||
DECLARE_STRING_PARAM_FLAG(D);
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
/*----------------------------------------------------------------------------
|
||||
Public Function Prototypes
|
||||
----------------------------------------------------------------------------**/
|
||||
----------------------------------------------------------------------------*/
|
||||
int main (
|
||||
int argc,
|
||||
char **argv);
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
/*----------------------------------------------------------------------------
|
||||
Private Function Prototypes
|
||||
----------------------------------------------------------------------------**/
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
void WriteNormProtos (
|
||||
const char *Directory,
|
||||
@ -71,9 +71,9 @@ void WriteProtos(
|
||||
BOOL8 WriteSigProtos,
|
||||
BOOL8 WriteInsigProtos);
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
/*----------------------------------------------------------------------------
|
||||
Global Data Definitions and Declarations
|
||||
----------------------------------------------------------------------------**/
|
||||
----------------------------------------------------------------------------*/
|
||||
/* global variable to hold configuration parameters to control clustering */
|
||||
//-M 0.025 -B 0.05 -I 0.8 -C 1e-3
|
||||
CLUSTERCONFIG CNConfig =
|
||||
@ -82,63 +82,59 @@ CLUSTERCONFIG CNConfig =
|
||||
};
|
||||
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
/*----------------------------------------------------------------------------
|
||||
Public Code
|
||||
----------------------------------------------------------------------------**/
|
||||
----------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int main(int argc, char* argv[])
|
||||
|
||||
/*
|
||||
** Parameters:
|
||||
** argc number of command line arguments
|
||||
** argv array of command line arguments
|
||||
** Globals: none
|
||||
** Operation:
|
||||
** This program reads in a text file consisting of feature
|
||||
** samples from a training page in the following format:
|
||||
**
|
||||
** FontName CharName NumberOfFeatureTypes(N)
|
||||
** FeatureTypeName1 NumberOfFeatures(M)
|
||||
** Feature1
|
||||
** ...
|
||||
** FeatureM
|
||||
** FeatureTypeName2 NumberOfFeatures(M)
|
||||
** Feature1
|
||||
** ...
|
||||
** FeatureM
|
||||
** ...
|
||||
** FeatureTypeNameN NumberOfFeatures(M)
|
||||
** Feature1
|
||||
** ...
|
||||
** FeatureM
|
||||
** FontName CharName ...
|
||||
**
|
||||
** It then appends these samples into a separate file for each
|
||||
** character. The name of the file is
|
||||
**
|
||||
** DirectoryName/FontName/CharName.FeatureTypeName
|
||||
**
|
||||
** The DirectoryName can be specified via a command
|
||||
** line argument. If not specified, it defaults to the
|
||||
** current directory. The format of the resulting files is:
|
||||
**
|
||||
** NumberOfFeatures(M)
|
||||
** Feature1
|
||||
** ...
|
||||
** FeatureM
|
||||
** NumberOfFeatures(M)
|
||||
** ...
|
||||
**
|
||||
** The output files each have a header which describes the
|
||||
** type of feature which the file contains. This header is
|
||||
** in the format required by the clusterer. A command line
|
||||
** argument can also be used to specify that only the first
|
||||
** N samples of each class should be used.
|
||||
** Return: none
|
||||
** Exceptions: none
|
||||
** History: Fri Aug 18 08:56:17 1989, DSJ, Created.
|
||||
/**
|
||||
* This program reads in a text file consisting of feature
|
||||
* samples from a training page in the following format:
|
||||
* @verbatim
|
||||
FontName CharName NumberOfFeatureTypes(N)
|
||||
FeatureTypeName1 NumberOfFeatures(M)
|
||||
Feature1
|
||||
...
|
||||
FeatureM
|
||||
FeatureTypeName2 NumberOfFeatures(M)
|
||||
Feature1
|
||||
...
|
||||
FeatureM
|
||||
...
|
||||
FeatureTypeNameN NumberOfFeatures(M)
|
||||
Feature1
|
||||
...
|
||||
FeatureM
|
||||
FontName CharName ...
|
||||
@endverbatim
|
||||
* It then appends these samples into a separate file for each
|
||||
* character. The name of the file is
|
||||
*
|
||||
* DirectoryName/FontName/CharName.FeatureTypeName
|
||||
*
|
||||
* The DirectoryName can be specified via a command
|
||||
* line argument. If not specified, it defaults to the
|
||||
* current directory. The format of the resulting files is:
|
||||
* @verbatim
|
||||
NumberOfFeatures(M)
|
||||
Feature1
|
||||
...
|
||||
FeatureM
|
||||
NumberOfFeatures(M)
|
||||
...
|
||||
@endverbatim
|
||||
* The output files each have a header which describes the
|
||||
* type of feature which the file contains. This header is
|
||||
* in the format required by the clusterer. A command line
|
||||
* argument can also be used to specify that only the first
|
||||
* N samples of each class should be used.
|
||||
* @param argc number of command line arguments
|
||||
* @param argv array of command line arguments
|
||||
* @return none
|
||||
* @note Globals: none
|
||||
* @note Exceptions: none
|
||||
* @note History: Fri Aug 18 08:56:17 1989, DSJ, Created.
|
||||
*/
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// Set the global Config parameters before parsing the command line.
|
||||
Config = CNConfig;
|
||||
@ -207,28 +203,26 @@ int main(int argc, char* argv[])
|
||||
} // main
|
||||
|
||||
|
||||
/**----------------------------------------------------------------------------
|
||||
/*----------------------------------------------------------------------------
|
||||
Private Code
|
||||
----------------------------------------------------------------------------**/
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/**
|
||||
* This routine writes the specified samples into files which
|
||||
* are organized according to the font name and character name
|
||||
* of the samples.
|
||||
* @param Directory directory to place sample files into
|
||||
* @param LabeledProtoList List of labeled protos
|
||||
* @param Clusterer The CLUSTERER to use
|
||||
* @return none
|
||||
* @note Exceptions: none
|
||||
* @note History: Fri Aug 18 16:17:06 1989, DSJ, Created.
|
||||
*/
|
||||
void WriteNormProtos (
|
||||
const char *Directory,
|
||||
LIST LabeledProtoList,
|
||||
CLUSTERER *Clusterer)
|
||||
|
||||
/*
|
||||
** Parameters:
|
||||
** Directory directory to place sample files into
|
||||
** Operation:
|
||||
** This routine writes the specified samples into files which
|
||||
** are organized according to the font name and character name
|
||||
** of the samples.
|
||||
** Return: none
|
||||
** Exceptions: none
|
||||
** History: Fri Aug 18 16:17:06 1989, DSJ, Created.
|
||||
*/
|
||||
|
||||
CLUSTERER *Clusterer)
|
||||
{
|
||||
FILE *File;
|
||||
STRING Filename;
|
||||
|
Loading…
Reference in New Issue
Block a user