Tesseract 3.01
/data/source/tesseract-ocr/classify/protos.cpp File Reference
#include "protos.h"
#include "const.h"
#include "emalloc.h"
#include "freelist.h"
#include "callcpp.h"
#include "tprintf.h"
#include "scanutils.h"
#include "globals.h"
#include "classify.h"
#include "params.h"
#include <stdio.h>
#include <math.h>

Namespaces

namespace  tesseract

Defines

#define PROTO_INCREMENT   32
#define CONFIG_INCREMENT   16

Functions

AddConfigToClass

Add a new config to this class. Malloc new space and copy the old configs if necessary. Return the config id for the new config.

Parameters:
ClassThe class to add to
int AddConfigToClass (CLASS_TYPE Class)
AddProtoToClass

Add a new proto to this class. Malloc new space and copy the old protos if necessary. Return the proto id for the new proto.

Parameters:
ClassThe class to add to
int AddProtoToClass (CLASS_TYPE Class)
ClassConfigLength

Return the length of all the protos in this class.

Parameters:
ClassThe class to add to
ConfigFIXME
FLOAT32 ClassConfigLength (CLASS_TYPE Class, BIT_VECTOR Config)
ClassProtoLength

Return the length of all the protos in this class.

Parameters:
ClassThe class to use
FLOAT32 ClassProtoLength (CLASS_TYPE Class)
CopyProto

Copy the first proto into the second.

Parameters:
SrcSource
DestDestination
void CopyProto (PROTO Src, PROTO Dest)
void FillABC (PROTO Proto)
void FreeClass (CLASS_TYPE Class)
void FreeClassFields (CLASS_TYPE Class)
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)
SplitProto

Add a new proto to this class. Malloc new space and copy the old protos if necessary. Return the proto id for the new proto. Update all configurations so that each config which contained the specified old proto will also contain the new proto. The caller is responsible for actually filling in the appropriate proto params.

int SplitProto (CLASS_TYPE Class, int OldPid)
void WriteOldConfigFile (FILE *File, CLASS_TYPE Class)
WriteOldProtoFile
Deprecated:
Write the protos in the given class to the specified file in the old proto format.
Parameters:
FileThe file to write to
ClassThe class to write
void WriteOldProtoFile (FILE *File, CLASS_TYPE Class)

Variables

CLASS_STRUCT TrainingData [NUMBER_OF_CLASSES]
char * classify_training_file = "MicroFeatures"

Define Documentation

#define CONFIG_INCREMENT   16
#define PROTO_INCREMENT   32

Function Documentation

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)
CLASS_TYPE NewClass ( int  NumProtos,
int  NumConfigs 
)
void PrintProtos ( CLASS_TYPE  Class)
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.

int SplitProto ( CLASS_TYPE  Class,
int  OldPid 
)
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:
FileThe file to write to
ClassThe class to write
void WriteOldProtoFile ( FILE *  File,
CLASS_TYPE  Class 
)

Variable Documentation

char* classify_training_file = "MicroFeatures"

"Training file"

CLASS_STRUCT TrainingData[NUMBER_OF_CLASSES]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines