Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
flexfx.h File Reference
#include "featdefs.h"
#include <stdio.h>

Go to the source code of this file.

Functions

CHAR_DESC ExtractFlexFeatures (const FEATURE_DEFS_STRUCT &FeatureDefs, TBLOB *Blob, const DENORM &denorm)
 

Function Documentation

CHAR_DESC ExtractFlexFeatures ( const FEATURE_DEFS_STRUCT FeatureDefs,
TBLOB Blob,
const DENORM denorm 
)

Include Files and Type Defines

Public Function Prototypes


Include Files and Type Defines

Public Code

Definition at line 31 of file flexfx.cpp.

32  {
33 /*
34  ** Parameters:
35  ** Blob blob to extract features from
36  ** denorm control parameter for feature extractor
37  ** Globals: none
38  ** Operation: Allocate a new character descriptor and fill it in by
39  ** calling all feature extractors which are enabled.
40  ** Return: Structure containing features extracted from Blob.
41  ** Exceptions: none
42  ** History: Wed May 23 13:46:22 1990, DSJ, Created.
43  */
44  int Type;
45  CHAR_DESC CharDesc;
46 
47  CharDesc = NewCharDescription(FeatureDefs);
48 
49  for (Type = 0; Type < CharDesc->NumFeatureSets; Type++)
50  if (FeatureDefs.FeatureExtractors[Type] != NULL &&
51  FeatureDefs.FeatureExtractors[Type]->Extractor != NULL) {
52  CharDesc->FeatureSets[Type] =
53  (FeatureDefs.FeatureExtractors[Type])->Extractor(Blob, denorm);
54  if (CharDesc->FeatureSets[Type] == NULL) {
55  FreeCharDescription(CharDesc);
56  return NULL;
57  }
58  }
59 
60  return (CharDesc);
61 
62 } /* ExtractFlexFeatures */
#define NULL
Definition: host.h:144
const FEATURE_EXT_STRUCT * FeatureExtractors[NUM_FEATURE_TYPES]
Definition: featdefs.h:51
FEATURE_SET FeatureSets[NUM_FEATURE_TYPES]
Definition: featdefs.h:44
void FreeCharDescription(CHAR_DESC CharDesc)
Definition: featdefs.cpp:141
uinT32 NumFeatureSets
Definition: featdefs.h:43
CHAR_DESC NewCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs)
Definition: featdefs.cpp:164