#include "float2int.h"
#include "normmatch.h"
#include "mfoutline.h"
#include "picofeat.h"
Go to the source code of this file.
#define MAX_INT_CHAR_NORM (INT_CHAR_NORM_RANGE - 1) |
** (c) Copyright Hewlett-Packard Company, 1988. ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. ** You may obtain a copy of the License at ** http://www.apache.org/licenses/LICENSE-2.0 ** Unless required by applicable law or agreed to in writing, software ** distributed under the License is distributed on an "AS IS" BASIS, ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ** See the License for the specific language governing permissions and ** limitations under the License.
Definition at line 27 of file float2int.cpp.
Referenced by ComputeIntCharNormArray().
void ClearCharNormArray | ( | INT_TEMPLATES | Templates, | |
CLASS_NORMALIZATION_ARRAY | CharNormArray | |||
) |
For each class in Templates, clear the corresponding entry in CharNormArray.
Templates | Specifies classes currently defined | |
CharNormArray | Array to be cleared |
Definition at line 45 of file float2int.cpp.
References NumClassesIn.
Referenced by GetBaselineFeatures(), and GetIntBaselineFeatures().
00046 { 00047 int i; 00048 00049 for (i = 0; i < NumClassesIn (Templates); i++) { 00050 CharNormArray[i] = 0; 00051 } 00052 00053 } /* ClearCharNormArray */
void ComputeIntCharNormArray | ( | FEATURE | NormFeature, | |
INT_TEMPLATES | Templates, | |||
CLASS_NORMALIZATION_ARRAY | CharNormArray | |||
) |
For each class in Templates, compute the match between NormFeature and the normalization protos for that class.
NormFeature | Character normalization feature | |
Templates | Specifies classes currently defined | |
CharNormArray | Place to put results |
Definition at line 71 of file float2int.cpp.
References ClassIdForIndex, ComputeNormMatch(), FALSE, INT_CHAR_NORM_RANGE, MAX_INT_CHAR_NORM, and NumClassesIn.
Referenced by GetIntCharNormFeatures().
00073 { 00074 int i; 00075 int NormAdjust; 00076 00077 for (i = 0; i < NumClassesIn (Templates); i++) { 00078 NormAdjust = (int) (INT_CHAR_NORM_RANGE * 00079 ComputeNormMatch (ClassIdForIndex (Templates, i), 00080 NormFeature, FALSE)); 00081 if (NormAdjust < 0) 00082 NormAdjust = 0; 00083 else if (NormAdjust > MAX_INT_CHAR_NORM) 00084 NormAdjust = MAX_INT_CHAR_NORM; 00085 00086 CharNormArray[i] = NormAdjust; 00087 } 00088 00089 } /* ComputeIntCharNormArray */
void ComputeIntFeatures | ( | FEATURE_SET | Features, | |
INT_FEATURE_ARRAY | IntFeatures | |||
) |
Definition at line 102 of file float2int.cpp.
References ANGLE_SHIFT, baseline, BASELINE_Y_SHIFT, BucketFor(), CircBucketFor(), FeatureIn, INT_FEAT_RANGE, NormMethod, NumFeaturesIn, ParamOf, PicoFeatDir, PicoFeatX, PicoFeatY, X_SHIFT, and Y_SHIFT.
Referenced by GetAdaptiveFeatures(), and GetBaselineFeatures().
00102 { 00103 int Fid; 00104 FEATURE Feature; 00105 FLOAT32 YShift; 00106 00107 if (NormMethod == baseline) 00108 YShift = BASELINE_Y_SHIFT; 00109 else 00110 YShift = Y_SHIFT; 00111 00112 for (Fid = 0; Fid < NumFeaturesIn (Features); Fid++) { 00113 Feature = FeatureIn (Features, Fid); 00114 00115 IntFeatures[Fid].X = BucketFor (ParamOf (Feature, PicoFeatX), 00116 X_SHIFT, INT_FEAT_RANGE); 00117 IntFeatures[Fid].Y = BucketFor (ParamOf (Feature, PicoFeatY), 00118 YShift, INT_FEAT_RANGE); 00119 IntFeatures[Fid].Theta = CircBucketFor (ParamOf (Feature, PicoFeatDir), 00120 ANGLE_SHIFT, INT_FEAT_RANGE); 00121 IntFeatures[Fid].CP_misses = 0; 00122 } 00123 } /* ComputeIntFeatures */