Tesseract 3.01
/data/source/tesseract-ocr/classify/adaptive.h File Reference
#include "oldlist.h"
#include "intproto.h"
#include <stdio.h>

Go to the source code of this file.

Classes

struct  TEMP_PROTO_STRUCT
struct  TEMP_CONFIG_STRUCT
struct  PERM_CONFIG_STRUCT
union  ADAPTED_CONFIG
struct  ADAPT_CLASS_STRUCT
struct  ADAPT_TEMPLATES_STRUCT

Defines

#define NumNonEmptyClassesIn(Template)   ((Template)->NumNonEmptyClasses)
#define IsEmptyAdaptedClass(Class)
#define ConfigIsPermanent(Class, ConfigId)   (test_bit ((Class)->PermConfigs, ConfigId))
#define MakeConfigPermanent(Class, ConfigId)   (SET_BIT ((Class)->PermConfigs, ConfigId))
#define MakeProtoPermanent(Class, ProtoId)   (SET_BIT ((Class)->PermProtos, ProtoId))
#define TempConfigFor(Class, ConfigId)   ((Class)->Config[ConfigId].Temp)
#define PermConfigFor(Class, ConfigId)   ((Class)->Config[ConfigId].Perm)
#define IncreaseConfidence(TempConfig)   ((TempConfig)->NumTimesSeen++)

Typedefs

typedef TEMP_PROTO_STRUCTTEMP_PROTO
typedef TEMP_CONFIG_STRUCTTEMP_CONFIG
typedef PERM_CONFIG_STRUCTPERM_CONFIG
typedef ADAPT_CLASS_STRUCTADAPT_CLASS
typedef ADAPT_TEMPLATES_STRUCTADAPT_TEMPLATES

Functions

void AddAdaptedClass (ADAPT_TEMPLATES Templates, ADAPT_CLASS Class, CLASS_ID ClassId)
void FreeTempProto (void *arg)
void FreeTempConfig (TEMP_CONFIG Config)
ADAPT_CLASS NewAdaptedClass ()
void free_adapted_class (ADAPT_CLASS adapt_class)
void free_adapted_templates (ADAPT_TEMPLATES templates)
TEMP_CONFIG NewTempConfig (int MaxProtoId, int FontinfoId)
TEMP_PROTO NewTempProto ()
ADAPT_CLASS ReadAdaptedClass (FILE *File)
PERM_CONFIG ReadPermConfig (FILE *File)
TEMP_CONFIG ReadTempConfig (FILE *File)
void WriteAdaptedClass (FILE *File, ADAPT_CLASS Class, int NumConfigs)
void WritePermConfig (FILE *File, PERM_CONFIG Config)
void WriteTempConfig (FILE *File, TEMP_CONFIG Config)

Define Documentation

#define ConfigIsPermanent (   Class,
  ConfigId 
)    (test_bit ((Class)->PermConfigs, ConfigId))
#define IncreaseConfidence (   TempConfig)    ((TempConfig)->NumTimesSeen++)
#define IsEmptyAdaptedClass (   Class)
Value:
((Class)->NumPermConfigs == 0 &&      \
(Class)->TempProtos == NIL_LIST)
#define MakeConfigPermanent (   Class,
  ConfigId 
)    (SET_BIT ((Class)->PermConfigs, ConfigId))
#define MakeProtoPermanent (   Class,
  ProtoId 
)    (SET_BIT ((Class)->PermProtos, ProtoId))
#define NumNonEmptyClassesIn (   Template)    ((Template)->NumNonEmptyClasses)
#define PermConfigFor (   Class,
  ConfigId 
)    ((Class)->Config[ConfigId].Perm)
#define TempConfigFor (   Class,
  ConfigId 
)    ((Class)->Config[ConfigId].Temp)

Typedef Documentation


Function Documentation

void AddAdaptedClass ( ADAPT_TEMPLATES  Templates,
ADAPT_CLASS  Class,
CLASS_ID  ClassId 
)

