Skip to content

Commit

Permalink
classify: Remove deprecated method ExtractIntFeat (#1422)
Browse files Browse the repository at this point in the history
It was deprecated with commit 99edf4c four years ago.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil authored and zdenop committed Mar 25, 2018
1 parent bf0bddb commit 3dcab4e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
44 changes: 0 additions & 44 deletions classify/intfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 0 additions & 7 deletions classify/intfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3dcab4e

Please sign in to comment.