Tesseract  3.02
tesseract-ocr/classify/normfeat.h File Reference
#include "ocrfeatures.h"

Go to the source code of this file.

Defines

#define LENGTH_COMPRESSION   (10.0)

Enumerations

enum  NORM_PARAM_NAME { CharNormY, CharNormLength, CharNormRx, CharNormRy }

Functions

FLOAT32 ActualOutlineLength (FEATURE Feature)
FEATURE_SET ExtractCharNormFeatures (TBLOB *Blob, const DENORM &denorm)

Define Documentation

#define LENGTH_COMPRESSION   (10.0)

---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------

Definition at line 26 of file normfeat.h.


Enumeration Type Documentation

Enumerator:
CharNormY 
CharNormLength 
CharNormRx 
CharNormRy 

Definition at line 28 of file normfeat.h.


Function Documentation

FLOAT32 ActualOutlineLength ( FEATURE  Feature)

---------------------------------------------------------------------------- Public Function Prototypes ----------------------------------------------------------------------------

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

Definition at line 32 of file normfeat.cpp.

                                             {
  return (Feature->Params[CharNormLength] * LENGTH_COMPRESSION);
}
FEATURE_SET ExtractCharNormFeatures ( TBLOB Blob,
const DENORM denorm 
)

Definition at line 62 of file normfeat.cpp.

                                                                       {
  FEATURE_SET feature_set = NewFeatureSet(1);
  FEATURE feature = NewFeature(&CharNormDesc);

  INT_FEATURE_ARRAY blfeatures;
  INT_FEATURE_ARRAY cnfeatures;
  INT_FX_RESULT_STRUCT FXInfo;

  ExtractIntFeat(blob, denorm, blfeatures, cnfeatures, &FXInfo);

  feature->Params[CharNormY] =
      MF_SCALE_FACTOR * (FXInfo.Ymean - BASELINE_OFFSET);
  feature->Params[CharNormLength] =
      MF_SCALE_FACTOR * FXInfo.Length / LENGTH_COMPRESSION;
  feature->Params[CharNormRx] = MF_SCALE_FACTOR * FXInfo.Rx;
  feature->Params[CharNormRy] = MF_SCALE_FACTOR * FXInfo.Ry;

  AddFeature(feature_set, feature);

  return feature_set;
}                                /* ExtractCharNormFeatures */