This routine adds a new adapted class to an existing set of adapted templates.

Parameters:
Templatesset of templates to add new class to
Classnew class to add to templates
ClassIdclass id to associate with new class
Note:
Globals: none
Exceptions: none
History: Thu Mar 14 13:06:09 1991, DSJ, Created.
void free_adapted_class ( ADAPT_CLASS  adapt_class)
void free_adapted_templates ( ADAPT_TEMPLATES  templates)
void FreeTempConfig ( TEMP_CONFIG  Config)

This routine frees all memory consumed by a temporary configuration.

Parameters:
Configconfig to be freed
Note:
Globals: none
Exceptions: none
History: Thu Mar 14 13:34:23 1991, DSJ, Created.
void FreeTempProto ( void *  arg)
ADAPT_CLASS NewAdaptedClass ( )

This operation allocates and initializes a new adapted class data structure and returns a ptr to it.

Returns:
Ptr to new class data structure.
Note:
Globals: none
Exceptions: none
History: Thu Mar 14 12:58:13 1991, DSJ, Created.
TEMP_CONFIG NewTempConfig ( int  MaxProtoId,
int  FontinfoId 
)

This routine allocates and returns a new temporary config.

Parameters:
MaxProtoIdmax id of any proto in new config
FontinfoIdfont information from pre-trained templates
Returns:
Ptr to new temp config.
Note:
Globals: none
Exceptions: none
History: Thu Mar 14 13:28:21 1991, DSJ, Created.
TEMP_PROTO NewTempProto ( )

This routine allocates and returns a new temporary proto.

Returns:
Ptr to new temporary proto.
Note:
Globals: none
Exceptions: none
History: Thu Mar 14 13:31:31 1991, DSJ, Created.
ADAPT_CLASS ReadAdaptedClass ( FILE *  File)

Read an adapted class description from File and return a ptr to the adapted class.

Parameters:
Fileopen file to read adapted class from
Returns:
Ptr to new adapted class.
Note:
Globals: none
Exceptions: none
History: Tue Mar 19 14:11:01 1991, DSJ, Created.
PERM_CONFIG ReadPermConfig ( FILE *  File)

Read a permanent configuration description from File and return a ptr to it.

Parameters:
Fileopen file to read permanent config from
Returns:
Ptr to new permanent configuration description.
Note:
Globals: none
Exceptions: none
History: Tue Mar 19 14:25:26 1991, DSJ, Created.
TEMP_CONFIG ReadTempConfig ( FILE *  File)

Read a temporary configuration description from File and return a ptr to it.

Parameters:
Fileopen file to read temporary config from
Returns:
Ptr to new temporary configuration description.
Note:
Globals: none
Exceptions: none
History: Tue Mar 19 14:29:59 1991, DSJ, Created.
void WriteAdaptedClass ( FILE *  File,
ADAPT_CLASS  Class,
int  NumConfigs 
)

This routine writes a binary representation of Class to File.

Parameters:
Fileopen file to write Class to
Classadapted class to write to File
NumConfigsnumber of configs in Class
Note:
Globals: none
Exceptions: none
History: Tue Mar 19 13:33:51 1991, DSJ, Created.
void WritePermConfig ( FILE *  File,
PERM_CONFIG  Config 
)

This routine writes a binary representation of a permanent configuration to File.

Parameters:
Fileopen file to write Config to
Configpermanent config to write to File
Note:
Globals: none
Exceptions: none
History: Tue Mar 19 13:55:44 1991, DSJ, Created.
void WriteTempConfig ( FILE *  File,
TEMP_CONFIG  Config 
)

This routine writes a binary representation of a temporary configuration to File.

Parameters:
Fileopen file to write Config to
Configtemporary config to write to File
Note:
Globals: none
Exceptions: none
History: Tue Mar 19 14:00:28 1991, DSJ, Created.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines