---------------------------------------------------------------------------*/ * This routine converts each floating point pico-feature * in Features into integer format and saves it into * IntFeatures. * * Globals: * - none * * @param Features floating point pico-features to be converted * @param[out] IntFeatures array to put converted features into * * @note Exceptions: none * @note H
| 98 | * @note History: Wed Feb 20 10:58:45 1991, DSJ, Created. |
| 99 | */ |
| 100 | void Classify::ComputeIntFeatures(FEATURE_SET Features, |
| 101 | INT_FEATURE_ARRAY IntFeatures) { |
| 102 | int Fid; |
| 103 | FEATURE Feature; |
| 104 | FLOAT32 YShift; |
| 105 | |
| 106 | if (classify_norm_method == baseline) |
| 107 | YShift = BASELINE_Y_SHIFT; |
| 108 | else |
| 109 | YShift = Y_SHIFT; |
| 110 | |
| 111 | for (Fid = 0; Fid < Features->NumFeatures; Fid++) { |
| 112 | Feature = Features->Features[Fid]; |
| 113 | |
| 114 | IntFeatures[Fid].X = |
| 115 | Bucket8For(Feature->Params[PicoFeatX], X_SHIFT, INT_FEAT_RANGE); |
| 116 | IntFeatures[Fid].Y = |
| 117 | Bucket8For(Feature->Params[PicoFeatY], YShift, INT_FEAT_RANGE); |
| 118 | IntFeatures[Fid].Theta = CircBucketFor(Feature->Params[PicoFeatDir], |
| 119 | ANGLE_SHIFT, INT_FEAT_RANGE); |
| 120 | IntFeatures[Fid].CP_misses = 0; |
| 121 | } |
| 122 | } /* ComputeIntFeatures */ |
| 123 | } // namespace tesseract |
nothing calls this directly
no test coverage detected