MCPcopy Create free account
hub / github.com/creatale/node-dv / ComputeIntFeatures

Method ComputeIntFeatures

deps/tesseract/classify/float2int.cpp:100–122  ·  view source on GitHub ↗

---------------------------------------------------------------------------*/ * 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

Source from the content-addressed store, hash-verified

98 * @note History: Wed Feb 20 10:58:45 1991, DSJ, Created.
99 */
100void 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

Callers

nothing calls this directly

Calls 2

Bucket8ForFunction · 0.85
CircBucketForFunction · 0.85

Tested by

no test coverage detected