From d40b28f47db9bdf7692a369ee71236b5f6988392 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Mon, 5 Sep 2016 22:39:28 +0200 Subject: [PATCH] textord: Remove unused constants Signed-off-by: Stefan Weil --- textord/colfind.cpp | 7 ------- textord/strokewidth.cpp | 7 ------- textord/tablefind.cpp | 5 ----- textord/tordmain.cpp | 3 --- 4 files changed, 22 deletions(-) diff --git a/textord/colfind.cpp b/textord/colfind.cpp index ea5d73d9e4..ae48e9ffa5 100644 --- a/textord/colfind.cpp +++ b/textord/colfind.cpp @@ -44,19 +44,12 @@ namespace tesseract { -// Minimum width (in pixels) to be considered when making columns. -// TODO(rays) convert to inches, dependent on resolution. -const int kMinColumnWidth = 100; // When assigning columns, the max number of misfit grid rows/ColPartitionSets // that can be ignored. const int kMaxIncompatibleColumnCount = 2; -// Min fraction of ColPartition height to be overlapping for margin purposes. -const double kMarginOverlapFraction = 0.25; // Max fraction of mean_column_gap_ for the gap between two partitions within a // column to allow them to merge. const double kHorizontalGapMergeFraction = 0.5; -// Min fraction of grid size to not be considered likely noise. -const double kMinNonNoiseFraction = 0.5; // Minimum gutter width as a fraction of gridsize const double kMinGutterWidthGrid = 0.5; // Max multiple of a partition's median size as a distance threshold for diff --git a/textord/strokewidth.cpp b/textord/strokewidth.cpp index 8ca45a11c2..5d0fdc5133 100644 --- a/textord/strokewidth.cpp +++ b/textord/strokewidth.cpp @@ -84,8 +84,6 @@ const double kMaxDiacriticDistanceRatio = 1.25; // Max x-gap between a diacritic and its base char as a fraction of the height // of the base char (allowing other blobs to fill the gap.) const double kMaxDiacriticGapToBaseCharHeight = 1.0; -// Radius of a search for diacritics in grid units. -const int kSearchRadius = 2; // Ratio between longest side of a line and longest side of a character. // (neighbor_min > blob_min * kLineTrapShortest && // neighbor_max < blob_max / kLineTrapLongest) @@ -104,9 +102,6 @@ const int kLineResiduePadRatio = 3; const double kLineResidueSizeRatio = 1.75; // Aspect ratio filter for OSD. const float kSizeRatioToReject = 2.0; -// Max number of normal blobs a large blob may overlap before it is rejected -// and determined to be image -const int kMaxLargeOverlaps = 3; // Expansion factor for search box for good neighbours. const double kNeighbourSearchFactor = 2.5; // Factor of increase of overlap when adding diacritics to make an image noisy. @@ -114,8 +109,6 @@ const double kNoiseOverlapGrowthFactor = 4.0; // Fraction of the image size to add overlap when adding diacritics for an // image to qualify as noisy. const double kNoiseOverlapAreaFactor = 1.0 / 512; -// Ratio of perimeter^2/area for a blob to be considered noise vs i dot. -const double kShapePerimeterRatio = 3.0; StrokeWidth::StrokeWidth(int gridsize, const ICOORD& bleft, const ICOORD& tright) diff --git a/textord/tablefind.cpp b/textord/tablefind.cpp index f555cd1e73..425bdbc218 100644 --- a/textord/tablefind.cpp +++ b/textord/tablefind.cpp @@ -114,11 +114,6 @@ const int kLargeTableRowCount = 6; // Minimum number of rows in a table const int kMinRowsInTable = 3; -// The number of "whitespace blobs" that should appear between the -// ColPartition's bounding box and the column tab stops to the left/right -// when looking for center justified tab stops. -const double kRequiredFullJustifiedSpacing = 4.0; - // The amount of padding (multiplied by global_median_xheight_ during use) // that is vertically added to the search adjacent leader search during // ColPartition marking. diff --git a/textord/tordmain.cpp b/textord/tordmain.cpp index 14cb7171f5..f09a186d4f 100644 --- a/textord/tordmain.cpp +++ b/textord/tordmain.cpp @@ -38,9 +38,6 @@ #include "allheaders.h" -// Gridsize for word grid when reassigning diacritics to words. Not critical. -const int kWordGridSize = 50; - #undef EXTERN #define EXTERN