tesseract  3.03
/usr/local/google/home/jbreiden/tesseract-ocr-read-only/classify/flexfx.cpp File Reference
#include "flexfx.h"
#include "featdefs.h"
#include "emalloc.h"
#include <string.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 &bl_denorm, const DENORM &cn_denorm, const INT_FX_RESULT_STRUCT &fx_info)

Function Documentation

CHAR_DESC ExtractFlexFeatures ( const FEATURE_DEFS_STRUCT FeatureDefs,
TBLOB Blob,
const DENORM bl_denorm,
const DENORM cn_denorm,
const INT_FX_RESULT_STRUCT fx_info 
)

---------------------------------------------------------------------------- Include Files and Type Defines ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- Public Code ----------------------------------------------------------------------------

Definition at line 34 of file flexfx.cpp.

                                                                   {
/*
 **     Parameters:
 **             Blob            blob to extract features from
 **             denorm  control parameter for feature extractor
 **     Globals: none
 **     Operation: Allocate a new character descriptor and fill it in by
 **             calling all feature extractors which are enabled.
 **     Return: Structure containing features extracted from Blob.
 **     Exceptions: none
 **     History: Wed May 23 13:46:22 1990, DSJ, Created.
 */
  int Type;
  CHAR_DESC CharDesc;

  CharDesc = NewCharDescription(FeatureDefs);

  for (Type = 0; Type < CharDesc->NumFeatureSets; Type++)
    if (FeatureDefs.FeatureExtractors[Type] != NULL &&
        FeatureDefs.FeatureExtractors[Type]->Extractor != NULL) {
      CharDesc->FeatureSets[Type] =
        (FeatureDefs.FeatureExtractors[Type])->Extractor(Blob,
                                                         bl_denorm,
                                                         cn_denorm,
                                                         fx_info);
      if (CharDesc->FeatureSets[Type] == NULL) {
        tprintf("Feature extractor for type %d = %s returned NULL!\n",
                Type, FeatureDefs.FeatureDesc[Type]->ShortName);
        FreeCharDescription(CharDesc);
        return NULL;
      }
    }

  return (CharDesc);

}                                /* ExtractFlexFeatures */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines