21 #pragma warning(disable:4244) // Conversion warnings 59 static int SortCPByTopReverse(
const void* p1,
const void* p2) {
60 const ColPartition* cp1 = *
reinterpret_cast<ColPartition* const*
>(p1);
61 const ColPartition* cp2 = *
reinterpret_cast<ColPartition* const*
>(p2);
63 const TBOX &box1(cp1->bounding_box()), &box2(cp2->bounding_box());
64 return box2.
top() - box1.top();
67 static int SortCPByBottom(
const void* p1,
const void* p2) {
68 const ColPartition* cp1 = *
reinterpret_cast<ColPartition* const*
>(p1);
69 const ColPartition* cp2 = *
reinterpret_cast<ColPartition* const*
>(p2);
71 const TBOX &box1(cp1->bounding_box()), &box2(cp2->bounding_box());
72 return box1.
bottom() - box2.bottom();
75 static int SortCPByHeight(
const void* p1,
const void* p2) {
76 const ColPartition* cp1 = *
reinterpret_cast<ColPartition* const*
>(p1);
77 const ColPartition* cp2 = *
reinterpret_cast<ColPartition* const*
>(p2);
79 const TBOX &box1(cp1->bounding_box()), &box2(cp2->bounding_box());
80 return box1.
height() - box2.height();
107 const char* equ_name) {
108 const char* default_name =
"equ";
109 if (equ_name == NULL) {
110 equ_name = default_name;
118 tprintf(
"Warning: equation region detection requested," 119 " but %s failed to load from %s\n", equ_name, equ_datapath);
138 if (to_block == NULL) {
139 tprintf(
"Warning: input to_block is NULL!\n");
146 for (
int i = 0; i < blob_lists.
size(); ++i) {
147 BLOBNBOX_IT bbox_it(blob_lists[i]);
148 for (bbox_it.mark_cycle_pt (); !bbox_it.cycled_list();
150 bbox_it.data()->set_special_text_type(
BSTT_NONE);
158 BLOBNBOX *blobnbox,
const int height_th) {
166 BLOB_CHOICE_LIST ratings_equ, ratings_lang;
176 float x_orig = (box.
left() + box.
right()) / 2.0f, y_orig = box.
bottom();
178 normed_blob->
Normalize(NULL, NULL, NULL, x_orig, y_orig, scaling, scaling,
189 BLOB_CHOICE *lang_choice = NULL, *equ_choice = NULL;
190 if (ratings_lang.length() > 0) {
191 BLOB_CHOICE_IT choice_it(&ratings_lang);
192 lang_choice = choice_it.data();
194 if (ratings_equ.length() > 0) {
195 BLOB_CHOICE_IT choice_it(&ratings_equ);
196 equ_choice = choice_it.data();
199 float lang_score = lang_choice ? lang_choice->
certainty() : -FLT_MAX;
200 float equ_score = equ_choice ? equ_choice->certainty() : -FLT_MAX;
202 const float kConfScoreTh = -5.0f, kConfDiffTh = 1.8;
205 float diff = fabs(lang_score - equ_score);
209 if (fmax(lang_score, equ_score) < kConfScoreTh) {
212 }
else if (diff > kConfDiffTh && equ_score > lang_score) {
216 }
else if (lang_choice) {
241 if (ids_to_exclude.
empty()) {
242 static const STRING kCharsToEx[] = {
"'",
"`",
"\"",
"\\",
",",
".",
243 "〈",
"〉",
"《",
"》",
"」",
"「",
""};
245 while (kCharsToEx[i] !=
"") {
249 ids_to_exclude.
sort();
256 static const STRING kDigitsChars =
"|";
272 int classify_integer_matcher =
285 BLOBNBOX_C_IT bbox_it(part->
boxes());
288 for (bbox_it.mark_cycle_pt (); !bbox_it.cycled_list();
290 if (bbox_it.data()->special_text_type() !=
BSTT_SKIP) {
291 blob_heights.
push_back(bbox_it.data()->bounding_box().height());
295 int height_th = blob_heights[blob_heights.size() / 2] / 3 * 2;
296 for (bbox_it.mark_cycle_pt (); !bbox_it.cycled_list();
298 if (bbox_it.data()->special_text_type() !=
BSTT_SKIP) {
306 classify_class_pruner);
308 classify_integer_matcher);
319 BLOBNBOX_C_IT blob_it(part->
boxes());
321 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
325 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
334 BLOBNBOX_C_IT blob_it2 = blob_it;
336 while (!blob_it2.at_last()) {
337 BLOBNBOX* nextblob = blob_it2.forward();
339 if (nextblob_box.
left() >= blob_box.
right()) {
342 const float kWidthR = 0.4, kHeightR = 0.3;
344 yoverlap = blob_box.
y_overlap(nextblob_box);
345 float widthR =
static_cast<float>(
348 float heightR =
static_cast<float>(
352 if (xoverlap && yoverlap && widthR > kWidthR && heightR > kHeightR) {
356 blob_box += nextblob_box;
368 tprintf(
"Warning: lang_tesseract_ is NULL!\n");
371 if (!part_grid || !best_columns) {
372 tprintf(
"part_grid/best_columns is NULL!!\n");
406 for (
int i = 0; i <
cp_seeds_.size(); ++i) {
414 for (
int i = 0; i < seeds_expanded.
size(); ++i) {
444 if (parts_to_merge.
empty()) {
450 for (
int i = 0; i < parts_to_merge.
size(); ++i) {
451 ASSERT_HOST(parts_to_merge[i] != NULL && parts_to_merge[i] != part);
452 part->
Absorb(parts_to_merge[i], NULL);
459 if (parts_updated.
empty()) {
464 for (
int i = 0; i < parts_updated.
size(); ++i) {
473 ASSERT_HOST(seed != NULL && parts_overlap != NULL);
479 const int kRadNeighborCells = 30;
480 search.StartRadSearch((seed_box.left() + seed_box.right()) / 2,
481 (seed_box.top() + seed_box.bottom()) / 2,
483 search.SetUniqueMode(
true);
488 const float kLargeOverlapTh = 0.95;
489 const float kEquXOverlap = 0.4, kEquYOverlap = 0.5;
490 while ((part =
search.NextRadSearch()) != NULL) {
498 y_overlap_fraction = part_box.y_overlap_fraction(seed_box);
501 if (x_overlap_fraction >= kLargeOverlapTh &&
502 y_overlap_fraction >= kLargeOverlapTh) {
506 if ((x_overlap_fraction > kEquXOverlap && y_overlap_fraction > 0.0) ||
507 (x_overlap_fraction > 0.0 && y_overlap_fraction > kEquYOverlap)) {
533 part_box.left(), part_box.bottom(), &grid_x, &grid_y);
562 const int kTextBlobsTh = 20;
587 indented_texts_left.
sort();
588 texts_foreground_density.
sort();
589 float foreground_density_th = 0.15;
590 if (!texts_foreground_density.
empty()) {
592 foreground_density_th = 0.8 * texts_foreground_density[
593 texts_foreground_density.
size() / 2];
596 for (
int i = 0; i < seeds1.
size(); ++i) {
597 const TBOX& box = seeds1[i]->bounding_box();
610 for (
int i = 0; i < seeds2.
size(); ++i) {
611 if (
CheckForSeed2(indented_texts_left, foreground_density_th, seeds2[i])) {
620 int pix_height = pixGetHeight(pix_bi);
621 Box* box = boxCreate(tbox.
left(), pix_height - tbox.
top(),
623 Pix *pix_sub = pixClipRectangle(pix_bi, box, NULL);
625 pixForegroundFraction(pix_sub, &fract);
626 pixDestroy(&pix_sub);
639 float parts_passed = 0.0;
640 for (
int i = 0; i < sub_boxes.
size(); ++i) {
642 if (density < density_th) {
648 const float kSeedPartRatioTh = 0.3;
649 bool retval = (parts_passed / sub_boxes.
size() >= kSeedPartRatioTh);
664 parts_splitted->
clear();
667 bool found_split =
true;
668 while (found_split) {
670 BLOBNBOX_C_IT box_it(right_part->
boxes());
678 for (box_it.mark_cycle_pt(); !box_it.cycled_list(); box_it.forward()) {
679 const TBOX& box = box_it.data()->bounding_box();
681 box.
left() - previous_right > kThreshold) {
684 int mid_x = (box.
left() + previous_right) / 2;
686 right_part = left_part->
SplitAt(mid_x);
695 previous_right =
MAX(previous_right, box.
right());
707 splitted_boxes->
clear();
720 BLOBNBOX_C_IT box_it(part->
boxes());
721 for (box_it.mark_cycle_pt(); !box_it.cycled_list(); box_it.forward()) {
722 const TBOX& box = box_it.data()->bounding_box();
724 box.
left() - previous_right > kThreshold) {
735 previous_right =
MAX(previous_right, box.
right());
746 const float foreground_density_th,
752 if (!indented_texts_left.
empty() &&
768 if (sorted_vec.
empty()) {
771 const int kDistTh =
static_cast<int>(roundf(0.03 *
resolution_));
776 while (index >= 0 && abs(val - sorted_vec[index--]) < kDistTh) {
782 while (index < sorted_vec.
size() && sorted_vec[index++] - val < kDistTh) {
815 const int kGapTh =
static_cast<int>(roundf(
818 search.SetUniqueMode(
true);
821 for (
int i = 0; i <
cp_seeds_.size(); ++i) {
827 if (left_margin + kMarginDiffTh < right_margin &&
828 left_margin < kMarginDiffTh) {
831 part_box.right(), part_box.top(), part_box.bottom());
832 right_to_left =
false;
833 }
else if (left_margin > cps_cx) {
837 part_box.left(), part_box.top(), part_box.bottom());
838 right_to_left =
true;
844 bool side_neighbor_found =
false;
845 while ((neighbor =
search.NextSideSearch(right_to_left)) != NULL) {
848 part_box.x_gap(neighbor_box) > kGapTh ||
849 !part_box.major_y_overlap(neighbor_box) ||
850 part_box.major_x_overlap(neighbor_box)) {
854 side_neighbor_found =
true;
857 if (!side_neighbor_found) {
862 if (neighbor_box.width() > part_box.width() &&
888 const TBOX &prev_box = prev->bounding_box();
892 int gap = current_box.
y_gap(prev_box);
902 if (ygaps.
size() < 8) {
908 int spacing = 0,
count;
910 spacing += ygaps[
count];
912 return spacing /
count;
916 const bool top_to_bottom,
const int textparts_linespacing) {
929 for (
int i = 0; i <
cp_seeds_.size(); ++i) {
935 if (
IsInline(!top_to_bottom, textparts_linespacing, part)) {
945 const int textparts_linespacing,
953 const float kYGapRatioTh = 1.0;
956 search.StartVerticalSearch(part_box.left(), part_box.right(),
959 search.StartVerticalSearch(part_box.left(), part_box.right(),
962 search.SetUniqueMode(
true);
963 while ((neighbor =
search.NextVerticalSearch(search_bottom)) != NULL) {
965 if (part_box.y_gap(neighbor_box) > kYGapRatioTh *
966 MIN(part_box.height(), neighbor_box.height())) {
975 const float kHeightRatioTh = 0.5;
976 const int kYGapTh = textparts_linespacing > 0 ?
977 textparts_linespacing +
static_cast<int>(roundf(0.02 *
resolution_)):
979 if (part_box.x_overlap(neighbor_box) &&
980 part_box.y_gap(neighbor_box) <= kYGapTh &&
982 static_cast<float>(
MIN(part_box.height(), neighbor_box.height())) /
983 MAX(part_box.height(), neighbor_box.height()) > kHeightRatioTh) {
995 const int kSeedMathBlobsCount = 2;
996 const int kSeedMathDigitBlobsCount = 5;
1002 math_blobs + digit_blobs <= kSeedMathDigitBlobsCount) {
1010 const float math_density_high,
1011 const float math_density_low,
1017 if (math_digit_density > math_density_high) {
1021 math_digit_density > math_density_low) {
1034 const int kXGapTh =
static_cast<int>(roundf(0.5 *
resolution_));
1035 const int kRadiusTh =
static_cast<int>(roundf(3.0 *
resolution_));
1036 const int kYGapTh =
static_cast<int>(roundf(0.5 *
resolution_));
1041 search.StartRadSearch((part_box.left() + part_box.right()) / 2,
1042 (part_box.top() + part_box.bottom()) / 2, kRadiusTh);
1043 search.SetUniqueMode(
true);
1044 bool left_indented =
false, right_indented =
false;
1045 while ((neighbor =
search.NextRadSearch()) != NULL &&
1046 (!left_indented || !right_indented)) {
1047 if (neighbor == part) {
1052 if (part_box.major_y_overlap(neighbor_box) &&
1053 part_box.x_gap(neighbor_box) < kXGapTh) {
1064 if (!part_box.x_overlap(neighbor_box) || part_box.y_overlap(neighbor_box)) {
1068 if (part_box.y_gap(neighbor_box) < kYGapTh) {
1069 int left_gap = part_box.left() - neighbor_box.left();
1070 int right_gap = neighbor_box.right() - part_box.right();
1071 if (left_gap > kXGapTh) {
1072 left_indented =
true;
1074 if (right_gap > kXGapTh) {
1075 right_indented =
true;
1080 if (left_indented && right_indented) {
1083 if (left_indented) {
1086 if (right_indented) {
1106 if (parts_to_merge.
empty()) {
1114 for (
int i = 0; i < parts_to_merge.
size(); ++i) {
1119 for (
int j = 0; j <
cp_seeds_.size(); ++j) {
1129 seed->
Absorb(part, NULL);
1136 const bool search_left,
1139 ASSERT_HOST(seed != NULL && parts_to_merge != NULL);
1140 const float kYOverlapTh = 0.6;
1141 const int kXGapTh =
static_cast<int>(roundf(0.2 *
resolution_));
1145 int x = search_left ? seed_box.
left() : seed_box.right();
1146 search.StartSideSearch(x, seed_box.bottom(), seed_box.top());
1147 search.SetUniqueMode(
true);
1151 while ((part =
search.NextSideSearch(search_left)) != NULL) {
1156 if (part_box.x_gap(seed_box) > kXGapTh) {
1161 if ((part_box.left() >= seed_box.left() && search_left) ||
1162 (part_box.right() <= seed_box.right() && !search_left)) {
1179 if (part_box.y_overlap_fraction(seed_box) < kYOverlapTh &&
1180 seed_box.y_overlap_fraction(part_box) < kYOverlapTh) {
1192 const bool search_bottom,
1195 ASSERT_HOST(seed != NULL && parts_to_merge != NULL &&
1197 const float kXOverlapTh = 0.4;
1198 const int kYGapTh =
static_cast<int>(roundf(0.2 *
resolution_));
1202 int y = search_bottom ? seed_box.
bottom() : seed_box.top();
1203 search.StartVerticalSearch(
1205 search.SetUniqueMode(
true);
1210 int skipped_min_top = INT_MAX, skipped_max_bottom = -1;
1211 while ((part =
search.NextVerticalSearch(search_bottom)) != NULL) {
1217 if (part_box.y_gap(seed_box) > kYGapTh) {
1222 if ((part_box.bottom() >= seed_box.bottom() && search_bottom) ||
1223 (part_box.top() <= seed_box.top() && !search_bottom)) {
1227 bool skip_part =
false;
1240 if (part_box.x_overlap_fraction(seed_box) < kXOverlapTh &&
1241 seed_box.x_overlap_fraction(part_box) < kXOverlapTh) {
1247 if (skipped_min_top > part_box.top()) {
1248 skipped_min_top = part_box.
top();
1250 if (skipped_max_bottom < part_box.bottom()) {
1251 skipped_max_bottom = part_box.bottom();
1266 for (
int i = 0; i < parts.
size(); i++) {
1267 const TBOX& part_box(parts[i]->bounding_box());
1268 if ((search_bottom && part_box.
top() <= skipped_max_bottom) ||
1269 (!search_bottom && part_box.
bottom() >= skipped_min_top)) {
1279 const TBOX& part_box)
const {
1280 const int kXGapTh =
static_cast<int>(roundf(0.25 *
resolution_));
1281 const int kYGapTh =
static_cast<int>(roundf(0.05 *
resolution_));
1291 part_box.
y_gap(seed_box) > kYGapTh) &&
1293 part_box.
x_gap(seed_box) > kXGapTh)) {
1329 if (text_parts.
empty()) {
1334 text_parts.
sort(&SortCPByHeight);
1335 const TBOX& text_box = text_parts[text_parts.
size() / 2]->bounding_box();
1336 int med_height = text_box.
height();
1337 if (text_parts.
size() % 2 == 0 && text_parts.
size() > 1) {
1338 const TBOX& text_box =
1339 text_parts[text_parts.
size() / 2 - 1]->bounding_box();
1340 med_height =
static_cast<int>(roundf(
1341 0.5 * (text_box.
height() + med_height)));
1345 for (
int i = 0; i < text_parts.
size(); ++i) {
1346 const TBOX& text_box(text_parts[i]->bounding_box());
1347 if (text_box.
height() > med_height) {
1358 for (
int j = 0; j < math_blocks.
size(); ++j) {
1360 text_parts[i]->Absorb(math_blocks[j], NULL);
1369 math_blocks->
clear();
1373 int y_gaps[2] = {INT_MAX, INT_MAX};
1375 int neighbors_left = INT_MAX, neighbors_right = 0;
1376 for (
int i = 0; i < 2; ++i) {
1379 const TBOX& neighbor_box = neighbors[i]->bounding_box();
1380 y_gaps[i] = neighbor_box.
y_gap(part_box);
1381 if (neighbor_box.
left() < neighbors_left) {
1382 neighbors_left = neighbor_box.
left();
1384 if (neighbor_box.
right() > neighbors_right) {
1385 neighbors_right = neighbor_box.
right();
1389 if (neighbors[0] == neighbors[1]) {
1391 neighbors[1] = NULL;
1392 y_gaps[1] = INT_MAX;
1396 if (part_box.left() < neighbors_left || part_box.right() > neighbors_right) {
1401 int index = y_gaps[0] < y_gaps[1] ? 0 : 1;
1405 math_blocks->
push_back(neighbors[index]);
1414 math_blocks->
push_back(neighbors[index]);
1423 ColPartition *nearest_neighbor = NULL, *neighbor = NULL;
1424 const int kYGapTh =
static_cast<int>(roundf(
resolution_ * 0.5));
1427 search.SetUniqueMode(
true);
1429 int y = search_bottom ? part_box.
bottom() : part_box.top();
1430 search.StartVerticalSearch(part_box.left(), part_box.right(), y);
1431 int min_y_gap = INT_MAX;
1432 while ((neighbor =
search.NextVerticalSearch(search_bottom)) != NULL) {
1436 const TBOX& neighbor_box(neighbor->bounding_box());
1437 int y_gap = neighbor_box.
y_gap(part_box);
1438 if (y_gap > kYGapTh) {
1441 if (!neighbor_box.major_x_overlap(part_box) ||
1442 (search_bottom && neighbor_box.bottom() > part_box.bottom()) ||
1443 (!search_bottom && neighbor_box.top() < part_box.top())) {
1446 if (y_gap < min_y_gap) {
1448 nearest_neighbor = neighbor;
1452 return nearest_neighbor;
1460 const int kYGapTh =
static_cast<int>(roundf(
resolution_ * 0.1));
1465 STRING* image_name)
const {
1468 snprintf(page,
sizeof(page),
"%04d",
page_count_);
1474 pix = pixConvertTo32(pixBi);
1479 BLOBNBOX_C_IT blob_it(part->
boxes());
1480 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
1485 pixWrite(outfile.
string(), pix, IFF_TIFF_LZW);
1492 gsearch.StartFullSearch();
1494 while ((part = gsearch.NextFullSearch()) != NULL) {
1496 Box *box = boxCreate(tbox.
left(), pixGetHeight(pix) - tbox.
top(),
1499 pixRenderBoxArb(pix, box, 5, 255, 0, 0);
1501 pixRenderBoxArb(pix, box, 5, 0, 255, 0);
1503 pixRenderBoxArb(pix, box, 5, 0, 0, 255);
1508 pixWrite(outfile.
string(), pix, IFF_TIFF_LZW);
1516 tprintf(
"Printing special blobs density values for ColParition (t=%d,b=%d) ",
1517 h - box.top(), h - box.bottom());
void ExpandSeedVertical(const bool search_bottom, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
const TBOX & bounding_box() const
void set_flow(BlobTextFlowType f)
bool y_overlap(const TBOX &box) const
bool CheckSeedDensity(const float math_density_high, const float math_density_low, const ColPartition *part) const
double x_overlap_fraction(const TBOX &box) const
int source_resolution() const
const int kBlnBaselineOffset
bool get_isalpha(UNICHAR_ID unichar_id) const
bool IsTextOrEquationType(PolyBlockType type)
int IntCastRounded(double x)
const int kSeedBlobsCountTh
bool IsVerticalType() const
ColPartitionGrid * part_grid_
const int kLeftIndentAlignmentCountTh
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)
void ExpandSeedHorizontal(const bool search_left, ColPartition *seed, GenericVector< ColPartition *> *parts_to_merge)
BlobSpecialTextType EstimateTypeForUnichar(const UNICHARSET &unicharset, const UNICHAR_ID id) const
PolyBlockType type() const
void SplitCPHor(ColPartition *part, GenericVector< ColPartition *> *parts_splitted)
IndentType IsIndented(ColPartition *part)
float SpecialBlobsDensity(const BlobSpecialTextType type) const
const float kMathDigitDensityTh2
int FindEquationParts(ColPartitionGrid *part_grid, ColPartitionSet **best_columns)
static void RenderSpecialText(Pix *pix, BLOBNBOX *blob)
float ComputeForegroundDensity(const TBOX &tbox)
void SearchByOverlap(ColPartition *seed, GenericVector< ColPartition *> *parts_overlap)
const float kMathItalicDensityTh
bool IsNearMathNeighbor(const int y_gap, const ColPartition *neighbor) const
TBOX bounding_box() const
bool CheckSeedNeighborDensity(const ColPartition *part) const
int CountAlignment(const GenericVector< int > &sorted_vec, const int val) const
bool get_ispunctuation(UNICHAR_ID unichar_id) const
void Absorb(ColPartition *other, WidthCallback *cb)
UNICHAR_ID unichar_id() const
GenericVector< ColPartition * > cp_seeds_
bool PTIsTextType(PolyBlockType type)
LIST search(LIST list, void *key, int_compare is_equal)
bool major_x_overlap(const TBOX &box) const
int y_gap(const TBOX &box) const
void SetResolution(const int resolution)
void PaintColParts(const STRING &outfile) const
const char * string() const
void PrintSpecialBlobsDensity(const ColPartition *part) const
bool joined_to_prev() const
int EstimateTextPartLineSpacing()
void RemoveBBox(BBC *bbox)
void ComputeCPsSuperBBox()
bool CheckForSeed2(const GenericVector< int > &indented_texts_left, const float foreground_density_th, ColPartition *part)
int SpecialBlobsCount(const BlobSpecialTextType type)
const float kMathDigitDensityTh1
BLOBNBOX_LIST large_blobs
void AdaptiveClassifier(TBLOB *Blob, BLOB_CHOICE_LIST *Choices)
void MergePartsByLocation()
void SetPartitionType(int resolution, ColPartitionSet *columns)
bool equationdetect_save_seed_image
void delete_data_pointers()
bool equationdetect_save_merged_image
void SetLangTesseract(Tesseract *lang_tesseract)
int x_gap(const TBOX &box) const
int LabelSpecialText(TO_BLOCK *to_block)
bool ExpandSeed(ColPartition *seed)
UNICHAR_ID TESS_API unichar_to_id(const char *const unichar_repr) const
ColPartitionSet ** best_columns_
const float kUnclearDensityTh
bool IsMathBlockSatellite(ColPartition *part, GenericVector< ColPartition *> *math_blocks)
BOOL8 contains(const char c) const
int classify_integer_matcher_multiplier
void GridCoords(int x, int y, int *grid_x, int *grid_y) const
void PaintSpecialTexts(const STRING &outfile) const
int classify_class_pruner_multiplier
ColPartition * CopyButDontOwnBlobs()
bool CheckSeedFgDensity(const float density_th, ColPartition *part)
static TBLOB * PolygonalCopy(bool allow_detailed_fx, C_BLOB *src)
void IdentifySpecialText()
void InsertPartAfterAbsorb(ColPartition *part)
void InsertBBox(bool h_spread, bool v_spread, BBC *bbox)
BlobSpecialTextType special_text_type() const
int binary_search(const T &target) const
bool IsInline(const bool search_bottom, const int textPartsLineSpacing, ColPartition *part)
void IdentifyBlobsToSkip(ColPartition *part)
void set_special_text_type(BlobSpecialTextType new_type)
bool equationdetect_save_spt_image
inT16 fontinfo_id() const
void IdentifyInlineParts()
bool get_isdigit(UNICHAR_ID unichar_id) const
EquationDetect(const char *equ_datapath, const char *equ_language)
UnicityTable< FontInfo > & get_fontinfo_table()
BlobTextFlowType flow() const
bool IsLeftIndented(const EquationDetect::IndentType type)
bool IsRightIndented(const EquationDetect::IndentType type)
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)
ColPartition * SearchNNVertical(const bool search_bottom, const ColPartition *part)
bool IsNearSmallNeighbor(const TBOX &seed_box, const TBOX &part_box) const
void IdentifyInlinePartsHorizontal()
const char * id_to_unichar(UNICHAR_ID id) const
void set_blob_type(BlobRegionType t)
const TBOX & bounding_box() const
void ProcessMathBlockSatelliteParts()
ColPartition * SplitAt(int split_x)
#define BOOL_VAR(name, val, comment)
BlobRegionType blob_type() const
bool CheckSeedBlobsCount(ColPartition *part)
bool major_y_overlap(const TBOX &box) const
void GetOutputTiffName(const char *name, STRING *image_name) const
void IdentifyInlinePartsVertical(const bool top_to_bottom, const int textPartsLineSpacing)
void set_type(PolyBlockType t)
void RepositionIterator()
void SplitCPHorLite(ColPartition *part, GenericVector< TBOX > *splitted_boxes)
bool equationdetect_save_bi_image
bool bool_binary_search(const T &target) const
void ComputeSpecialBlobsDensity()
Tesseract * lang_tesseract_