Skip to content

Commit

Permalink
Improve disabled legacy engine build
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdo committed Oct 10, 2020
1 parent 50ca49a commit b378ebf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ libtesseract_la_SOURCES += src/arch/simddetect.cpp
# Rules for src/ccmain.

noinst_HEADERS += src/ccmain/control.h
noinst_HEADERS += src/ccmain/equationdetect.h
noinst_HEADERS += src/ccmain/mutableiterator.h
noinst_HEADERS += src/ccmain/output.h
noinst_HEADERS += src/ccmain/paragraphs.h
Expand All @@ -208,6 +207,7 @@ noinst_HEADERS += src/ccmain/tessvars.h
noinst_HEADERS += src/ccmain/werdit.h
if !DISABLED_LEGACY_ENGINE
noinst_HEADERS += src/ccmain/docqual.h
noinst_HEADERS += src/ccmain/equationdetect.h
noinst_HEADERS += src/ccmain/fixspace.h
noinst_HEADERS += src/ccmain/reject.h
endif
Expand Down
2 changes: 2 additions & 0 deletions src/api/baseapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@
#include "edgblob.h" // for extract_edges
#include "elst.h" // for ELIST_ITERATOR, ELISTIZE, ELISTIZEH
#include "environ.h" // for l_uint8
#ifndef DISABLED_LEGACY_ENGINE
#include "equationdetect.h" // for EquationDetect
#endif
#include "errcode.h" // for ASSERT_HOST
#include <tesseract/helpers.h> // for IntCastRounded, chomp_string
#include "imageio.h" // for IFF_TIFF_G4, IFF_TIFF, IFF_TIFF_G3, ...
Expand Down
4 changes: 4 additions & 0 deletions src/ccmain/pagesegmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
#include "blread.h"
#include "colfind.h"
#include "debugpixa.h"
#ifndef DISABLED_LEGACY_ENGINE
#include "equationdetect.h"
#endif
#include "imagefind.h"
#include "linefind.h"
#include "makerow.h"
Expand Down Expand Up @@ -219,9 +221,11 @@ int Tesseract::AutoPageSeg(PageSegMode pageseg_mode, BLOCK_LIST* blocks,
// blocks separately. For now combine with photomask_pix.
pixOr(photomask_pix, photomask_pix, musicmask_pix);
}
#ifndef DISABLED_LEGACY_ENGINE
if (equ_detect_) {
finder->SetEquationDetect(equ_detect_);
}
#endif // ndef DISABLED_LEGACY_ENGINE
result = finder->FindBlocks(pageseg_mode, scaled_color_, scaled_factor_,
to_block, photomask_pix, pix_thresholds_,
pix_grey_, &pixa_debug_, &found_blocks,
Expand Down
2 changes: 2 additions & 0 deletions src/ccmain/tesseractclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@

#include "allheaders.h"
#include "edgblob.h"
#ifndef DISABLED_LEGACY_ENGINE
#include "equationdetect.h"
#endif
#ifndef ANDROID_BUILD
#include "lstmrecognizer.h"
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/textord/colfind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
#include "ccnontextdetect.h"
#include "colpartition.h"
#include "colpartitionset.h"
#ifndef DISABLED_LEGACY_ENGINE
#include "equationdetectbase.h"
#endif
#include "linefind.h"
#include "normalis.h"
#include "strokewidth.h"
Expand Down Expand Up @@ -414,9 +416,11 @@ int ColumnFinder::FindBlocks(PageSegMode pageseg_mode, Pix* scaled_color,
}
#endif
if (!PSM_SPARSE(pageseg_mode)) {
#ifndef DISABLED_LEGACY_ENGINE
if (equation_detect_) {
equation_detect_->FindEquationParts(&part_grid_, best_columns_);
}
#endif
if (textord_tabfind_find_tables) {
TableFinder table_finder;
table_finder.Init(gridsize(), bleft(), tright());
Expand Down Expand Up @@ -506,9 +510,11 @@ void ColumnFinder::GetDeskewVectors(FCOORD* deskew, FCOORD* reskew) {
deskew->set_y(-deskew->y());
}

#ifndef DISABLED_LEGACY_ENGINE
void ColumnFinder::SetEquationDetect(EquationDetectBase* detect) {
equation_detect_ = detect;
}
#endif

//////////////// PRIVATE CODE /////////////////////////

Expand Down

0 comments on commit b378ebf

Please sign in to comment.