---------------------------------------------------------------------------*/ * This routine extracts character normalized features * from the unknown character and matches them against the * specified set of templates. The classes which match * are added to Results. * * @param blob blob to be classified * @param sample templates to classify unknown against * @param adapt_results place to
| 1353 | * @note History: Tue Mar 12 16:02:52 1991, DSJ, Created. |
| 1354 | */ |
| 1355 | int Classify::CharNormClassifier(TBLOB *blob, |
| 1356 | const TrainingSample& sample, |
| 1357 | ADAPT_RESULTS *adapt_results) { |
| 1358 | // This is the length that is used for scaling ratings vs certainty. |
| 1359 | adapt_results->BlobLength = |
| 1360 | IntCastRounded(sample.outline_length() / kStandardFeatureLength); |
| 1361 | GenericVector<UnicharRating> unichar_results; |
| 1362 | static_classifier_->UnicharClassifySample(sample, blob->denorm().pix(), 0, |
| 1363 | -1, &unichar_results); |
| 1364 | // Convert results to the format used internally by AdaptiveClassifier. |
| 1365 | for (int r = 0; r < unichar_results.size(); ++r) { |
| 1366 | AddNewResult(unichar_results[r], adapt_results); |
| 1367 | } |
| 1368 | return sample.num_features(); |
| 1369 | } /* CharNormClassifier */ |
| 1370 | |
| 1371 | // As CharNormClassifier, but operates on a TrainingSample and outputs to |
| 1372 | // a GenericVector of ShapeRating without conversion to classes. |
nothing calls this directly
no test coverage detected