/home/rays/src/opensrc/tesseract-ocr/classify/protos.h File Reference
#include "bitvec.h"
#include "cutil.h"
#include "unichar.h"
#include "unicity_table.h"
#include "params.h"
Go to the source code of this file.
Classes |
struct | PROTO_STRUCT |
struct | CLASS_STRUCT |
Defines |
#define | NUMBER_OF_CLASSES MAX_NUM_CLASSES |
#define | Y_OFFSET -40.0 |
#define | FEATURE_SCALE 100.0 |
#define | AddProtoToConfig(Pid, Config) (SET_BIT (Config, Pid)) |
#define | RemoveProtoFromConfig(Pid, Config) (reset_bit (Config, Pid)) |
#define | ClassOfChar(Char) |
#define | ProtoIn(Class, Pid) (& (Class)->Prototypes [Pid]) |
#define | PrintProto(Proto) |
#define | PrintProtoLine(Proto) |
Typedefs |
typedef BIT_VECTOR * | CONFIGS |
typedef PROTO_STRUCT * | PROTO |
typedef CLASS_STRUCT * | CLASS_TYPE |
typedef CLASS_STRUCT * | CLASSES |
Functions |
int | AddConfigToClass (CLASS_TYPE Class) |
int | AddProtoToClass (CLASS_TYPE Class) |
FLOAT32 | ClassConfigLength (CLASS_TYPE Class, BIT_VECTOR Config) |
FLOAT32 | ClassProtoLength (CLASS_TYPE Class) |
void | CopyProto (PROTO Src, PROTO Dest) |
void | FillABC (PROTO Proto) |
void | FreeClass (CLASS_TYPE Class) |
void | FreeClassFields (CLASS_TYPE Class) |
void | InitPrototypes () |
CLASS_TYPE | NewClass (int NumProtos, int NumConfigs) |
void | PrintProtos (CLASS_TYPE Class) |
void | ReadClassFromFile (FILE *File, UNICHAR_ID unichar_id) |
void | ReadConfigs (register FILE *File, CLASS_TYPE Class) |
void | ReadProtos (register FILE *File, CLASS_TYPE Class) |
int | SplitProto (CLASS_TYPE Class, int OldPid) |
void | WriteOldConfigFile (FILE *File, CLASS_TYPE Class) |
void | WriteOldProtoFile (FILE *File, CLASS_TYPE Class) |
Variables |
CLASS_STRUCT | TrainingData [] |
char * | classify_training_file = "MicroFeatures" |
Define Documentation
#define AddProtoToConfig |
( |
Pid, |
|
|
Config |
|
) |
(SET_BIT (Config, Pid)) |
AddProtoToConfig
Set a single proto bit in the specified configuration.
#define ClassOfChar |
( |
Char |
|
) |
|
Value:ClassOfChar
Return the class of a particular ASCII character value.
#define FEATURE_SCALE 100.0 |
#define NUMBER_OF_CLASSES MAX_NUM_CLASSES |
#define PrintProto |
( |
Proto |
|
) |
|
Value:(cprintf ("X=%4.2f, Y=%4.2f, Angle=%4.2f", \
Proto->X, \
Proto->Y, \
Proto->Length, \
Proto->Angle)) \
PrintProto
Print out the contents of a prototype. The 'Proto' argument is of type 'PROTO'.
#define PrintProtoLine |
( |
Proto |
|
) |
|
Value:(cprintf ("A=%4.2f, B=%4.2f, C=%4.2f", \
Proto->A, \
Proto->B, \
Proto->C)) \
PrintProtoLine
Print out the contents of a prototype. The 'Proto' argument is of type 'PROTO'.
#define ProtoIn |
( |
Class, |
|
|
Pid |
|
) |
(& (Class)->Prototypes [Pid]) |
ProtoIn
Choose the selected prototype in this class record. Return the pointer to it (type PROTO).
#define RemoveProtoFromConfig |
( |
Pid, |
|
|
Config |
|
) |
(reset_bit (Config, Pid)) |
RemoveProtoFromConfig
Clear a single proto bit in the specified configuration.
Typedef Documentation
Function Documentation
void FillABC |
( |
PROTO |
Proto |
) |
|
CLASS_TYPE NewClass |
( |
int |
NumProtos, |
|
|
int |
NumConfigs | |
|
) |
| | |
void ReadClassFromFile |
( |
FILE * |
File, |
|
|
UNICHAR_ID |
unichar_id | |
|
) |
| | |
ReadClassFromFile
Read in a class description (protos and configs) from a file. Update the class structure record.
void ReadConfigs |
( |
register FILE * |
File, |
|
|
CLASS_TYPE |
Class | |
|
) |
| | |
ReadConfigs
Read the prototype configurations for this class from a file. Read the requested number of lines.
void ReadProtos |
( |
register FILE * |
File, |
|
|
CLASS_TYPE |
Class | |
|
) |
| | |
ReadProtos
Read in all the prototype information from a file. Read the number of lines requested.
void WriteOldConfigFile |
( |
FILE * |
File, |
|
|
CLASS_TYPE |
Class | |
|
) |
| | |
- Deprecated:
Write the configs in the given class to the specified file in the old config format.
- Parameters:
-
| File | The file to write to |
| Class | The class to write |
void WriteOldProtoFile |
( |
FILE * |
File, |
|
|
CLASS_TYPE |
Class | |
|
) |
| | |
Variable Documentation