21 #pragma warning(disable:4244) // Conversion warnings 33 #include "config_auto.h" 58 static int SortCPByTopReverse(
const void* p1,
const void* p2) {
59 const ColPartition* cp1 = *
static_cast<ColPartition* const*
>(p1);
60 const ColPartition* cp2 = *
static_cast<ColPartition* const*
>(p2);
62 const TBOX &box1(cp1->bounding_box()), &box2(cp2->bounding_box());
63 return box2.
top() - box1.top();
66 static int SortCPByBottom(
const void* p1,
const void* p2) {
67 const ColPartition* cp1 = *
static_cast<ColPartition* const*
>(p1);
68 const ColPartition* cp2 = *
static_cast<ColPartition* const*
>(p2);
70 const TBOX &box1(cp1->bounding_box()), &box2(cp2->bounding_box());
71 return box1.
bottom() - box2.bottom();
74 static int SortCPByHeight(
const void* p1,
const void* p2) {
75 const ColPartition* cp1 = *
static_cast<ColPartition* const*
>(p1);
76 const ColPartition* cp2 = *
static_cast<ColPartition* const*
>(p2);
78 const TBOX &box1(cp1->bounding_box()), &box2(cp2->bounding_box());
79 return box1.
height() - box2.height();
106 const char* equ_name) {
107 const char* default_name =
"equ";
108 if (equ_name == NULL) {
109 equ_name = default_name;
117 tprintf(
"Warning: equation region detection requested," 118 " but %s failed to load from %s\n", equ_name, equ_datapath);
137 if (to_block == NULL) {
138 tprintf(
"Warning: input to_block is NULL!\n");
145 for (
int i = 0; i < blob_lists.
size(); ++i) {
146 BLOBNBOX_IT bbox_it(blob_lists[i]);
147 for (bbox_it.mark_cycle_pt (); !bbox_it.cycled_list();
149 bbox_it.data()->set_special_text_type(
BSTT_NONE);
157 BLOBNBOX *blobnbox,
const int height_th) {
165 BLOB_CHOICE_LIST ratings_equ, ratings_lang;
175 float x_orig = (box.
left() + box.
right()) / 2.0f, y_orig = box.
bottom();
177 normed_blob->
Normalize(NULL, NULL, NULL, x_orig, y_orig, scaling, scaling,
188 BLOB_CHOICE *lang_choice = NULL, *equ_choice = NULL;
189 if (ratings_lang.length() > 0) {
190 BLOB_CHOICE_IT choice_it(&ratings_lang);
191 lang_choice = choice_it.data();
193 if (ratings_equ.length() > 0) {
194 BLOB_CHOICE_IT choice_it(&ratings_equ);
195 equ_choice = choice_it.data();
198 float lang_score = lang_choice ? lang_choice->
certainty() : -FLT_MAX;
199 float equ_score = equ_choice ? equ_choice->certainty() : -FLT_MAX;
201 const float kConfScoreTh = -5.0f, kConfDiffTh = 1.8;
204 float diff = fabs(lang_score - equ_score);
208 if (
fmax(lang_score, equ_score) < kConfScoreTh) {
211 }
else if (diff > kConfDiffTh && equ_score > lang_score) {
215 }
else if (lang_choice) {
240 if (ids_to_exclude.
empty()) {
241 static const STRING kCharsToEx[] = {
"'",
"`",
"\"",
"\\",
",",
".",
242 "〈",
"〉",
"《",
"》",
"」",
"「",
""};
244 while (kCharsToEx[i] !=
"") {
248 ids_to_exclude.
sort();
255 static const STRING kDigitsChars =
"|";
271 int classify_integer_matcher =
284 BLOBNBOX_C_IT bbox_it(part->
boxes());
287 for (bbox_it.mark_cycle_pt (); !bbox_it.cycled_list();
289 if (bbox_it.data()->special_text_type() !=
BSTT_SKIP) {
290 blob_heights.
push_back(bbox_it.data()->bounding_box().height());
294 int height_th = blob_heights[blob_heights.size() / 2] / 3 * 2;
295 for (bbox_it.mark_cycle_pt (); !bbox_it.cycled_list();
297 if (bbox_it.data()->special_text_type() !=
BSTT_SKIP) {
305 classify_class_pruner);
307 classify_integer_matcher);
318 BLOBNBOX_C_IT blob_it(part->
boxes());
320 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
324 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
333 BLOBNBOX_C_IT blob_it2 = blob_it;
335 while (!blob_it2.at_last()) {
336 BLOBNBOX* nextblob = blob_it2.forward();
338 if (nextblob_box.
left() >= blob_box.
right()) {
341 const float kWidthR = 0.4, kHeightR = 0.3;
343 yoverlap = blob_box.
y_overlap(nextblob_box);
344 float widthR =
static_cast<float>(
347 float heightR =
static_cast<float>(
351 if (xoverlap && yoverlap && widthR > kWidthR && heightR > kHeightR) {
355 blob_box += nextblob_box;
367 tprintf(
"Warning: lang_tesseract_ is NULL!\n");
370 if (!part_grid || !best_columns) {
371 tprintf(
"part_grid/best_columns is NULL!!\n");
405 for (
int i = 0; i <
cp_seeds_.size(); ++i) {
413 for (
int i = 0; i < seeds_expanded.
size(); ++i) {
443 if (parts_to_merge.
empty()) {
449 for (
int i = 0; i < parts_to_merge.
size(); ++i) {
450 ASSERT_HOST(parts_to_merge[i] != NULL && parts_to_merge[i] != part);
451 part->
Absorb(parts_to_merge[i], NULL);
458 if (parts_updated.
empty()) {
463 for (
int i = 0; i < parts_updated.
size(); ++i) {
472 ASSERT_HOST(seed != NULL && parts_overlap != NULL);
478 const int kRadNeighborCells = 30;
480 (seed_box.top() + seed_box.bottom()) / 2,
487 const float kLargeOverlapTh = 0.95;
488 const float kEquXOverlap = 0.4, kEquYOverlap = 0.5;
497 y_overlap_fraction = part_box.y_overlap_fraction(seed_box);
500 if (x_overlap_fraction >= kLargeOverlapTh &&
501 y_overlap_fraction >= kLargeOverlapTh) {
505 if ((x_overlap_fraction > kEquXOverlap && y_overlap_fraction > 0.0) ||
506 (x_overlap_fraction > 0.0 && y_overlap_fraction > kEquYOverlap)) {
532 part_box.left(), part_box.bottom(), &grid_x, &grid_y);
561 const int kTextBlobsTh = 20;
586 indented_texts_left.
sort();
587 texts_foreground_density.
sort();
588 float foreground_density_th = 0.15;
589 if (!texts_foreground_density.
empty()) {
591 foreground_density_th = 0.8 * texts_foreground_density[
592 texts_foreground_density.
size() / 2];
595 for (
int i = 0; i < seeds1.
size(); ++i) {
596 const TBOX& box = seeds1[i]->bounding_box();
600 kLeftIndentAlignmentCountTh)) {
609 for (
int i = 0; i < seeds2.
size(); ++i) {
610 if (
CheckForSeed2(indented_texts_left, foreground_density_th, seeds2[i])) {
619 int pix_height = pixGetHeight(pix_bi);
620 Box* box = boxCreate(tbox.
left(), pix_height - tbox.
top(),
622 Pix *pix_sub = pixClipRectangle(pix_bi, box, NULL);
624 pixForegroundFraction(pix_sub, &fract);
625 pixDestroy(&pix_sub);
638 float parts_passed = 0.0;
639 for (
int i = 0; i < sub_boxes.
size(); ++i) {
641 if (density < density_th) {
647 const float kSeedPartRatioTh = 0.3;
648 bool retval = (parts_passed / sub_boxes.
size() >= kSeedPartRatioTh);
663 parts_splitted->
clear();
666 bool found_split =
true;
667 while (found_split) {
669 BLOBNBOX_C_IT box_it(right_part->
boxes());
677 for (box_it.mark_cycle_pt(); !box_it.cycled_list(); box_it.forward()) {
678 const TBOX& box = box_it.data()->bounding_box();
680 box.
left() - previous_right > kThreshold) {
683 int mid_x = (box.
left() + previous_right) / 2;
685 right_part = left_part->
SplitAt(mid_x);
694 previous_right =
MAX(previous_right, box.
right());
706 splitted_boxes->
clear();
719 BLOBNBOX_C_IT box_it(part->
boxes());
720 for (box_it.mark_cycle_pt(); !box_it.cycled_list(); box_it.forward()) {
721 const TBOX& box = box_it.data()->bounding_box();
723 box.
left() - previous_right > kThreshold) {
734 previous_right =
MAX(previous_right, box.
right());
745 const float foreground_density_th,
751 if (!indented_texts_left.
empty() &&
753 kLeftIndentAlignmentCountTh) {
767 if (sorted_vec.
empty()) {
775 while (index >= 0 && abs(val - sorted_vec[index--]) < kDistTh) {
781 while (index < sorted_vec.
size() && sorted_vec[index++] - val < kDistTh) {
814 const int kGapTh =
static_cast<int>(
roundf(
820 for (
int i = 0; i <
cp_seeds_.size(); ++i) {
826 if (left_margin + kMarginDiffTh < right_margin &&
827 left_margin < kMarginDiffTh) {
830 part_box.right(), part_box.top(), part_box.bottom());
831 right_to_left =
false;
832 }
else if (left_margin > cps_cx) {
836 part_box.left(), part_box.top(), part_box.bottom());
837 right_to_left =
true;
843 bool side_neighbor_found =
false;
844 while ((neighbor = search.
NextSideSearch(right_to_left)) != NULL) {
847 part_box.x_gap(neighbor_box) > kGapTh ||
848 !part_box.major_y_overlap(neighbor_box) ||
849 part_box.major_x_overlap(neighbor_box)) {
853 side_neighbor_found =
true;
856 if (!side_neighbor_found) {
861 if (neighbor_box.width() > part_box.width() &&
887 const TBOX &prev_box = prev->bounding_box();
891 int gap = current_box.
y_gap(prev_box);
901 if (ygaps.
size() < 8) {
907 int spacing = 0,
count;
909 spacing += ygaps[
count];
911 return spacing /
count;
915 const bool top_to_bottom,
const int textparts_linespacing) {
928 for (
int i = 0; i <
cp_seeds_.size(); ++i) {
934 if (
IsInline(!top_to_bottom, textparts_linespacing, part)) {
944 const int textparts_linespacing,
952 const float kYGapRatioTh = 1.0;
964 if (part_box.y_gap(neighbor_box) > kYGapRatioTh *
965 MIN(part_box.height(), neighbor_box.height())) {
974 const float kHeightRatioTh = 0.5;
975 const int kYGapTh = textparts_linespacing > 0 ?
978 if (part_box.x_overlap(neighbor_box) &&
979 part_box.y_gap(neighbor_box) <= kYGapTh &&
981 static_cast<float>(
MIN(part_box.height(), neighbor_box.height())) /
982 MAX(part_box.height(), neighbor_box.height()) > kHeightRatioTh) {
994 const int kSeedMathBlobsCount = 2;
995 const int kSeedMathDigitBlobsCount = 5;
1000 if (blobs < kSeedBlobsCountTh || math_blobs <= kSeedMathBlobsCount ||
1001 math_blobs + digit_blobs <= kSeedMathDigitBlobsCount) {
1009 const float math_density_high,
1010 const float math_density_low,
1016 if (math_digit_density > math_density_high) {
1019 if (math_digit_density + italic_density > kMathItalicDensityTh &&
1020 math_digit_density > math_density_low) {
1041 (part_box.top() + part_box.bottom()) / 2, kRadiusTh);
1043 bool left_indented =
false, right_indented =
false;
1045 (!left_indented || !right_indented)) {
1046 if (neighbor == part) {
1051 if (part_box.major_y_overlap(neighbor_box) &&
1052 part_box.x_gap(neighbor_box) < kXGapTh) {
1063 if (!part_box.x_overlap(neighbor_box) || part_box.y_overlap(neighbor_box)) {
1067 if (part_box.y_gap(neighbor_box) < kYGapTh) {
1068 int left_gap = part_box.left() - neighbor_box.left();
1069 int right_gap = neighbor_box.right() - part_box.right();
1070 if (left_gap > kXGapTh) {
1071 left_indented =
true;
1073 if (right_gap > kXGapTh) {
1074 right_indented =
true;
1079 if (left_indented && right_indented) {
1082 if (left_indented) {
1085 if (right_indented) {
1105 if (parts_to_merge.
empty()) {
1113 for (
int i = 0; i < parts_to_merge.
size(); ++i) {
1118 for (
int j = 0; j <
cp_seeds_.size(); ++j) {
1128 seed->
Absorb(part, NULL);
1135 const bool search_left,
1138 ASSERT_HOST(seed != NULL && parts_to_merge != NULL);
1139 const float kYOverlapTh = 0.6;
1144 int x = search_left ? seed_box.
left() : seed_box.right();
1155 if (part_box.x_gap(seed_box) > kXGapTh) {
1160 if ((part_box.left() >= seed_box.left() && search_left) ||
1161 (part_box.right() <= seed_box.right() && !search_left)) {
1178 if (part_box.y_overlap_fraction(seed_box) < kYOverlapTh &&
1179 seed_box.y_overlap_fraction(part_box) < kYOverlapTh) {
1191 const bool search_bottom,
1194 ASSERT_HOST(seed != NULL && parts_to_merge != NULL &&
1196 const float kXOverlapTh = 0.4;
1201 int y = search_bottom ? seed_box.
bottom() : seed_box.top();
1209 int skipped_min_top = INT_MAX, skipped_max_bottom = -1;
1216 if (part_box.y_gap(seed_box) > kYGapTh) {
1221 if ((part_box.bottom() >= seed_box.bottom() && search_bottom) ||
1222 (part_box.top() <= seed_box.top() && !search_bottom)) {
1226 bool skip_part =
false;
1239 if (part_box.x_overlap_fraction(seed_box) < kXOverlapTh &&
1240 seed_box.x_overlap_fraction(part_box) < kXOverlapTh) {
1246 if (skipped_min_top > part_box.top()) {
1247 skipped_min_top = part_box.
top();
1249 if (skipped_max_bottom < part_box.bottom()) {
1250 skipped_max_bottom = part_box.bottom();
1265 for (
int i = 0; i < parts.
size(); i++) {
1266 const TBOX& part_box(parts[i]->bounding_box());
1267 if ((search_bottom && part_box.
top() <= skipped_max_bottom) ||
1268 (!search_bottom && part_box.
bottom() >= skipped_min_top)) {
1278 const TBOX& part_box)
const {
1290 part_box.
y_gap(seed_box) > kYGapTh) &&
1292 part_box.
x_gap(seed_box) > kXGapTh)) {
1328 if (text_parts.
empty()) {
1333 text_parts.
sort(&SortCPByHeight);
1334 const TBOX& text_box = text_parts[text_parts.
size() / 2]->bounding_box();
1335 int med_height = text_box.
height();
1336 if (text_parts.
size() % 2 == 0 && text_parts.
size() > 1) {
1337 const TBOX& text_box =
1338 text_parts[text_parts.
size() / 2 - 1]->bounding_box();
1339 med_height =
static_cast<int>(
roundf(
1340 0.5 * (text_box.
height() + med_height)));
1344 for (
int i = 0; i < text_parts.
size(); ++i) {
1345 const TBOX& text_box(text_parts[i]->bounding_box());
1346 if (text_box.
height() > med_height) {
1357 for (
int j = 0; j < math_blocks.
size(); ++j) {
1359 text_parts[i]->Absorb(math_blocks[j], NULL);
1368 math_blocks->
clear();
1372 int y_gaps[2] = {INT_MAX, INT_MAX};
1374 int neighbors_left = INT_MAX, neighbors_right = 0;
1375 for (
int i = 0; i < 2; ++i) {
1378 const TBOX& neighbor_box = neighbors[i]->bounding_box();
1379 y_gaps[i] = neighbor_box.
y_gap(part_box);
1380 if (neighbor_box.
left() < neighbors_left) {
1381 neighbors_left = neighbor_box.
left();
1383 if (neighbor_box.
right() > neighbors_right) {
1384 neighbors_right = neighbor_box.
right();
1388 if (neighbors[0] == neighbors[1]) {
1390 neighbors[1] = NULL;
1391 y_gaps[1] = INT_MAX;
1395 if (part_box.left() < neighbors_left || part_box.right() > neighbors_right) {
1400 int index = y_gaps[0] < y_gaps[1] ? 0 : 1;
1404 math_blocks->
push_back(neighbors[index]);
1413 math_blocks->
push_back(neighbors[index]);
1422 ColPartition *nearest_neighbor = NULL, *neighbor = NULL;
1428 int y = search_bottom ? part_box.
bottom() : part_box.top();
1430 int min_y_gap = INT_MAX;
1435 const TBOX& neighbor_box(neighbor->bounding_box());
1436 int y_gap = neighbor_box.
y_gap(part_box);
1437 if (y_gap > kYGapTh) {
1440 if (!neighbor_box.major_x_overlap(part_box) ||
1441 (search_bottom && neighbor_box.bottom() > part_box.bottom()) ||
1442 (!search_bottom && neighbor_box.top() < part_box.top())) {
1445 if (y_gap < min_y_gap) {
1447 nearest_neighbor = neighbor;
1451 return nearest_neighbor;
1464 STRING* image_name)
const {
1467 snprintf(page,
sizeof(page),
"%04d",
page_count_);
1473 pix = pixConvertTo32(pixBi);
1478 BLOBNBOX_C_IT blob_it(part->
boxes());
1479 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
1484 pixWrite(outfile.
string(), pix, IFF_TIFF_LZW);
1491 gsearch.StartFullSearch();
1493 while ((part = gsearch.NextFullSearch()) != NULL) {
1495 Box *box = boxCreate(tbox.
left(), pixGetHeight(pix) - tbox.
top(),
1498 pixRenderBoxArb(pix, box, 5, 255, 0, 0);
1500 pixRenderBoxArb(pix, box, 5, 0, 255, 0);
1502 pixRenderBoxArb(pix, box, 5, 0, 0, 255);
1507 pixWrite(outfile.
string(), pix, IFF_TIFF_LZW);
1515 tprintf(
"Printing special blobs density values for ColParition (t=%d,b=%d) ",
1516 h - box.top(), h - box.bottom());
const int kSeedBlobsCountTh
int SpecialBlobsCount(const BlobSpecialTextType type)
EquationDetect(const char *equ_datapath, const char *equ_language)
ColPartitionGrid * part_grid_
static void RenderSpecialText(Pix *pix, BLOBNBOX *blob)
void GetOutputTiffName(const char *name, STRING *image_name) const
bool CheckSeedFgDensity(const float density_th, ColPartition *part)
bool IsVerticalType() const
bool y_overlap(const TBOX &box) const
void ComputeSpecialBlobsDensity()
ColPartition * CopyButDontOwnBlobs()
void IdentifyBlobsToSkip(ColPartition *part)
bool IsMathBlockSatellite(ColPartition *part, GenericVector< ColPartition *> *math_blocks)
float ComputeForegroundDensity(const TBOX &tbox)
const int kLeftIndentAlignmentCountTh
bool get_ispunctuation(UNICHAR_ID unichar_id) const
GenericVector< ColPartition * > cp_seeds_
bool equationdetect_save_bi_image
bool equationdetect_save_merged_image
BLOBNBOX_LIST large_blobs
bool IsNearMathNeighbor(const int y_gap, const ColPartition *neighbor) const
void ProcessMathBlockSatelliteParts()
BlobSpecialTextType EstimateTypeForUnichar(const UNICHARSET &unicharset, const UNICHAR_ID id) const
void SetResolution(const int resolution)
ColPartitionSet ** best_columns_
int CountAlignment(const GenericVector< int > &sorted_vec, const int val) const
bool bool_binary_search(const T &target) const
bool IsNearSmallNeighbor(const TBOX &seed_box, const TBOX &part_box) const
int classify_integer_matcher_multiplier
void PaintColParts(const STRING &outfile) const
double x_overlap_fraction(const TBOX &box) const
int LabelSpecialText(TO_BLOCK *to_block)
void set_flow(BlobTextFlowType f)
bool CheckSeedBlobsCount(ColPartition *part)
const char * string() const
bool ExpandSeed(ColPartition *seed)
const int kBlnBaselineOffset
void PrintSpecialBlobsDensity(const ColPartition *part) const
bool joined_to_prev() const
int EstimateTextPartLineSpacing()
const float kMathItalicDensityTh
#define BOOL_VAR(name, val, comment)
void SplitCPHorLite(ColPartition *part, GenericVector< TBOX > *splitted_boxes)
UnicityTable< FontInfo > & get_fontinfo_table()
bool major_x_overlap(const TBOX &box) const
int IntCastRounded(double x)
BlobSpecialTextType special_text_type() const
void ExpandSeedHorizontal(const bool search_left, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
void RepositionIterator()
bool major_y_overlap(const TBOX &box) const
bool CheckSeedNeighborDensity(const ColPartition *part) const
void IdentifyInlinePartsVertical(const bool top_to_bottom, const int textPartsLineSpacing)
int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)
const char * id_to_unichar(UNICHAR_ID id) const
int classify_class_pruner_multiplier
void SetUniqueMode(bool mode)
IndentType IsIndented(ColPartition *part)
LIST search(LIST list, void *key, int_compare is_equal)
bool get_isalpha(UNICHAR_ID unichar_id) const
void StartVerticalSearch(int xmin, int xmax, int y)
int y_gap(const TBOX &box) const
inT16 fontinfo_id() const
void SetPartitionType(int resolution, ColPartitionSet *columns)
bool IsTextOrEquationType(PolyBlockType type)
ColPartition * SplitAt(int split_x)
void SearchByOverlap(ColPartition *seed, GenericVector< ColPartition *> *parts_overlap)
const float kUnclearDensityTh
bool get_isdigit(UNICHAR_ID unichar_id) const
void set_type(PolyBlockType t)
bool IsRightIndented(const EquationDetect::IndentType type)
bool equationdetect_save_seed_image
void InsertBBox(bool h_spread, bool v_spread, BBC *bbox)
const TBOX & bounding_box() const
bool IsInline(const bool search_bottom, const int textPartsLineSpacing, ColPartition *part)
BOOL8 contains(const char c) const
void PaintSpecialTexts(const STRING &outfile) const
int init_tesseract(const char *arg0, const char *textbase, const char *language, OcrEngineMode oem, char **configs, int configs_size, const GenericVector< STRING > *vars_vec, const GenericVector< STRING > *vars_values, bool set_only_init_params, TessdataManager *mgr)
void SplitCPHor(ColPartition *part, GenericVector< ColPartition *> *parts_splitted)
void StartSideSearch(int x, int ymin, int ymax)
bool IsLeftIndented(const EquationDetect::IndentType type)
void StartRadSearch(int x, int y, int max_radius)
void Normalize(const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift, bool inverse, Pix *pix)
PolyBlockType type() const
int binary_search(const T &target) const
BBC * NextVerticalSearch(bool top_to_bottom)
const float kMathDigitDensityTh1
void ComputeCPsSuperBBox()
void MergePartsByLocation()
bool CheckSeedDensity(const float math_density_high, const float math_density_low, const ColPartition *part) const
int source_resolution() const
void IdentifyInlineParts()
BBC * NextSideSearch(bool right_to_left)
void AdaptiveClassifier(TBLOB *Blob, BLOB_CHOICE_LIST *Choices)
void RemoveBBox(BBC *bbox)
UNICHAR_ID unichar_id() const
bool PTIsTextType(PolyBlockType type)
ColPartition * SearchNNVertical(const bool search_bottom, const ColPartition *part)
void IdentifySpecialText()
void set_special_text_type(BlobSpecialTextType new_type)
void InsertPartAfterAbsorb(ColPartition *part)
void Absorb(ColPartition *other, WidthCallback *cb)
float SpecialBlobsDensity(const BlobSpecialTextType type) const
void ExpandSeedVertical(const bool search_bottom, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
static TBLOB * PolygonalCopy(bool allow_detailed_fx, C_BLOB *src)
void SetLangTesseract(Tesseract *lang_tesseract)
void delete_data_pointers()
UNICHAR_ID unichar_to_id(const char *const unichar_repr) const
TBOX bounding_box() const
void IdentifyInlinePartsHorizontal()
bool equationdetect_save_spt_image
const TBOX & bounding_box() const
const float kMathDigitDensityTh2
BlobTextFlowType flow() const
BlobRegionType blob_type() const
bool CheckForSeed2(const GenericVector< int > &indented_texts_left, const float foreground_density_th, ColPartition *part)
void GridCoords(int x, int y, int *grid_x, int *grid_y) const
Tesseract * lang_tesseract_
int x_gap(const TBOX &box) const
void set_blob_type(BlobRegionType t)