mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 20:59:36 +08:00
classify: Remove deprecated method ExtractIntFeat (#1422)
It was deprecated with commit 99edf4ccb
four years ago.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
bf0bddb9ca
commit
3dcab4e187
@ -487,47 +487,3 @@ void Classify::ExtractFeatures(const TBLOB& blob,
|
||||
}
|
||||
|
||||
} // namespace tesseract
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
// Extract a set of standard-sized features from Blobs and write them out in
|
||||
// two formats: baseline normalized and character normalized.
|
||||
//
|
||||
// We presume the Blobs are already scaled so that x-height=128 units
|
||||
//
|
||||
// Standard Features:
|
||||
// We take all outline segments longer than 7 units and chop them into
|
||||
// standard-sized segments of approximately 13 = (64 / 5) units.
|
||||
// When writing these features out, we output their center and angle as
|
||||
// measured counterclockwise from the vector <-1, 0>
|
||||
//
|
||||
// Baseline Normalized Output:
|
||||
// We center the grapheme by aligning the x-coordinate of its centroid with
|
||||
// x=0 and subtracting 128 from the y-coordinate.
|
||||
//
|
||||
// Character Normalized Output:
|
||||
// We align the grapheme's centroid at the origin and scale it asymmetrically
|
||||
// in x and y so that the result is vaguely square.
|
||||
//
|
||||
// Deprecated! Prefer tesseract::Classify::ExtractFeatures instead.
|
||||
bool ExtractIntFeat(const TBLOB& blob,
|
||||
bool nonlinear_norm,
|
||||
INT_FEATURE_ARRAY baseline_features,
|
||||
INT_FEATURE_ARRAY charnorm_features,
|
||||
INT_FX_RESULT_STRUCT* results) {
|
||||
GenericVector<INT_FEATURE_STRUCT> bl_features;
|
||||
GenericVector<INT_FEATURE_STRUCT> cn_features;
|
||||
tesseract::Classify::ExtractFeatures(blob, nonlinear_norm,
|
||||
&bl_features, &cn_features, results,
|
||||
NULL);
|
||||
if (bl_features.empty() || cn_features.empty() ||
|
||||
bl_features.size() > MAX_NUM_INT_FEATURES ||
|
||||
cn_features.size() > MAX_NUM_INT_FEATURES) {
|
||||
return false; // Feature extraction failed.
|
||||
}
|
||||
memcpy(baseline_features, &bl_features[0],
|
||||
bl_features.size() * sizeof(bl_features[0]));
|
||||
memcpy(charnorm_features, &cn_features[0],
|
||||
cn_features.size() * sizeof(cn_features[0]));
|
||||
return true;
|
||||
}
|
||||
|
@ -65,11 +65,4 @@ namespace tesseract {
|
||||
GenericVector<INT_FEATURE_STRUCT>* bl_features);
|
||||
}
|
||||
|
||||
// Deprecated! Prefer tesseract::Classify::ExtractFeatures instead.
|
||||
bool ExtractIntFeat(const TBLOB& blob,
|
||||
bool nonlinear_norm,
|
||||
INT_FEATURE_ARRAY BLFeat,
|
||||
INT_FEATURE_ARRAY CNFeat,
|
||||
INT_FX_RESULT_STRUCT* Results);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user