|
tesseract
3.03
|
Go to the source code of this file.
Typedefs | |
| typedef float | MicroFeature [MFCount] |
Enumerations | |
| enum | MF_PARAM_NAME { MFXPosition, MFYPosition, MFLength, MFDirection, MFBulge1, MFBulge2, MFCount } |
Functions | |
| FEATURE_SET | ExtractMicros (TBLOB *Blob, const DENORM &bl_denorm, const DENORM &cn_denorm, const INT_FX_RESULT_STRUCT &fx_info) |
| typedef float MicroFeature[MFCount] |
| enum MF_PARAM_NAME |
---------------------------------------------------------------------------- Include Files and Type Defines ----------------------------------------------------------------------------
Definition at line 27 of file mf.h.
{
MFXPosition, MFYPosition,
MFLength, MFDirection, MFBulge1, MFBulge2,
MFCount // For array sizes.
} MF_PARAM_NAME;
| FEATURE_SET ExtractMicros | ( | TBLOB * | Blob, |
| const DENORM & | bl_denorm, | ||
| const DENORM & | cn_denorm, | ||
| const INT_FX_RESULT_STRUCT & | fx_info | ||
| ) |
---------------------------------------------------------------------------- Include Files and Type Defines ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- Global Data Definitions and Declarations ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- Private Code ----------------------------------------------------------------------------
Definition at line 36 of file mf.cpp.
{
/*
** Parameters:
** Blob blob to extract micro-features from
** denorm control parameter to feature extractor.
** Globals: none
** Operation: Call the old micro-feature extractor and then copy
** the features into the new format. Then deallocate the
** old micro-features.
** Return: Micro-features for Blob.
** Exceptions: none
** History: Wed May 23 18:06:38 1990, DSJ, Created.
*/
int NumFeatures;
MICROFEATURES Features, OldFeatures;
FEATURE_SET FeatureSet;
FEATURE Feature;
MICROFEATURE OldFeature;
OldFeatures = (MICROFEATURES)BlobMicroFeatures(Blob, bl_denorm, cn_denorm,
fx_info);
if (OldFeatures == NULL)
return NULL;
NumFeatures = count (OldFeatures);
FeatureSet = NewFeatureSet (NumFeatures);
Features = OldFeatures;
iterate(Features) {
OldFeature = (MICROFEATURE) first_node (Features);
Feature = NewFeature (&MicroFeatureDesc);
Feature->Params[MFDirection] = OldFeature[ORIENTATION];
Feature->Params[MFXPosition] = OldFeature[XPOSITION];
Feature->Params[MFYPosition] = OldFeature[YPOSITION];
Feature->Params[MFLength] = OldFeature[MFLENGTH];
// Bulge features are deprecated and should not be used. Set to 0.
Feature->Params[MFBulge1] = 0.0f;
Feature->Params[MFBulge2] = 0.0f;
#ifndef _WIN32
// Assert that feature parameters are well defined.
int i;
for (i = 0; i < Feature->Type->NumParams; i++) {
ASSERT_HOST(!isnan(Feature->Params[i]));
}
#endif
AddFeature(FeatureSet, Feature);
}
FreeMicroFeatures(OldFeatures);
return FeatureSet;
} /* ExtractMicros */