All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
normfeat.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  ** Filename: normfeat.c
3  ** Purpose: Definition of char normalization features.
4  ** Author: Dan Johnson
5  ** History: 12/14/90, DSJ, Created.
6  **
7  ** (c) Copyright Hewlett-Packard Company, 1988.
8  ** Licensed under the Apache License, Version 2.0 (the "License");
9  ** you may not use this file except in compliance with the License.
10  ** You may obtain a copy of the License at
11  ** http://www.apache.org/licenses/LICENSE-2.0
12  ** Unless required by applicable law or agreed to in writing, software
13  ** distributed under the License is distributed on an "AS IS" BASIS,
14  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  ** See the License for the specific language governing permissions and
16  ** limitations under the License.
17  ******************************************************************************/
18 /*----------------------------------------------------------------------------
19  Include Files and Type Defines
20 ----------------------------------------------------------------------------*/
21 #include "normfeat.h"
22 
23 #include "intfx.h"
24 #include "featdefs.h"
25 #include "mfoutline.h"
26 
27 /*----------------------------------------------------------------------------
28  Public Code
29 ----------------------------------------------------------------------------*/
30 
33  return (Feature->Params[CharNormLength] * LENGTH_COMPRESSION);
34 }
35 
36 
63  FEATURE_SET feature_set = NewFeatureSet(1);
64  FEATURE feature = NewFeature(&CharNormDesc);
65 
66  feature->Params[CharNormY] =
68  feature->Params[CharNormLength] =
70  feature->Params[CharNormRx] = MF_SCALE_FACTOR * fx_info.Rx;
71  feature->Params[CharNormRy] = MF_SCALE_FACTOR * fx_info.Ry;
72 
73  AddFeature(feature_set, feature);
74 
75  return feature_set;
76 } /* ExtractCharNormFeatures */
float FLOAT32
Definition: host.h:111
FEATURE_SET ExtractCharNormFeatures(const INT_FX_RESULT_STRUCT &fx_info)
Definition: normfeat.cpp:62
FEATURE NewFeature(const FEATURE_DESC_STRUCT *FeatureDesc)
Definition: ocrfeatures.cpp:96
FEATURE_SET NewFeatureSet(int NumFeatures)
FLOAT32 ActualOutlineLength(FEATURE Feature)
Definition: normfeat.cpp:32
#define LENGTH_COMPRESSION
Definition: normfeat.h:26
const FEATURE_DESC_STRUCT CharNormDesc
const int kBlnBaselineOffset
Definition: normalis.h:29
FLOAT32 Params[1]
Definition: ocrfeatures.h:65
BOOL8 AddFeature(FEATURE_SET FeatureSet, FEATURE Feature)
Definition: ocrfeatures.cpp:44
#define MF_SCALE_FACTOR
Definition: mfoutline.h:63