tesseract
5.0.0-alpha-619-ge9db
|
#include "featdefs.h"
#include <cstring>
#include <cstdio>
#include "emalloc.h"
#include "picofeat.h"
#include "scanutils.h"
Go to the source code of this file.
Macros | |
#define | PICO_FEATURE_LENGTH 0.05 |
Functions | |
StartParamDesc (MicroFeatureParams) DefineParam(0 | |
DefineParam (0, 0, -0.25, 0.75) DefineParam(0 | |
DefineParam (1, 0, 0.0, 1.0) DefineParam(0 | |
DefineParam (0, 1, -0.5, 0.5) EndParamDesc DefineFeature(MicroFeatureDesc | |
MicroFeatureParams | StartParamDesc (CharNormParams) DefineParam(0 |
MicroFeatureParams | DefineParam (0, 1, 0.0, 1.0) DefineParam(0 |
MicroFeatureParams | DefineParam (0, 0, 0.0, 1.0) EndParamDesc DefineFeature(CharNormDesc |
MicroFeatureParams CharNormParams | StartParamDesc (IntFeatParams) DefineParam(0 |
MicroFeatureParams CharNormParams | DefineParam (0, 0, 0.0, 255.0) DefineParam(1 |
MicroFeatureParams CharNormParams EndParamDesc | DefineFeature (IntFeatDesc, 2, 1, kIntFeatureType, IntFeatParams) StartParamDesc(GeoFeatParams) DefineParam(0 |
MicroFeatureParams CharNormParams EndParamDesc EndParamDesc | DefineFeature (GeoFeatDesc, 3, 0, kGeoFeatureType, GeoFeatParams) float PicoFeatureLength |
StartParamDesc (PicoFeatParams) DefineParam(0 | |
EndParamDesc | DefineFeature (PicoFeatDesc, 2, 1, "pf", PicoFeatParams) StartParamDesc(OutlineFeatParams) DefineParam(0 |
void | InitFeatureDefs (FEATURE_DEFS_STRUCT *featuredefs) |
void | FreeCharDescription (CHAR_DESC CharDesc) |
CHAR_DESC | NewCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs) |
void | WriteCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc, STRING *str) |
bool | ValidCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, CHAR_DESC CharDesc) |
CHAR_DESC | ReadCharDescription (const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File) |
uint32_t | ShortNameToFeatureType (const FEATURE_DEFS_STRUCT &FeatureDefs, const char *ShortName) |
Variables | |
const char *const | kMicroFeatureType = "mf" |
const char *const | kCNFeatureType = "cn" |
const char *const | kIntFeatureType = "if" |
const char *const | kGeoFeatureType = "tb" |
EndParamDesc | of |
#define PICO_FEATURE_LENGTH 0.05 |
Definition at line 26 of file featdefs.cpp.
MicroFeatureParams CharNormParams EndParamDesc EndParamDesc DefineFeature | ( | GeoFeatDesc | , |
3 | , | ||
0 | , | ||
kGeoFeatureType | , | ||
GeoFeatParams | |||
) |
MicroFeatureParams CharNormParams EndParamDesc DefineFeature | ( | IntFeatDesc | , |
2 | , | ||
1 | , | ||
kIntFeatureType | , | ||
IntFeatParams | |||
) |
EndParamDesc DefineFeature | ( | PicoFeatDesc | , |
2 | , | ||
1 | , | ||
"pf" | , | ||
PicoFeatParams | |||
) |
EndParamDesc DefineParam | ( | 0 | , |
0 | , | ||
-0. | 25, | ||
0. | 75 | ||
) |
MicroFeatureParams DefineParam | ( | 0 | , |
0 | , | ||
0. | 0, | ||
1. | 0 | ||
) |
MicroFeatureParams CharNormParams EndParamDesc DefineParam | ( | 0 | , |
0 | , | ||
0. | 0, | ||
255. | 0 | ||
) |
DefineParam | ( | 0 | , |
1 | , | ||
-0. | 5, | ||
0. | 5 | ||
) |
MicroFeatureParams DefineParam | ( | 0 | , |
1 | , | ||
0. | 0, | ||
1. | 0 | ||
) |
EndParamDesc DefineParam | ( | 1 | , |
0 | , | ||
0. | 0, | ||
1. | 0 | ||
) |
void FreeCharDescription | ( | CHAR_DESC | CharDesc | ) |
Release the memory consumed by the specified character description and all of the features in that description.
CharDesc | character description to be deallocated |
Globals:
Definition at line 128 of file featdefs.cpp.
void InitFeatureDefs | ( | FEATURE_DEFS_STRUCT * | featuredefs | ) |
Definition at line 111 of file featdefs.cpp.
CHAR_DESC NewCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs | ) |
Allocate a new character description, initialize its feature sets to be empty, and return it.
Globals:
Definition at line 147 of file featdefs.cpp.
CHAR_DESC ReadCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
FILE * | File | ||
) |
Read a character description from File, and return a data structure containing this information. The data is formatted as follows:
NumberOfSets ShortNameForSet1 Set1 ShortNameForSet2 Set2 ...
Globals:
FeatureDefs | definitions of feature types/extractors |
File | open text file to read character description from |
Definition at line 235 of file featdefs.cpp.
uint32_t ShortNameToFeatureType | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
const char * | ShortName | ||
) |
Search through all features currently defined and return the feature type for the feature with the specified short name. Trap an error if the specified name is not found.
Globals:
FeatureDefs | definitions of feature types/extractors |
ShortName | short name of a feature type |
Definition at line 269 of file featdefs.cpp.
MicroFeatureParams StartParamDesc | ( | CharNormParams | ) |
MicroFeatureParams CharNormParams StartParamDesc | ( | IntFeatParams | ) |
StartParamDesc | ( | MicroFeatureParams | ) |
StartParamDesc | ( | PicoFeatParams | ) |
bool ValidCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
CHAR_DESC | CharDesc | ||
) |
Definition at line 194 of file featdefs.cpp.
void WriteCharDescription | ( | const FEATURE_DEFS_STRUCT & | FeatureDefs, |
CHAR_DESC | CharDesc, | ||
STRING * | str | ||
) |
Appends a textual representation of CharDesc to str. The format used is to write out the number of feature sets which will be written followed by a representation of each feature set.
Each set starts with the short name for that feature followed by a description of the feature set. Feature sets which are not present are not written.
FeatureDefs | definitions of feature types/extractors |
str | string to append CharDesc to |
CharDesc | character description to write to File |
Definition at line 173 of file featdefs.cpp.
MicroFeatureParams kCNFeatureType = "cn" |
Definition at line 32 of file featdefs.cpp.
const char* const kGeoFeatureType = "tb" |
Definition at line 34 of file featdefs.cpp.
const char* const kIntFeatureType = "if" |
Definition at line 33 of file featdefs.cpp.
kMicroFeatureType = "mf" |
Definition at line 31 of file featdefs.cpp.
EndParamDesc of |
Definition at line 98 of file featdefs.cpp.