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

Function ReadFeature

deps/tesseract/classify/ocrfeatures.cpp:138–151  ·  view source on GitHub ↗

* Create a new feature of the specified type and read in * the value of its parameters from File. The extra penalty * for the feature is also computed by calling the appropriate * function for the specified feature type. The correct text * representation for a feature is a list of N floats where * N is the number of parameters in the feature. * @param File open text file to read feature fr

Source from the content-addressed store, hash-verified

136 * @note History: Wed May 23 08:53:16 1990, DSJ, Created.
137 */
138FEATURE ReadFeature(FILE* File, const FEATURE_DESC_STRUCT* FeatureDesc) {
139 FEATURE Feature;
140 int i;
141
142 Feature = NewFeature (FeatureDesc);
143 for (i = 0; i < Feature->Type->NumParams; i++) {
144 if (tfscanf(File, "%f", &(Feature->Params[i])) != 1)
145 DoError (ILLEGAL_FEATURE_PARAM, "Illegal feature parameter spec");
146#ifndef _WIN32
147 assert (!isnan(Feature->Params[i]));
148#endif
149 }
150 return (Feature);
151} /* ReadFeature */
152
153/**
154 * Create a new feature set of the specified type and read in

Callers 1

ReadFeatureSetFunction · 0.85

Calls 4

NewFeatureFunction · 0.85
tfscanfFunction · 0.85
DoErrorFunction · 0.85
isnanFunction · 0.85

Tested by

no test coverage detected