tesseract
5.0.0-alpha-619-ge9db
|
#include "adaptive.h"
#include "emalloc.h"
#include "classify.h"
#include <cassert>
#include <cstdio>
Go to the source code of this file.
Namespaces | |
tesseract | |
Functions | |
void | AddAdaptedClass (ADAPT_TEMPLATES Templates, ADAPT_CLASS Class, CLASS_ID ClassId) |
void | FreeTempConfig (TEMP_CONFIG Config) |
void | FreeTempProto (void *arg) |
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 (TFile *fp) |
PERM_CONFIG | ReadPermConfig (TFile *fp) |
TEMP_CONFIG | ReadTempConfig (TFile *fp) |
void | WriteAdaptedClass (FILE *File, ADAPT_CLASS Class, int NumConfigs) |
void | WritePermConfig (FILE *File, PERM_CONFIG Config) |
void | WriteTempConfig (FILE *File, TEMP_CONFIG Config) |
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.
Templates | set of templates to add new class to |
Class | new class to add to templates |
ClassId | class id to associate with new class |
Definition at line 45 of file adaptive.cpp.
void free_adapted_class | ( | ADAPT_CLASS | adapt_class | ) |
Definition at line 124 of file adaptive.cpp.
void free_adapted_templates | ( | ADAPT_TEMPLATES | templates | ) |
Definition at line 182 of file adaptive.cpp.
void FreeTempConfig | ( | TEMP_CONFIG | Config | ) |
This routine frees all memory consumed by a temporary configuration.
Config | config to be freed |
Definition at line 74 of file adaptive.cpp.
void FreeTempProto | ( | void * | arg | ) |
Definition at line 81 of file adaptive.cpp.
ADAPT_CLASS NewAdaptedClass | ( | ) |
This operation allocates and initializes a new adapted class data structure and returns a ptr to it.
Definition at line 102 of file adaptive.cpp.
TEMP_CONFIG NewTempConfig | ( | int | MaxProtoId, |
int | FontinfoId | ||
) |
This routine allocates and returns a new temporary config.
MaxProtoId | max id of any proto in new config |
FontinfoId | font information from pre-trained templates |
Definition at line 203 of file adaptive.cpp.
TEMP_PROTO NewTempProto | ( | ) |
This routine allocates and returns a new temporary proto.
Definition at line 228 of file adaptive.cpp.
ADAPT_CLASS ReadAdaptedClass | ( | TFile * | fp | ) |
Read an adapted class description from file and return a ptr to the adapted class.
fp | open file to read adapted class from |
Definition at line 281 of file adaptive.cpp.
PERM_CONFIG ReadPermConfig | ( | TFile * | fp | ) |
Read a permanent configuration description from file and return a ptr to it.
fp | open file to read permanent config from |
Definition at line 362 of file adaptive.cpp.
TEMP_CONFIG ReadTempConfig | ( | TFile * | fp | ) |
Read a temporary configuration description from file and return a ptr to it.
fp | open file to read temporary config from |
Definition at line 386 of file adaptive.cpp.
void WriteAdaptedClass | ( | FILE * | File, |
ADAPT_CLASS | Class, | ||
int | NumConfigs | ||
) |
This routine writes a binary representation of Class to File.
File | open file to write Class to |
Class | adapted class to write to File |
NumConfigs | number of configs in Class |
Definition at line 409 of file adaptive.cpp.
void WritePermConfig | ( | FILE * | File, |
PERM_CONFIG | Config | ||
) |
This routine writes a binary representation of a permanent configuration to File.
File | open file to write Config to |
Config | permanent config to write to File |
Definition at line 481 of file adaptive.cpp.
void WriteTempConfig | ( | FILE * | File, |
TEMP_CONFIG | Config | ||
) |
This routine writes a binary representation of a temporary configuration to File.
File | open file to write Config to |
Config | temporary config to write to File |
Definition at line 503 of file adaptive.cpp.