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

Function ReadFeatureSet

deps/tesseract/classify/ocrfeatures.cpp:164–177  ·  view source on GitHub ↗

* Create a new feature set of the specified type and read in * the features from File. The correct text representation * for a feature set is an integer which specifies the number (N) * of features in a set followed by a list of N feature * descriptions. * @param File open text file to read new feature set from * @param FeatureDesc specifies type of feature to read from File * @return New

Source from the content-addressed store, hash-verified

162 * @note History: Wed May 23 09:17:31 1990, DSJ, Created.
163 */
164FEATURE_SET ReadFeatureSet(FILE* File, const FEATURE_DESC_STRUCT* FeatureDesc) {
165 FEATURE_SET FeatureSet;
166 int NumFeatures;
167 int i;
168
169 if (tfscanf(File, "%d", &NumFeatures) != 1 || NumFeatures < 0)
170 DoError(ILLEGAL_NUM_FEATURES, "Illegal number of features in set");
171
172 FeatureSet = NewFeatureSet(NumFeatures);
173 for (i = 0; i < NumFeatures; i++)
174 AddFeature(FeatureSet, ReadFeature (File, FeatureDesc));
175
176 return (FeatureSet);
177} /* ReadFeatureSet */
178
179/**
180 * Appends a textual representation of Feature to str.

Callers 1

ReadCharDescriptionFunction · 0.85

Calls 5

tfscanfFunction · 0.85
DoErrorFunction · 0.85
NewFeatureSetFunction · 0.85
AddFeatureFunction · 0.85
ReadFeatureFunction · 0.85

Tested by

no test coverage detected