Merge pull request #3120 from amitdo/legacy

Improve disabled legacy engine build
This commit is contained in:
zdenop 2020-10-10 11:06:46 +02:00 committed by GitHub
commit e5d6e90440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 4 deletions

View File

@ -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
@ -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

View File

@ -12,7 +12,7 @@ man_MANS = \
set_unicharset_properties.1 \
tesseract.1 \
text2image.1 \
unicharambigs.5 \
unicharset.5 \
unicharset_extractor.1 \
wordlist2dawg.1
@ -23,7 +23,7 @@ man_MANS += \
cntraining.1 \
mftraining.1 \
shapeclustering.1 \
unicharset.5
unicharambigs.5
endif
man_xslt = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl

View File

@ -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, ...

View File

@ -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"
@ -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,

View File

@ -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

View File

@ -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"
@ -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());
@ -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 /////////////////////////

View File

@ -115,7 +115,9 @@ AM_CPPFLAGS += -isystem $(top_srcdir)/googletest/googletest/include \
check_PROGRAMS = apiexample_test
if ENABLE_TRAINING
if !DISABLED_LEGACY_ENGINE
check_PROGRAMS += applybox_test
endif # !DISABLED_LEGACY_ENGINE
check_PROGRAMS += baseapi_test
if TENSORFLOW
check_PROGRAMS += baseapi_thread_test
@ -141,8 +143,8 @@ check_PROGRAMS += heap_test
check_PROGRAMS += imagedata_test
if !DISABLED_LEGACY_ENGINE
check_PROGRAMS += indexmapbidi_test
endif # !DISABLED_LEGACY_ENGINE
check_PROGRAMS += intfeaturemap_test
endif # !DISABLED_LEGACY_ENGINE
check_PROGRAMS += intsimdmatrix_test
check_PROGRAMS += lang_model_test
check_PROGRAMS += layout_test
@ -155,7 +157,9 @@ check_PROGRAMS += lstm_test
check_PROGRAMS += lstmtrainer_test
endif # ENABLE_TRAINING
check_PROGRAMS += loadlang_test
if !DISABLED_LEGACY_ENGINE
check_PROGRAMS += mastertrainer_test
endif # !DISABLED_LEGACY_ENGINE
check_PROGRAMS += matrix_test
if TENSORFLOW
check_PROGRAMS += networkio_test
@ -164,7 +168,9 @@ if ENABLE_TRAINING
check_PROGRAMS += normstrngs_test
endif # ENABLE_TRAINING
check_PROGRAMS += nthitem_test
if !DISABLED_LEGACY_ENGINE
check_PROGRAMS += osd_test
endif # !DISABLED_LEGACY_ENGINE
check_PROGRAMS += pagesegmode_test
if ENABLE_TRAINING
if TENSORFLOW
@ -172,14 +178,18 @@ check_PROGRAMS += pango_font_info_test
endif # TENSORFLOW
endif # ENABLE_TRAINING
check_PROGRAMS += paragraphs_test
if !DISABLED_LEGACY_ENGINE
check_PROGRAMS += params_model_test
endif # !DISABLED_LEGACY_ENGINE
check_PROGRAMS += progress_test
check_PROGRAMS += qrsequence_test
check_PROGRAMS += recodebeam_test
check_PROGRAMS += rect_test
check_PROGRAMS += resultiterator_test
check_PROGRAMS += scanutils_test
if !DISABLED_LEGACY_ENGINE
check_PROGRAMS += shapetable_test
endif # !DISABLED_LEGACY_ENGINE
check_PROGRAMS += stats_test
if TENSORFLOW
check_PROGRAMS += stridemap_test
@ -219,8 +229,10 @@ apiexample_test_SOURCES = apiexample_test.cc
apiexample_test_LDFLAGS = $(OPENCL_LDFLAGS) $(LEPTONICA_LIBS)
apiexample_test_LDADD = $(TESS_LIBS) $(LEPTONICA_LIBS)
if !DISABLED_LEGACY_ENGINE
applybox_test_SOURCES = applybox_test.cc
applybox_test_LDADD = $(TRAINING_LIBS) $(LEPTONICA_LIBS)
endif # !DISABLED_LEGACY_ENGINE
baseapi_test_SOURCES = baseapi_test.cc
baseapi_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS) $(LEPTONICA_LIBS)
@ -231,8 +243,10 @@ baseapi_thread_test_LDADD = $(ABSEIL_LIBS)
baseapi_thread_test_LDADD += $(TESS_LIBS) $(LEPTONICA_LIBS)
endif # TENSORFLOW
if !DISABLED_LEGACY_ENGINE
bitvector_test_SOURCES = bitvector_test.cc
bitvector_test_LDADD = $(TRAINING_LIBS)
endif # !DISABLED_LEGACY_ENGINE
cleanapi_test_SOURCES = cleanapi_test.cc
cleanapi_test_LDADD = $(TESS_LIBS)
@ -249,10 +263,12 @@ dawg_test_LDADD = $(TRAINING_LIBS)
denorm_test_SOURCES = denorm_test.cc
denorm_test_LDADD = $(TESS_LIBS)
if !DISABLED_LEGACY_ENGINE
if TENSORFLOW
equationdetect_test_SOURCES = equationdetect_test.cc
equationdetect_test_LDADD = $(TESS_LIBS) $(LEPTONICA_LIBS)
endif # TENSORFLOW
endif # !DISABLED_LEGACY_ENGINE
fileio_test_SOURCES = fileio_test.cc
fileio_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS)
@ -263,11 +279,15 @@ heap_test_LDADD = $(TESS_LIBS)
imagedata_test_SOURCES = imagedata_test.cc
imagedata_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS)
if !DISABLED_LEGACY_ENGINE
indexmapbidi_test_SOURCES = indexmapbidi_test.cc
indexmapbidi_test_LDADD = $(TRAINING_LIBS)
endif # !DISABLED_LEGACY_ENGINE
if !DISABLED_LEGACY_ENGINE
intfeaturemap_test_SOURCES = intfeaturemap_test.cc
intfeaturemap_test_LDADD = $(TRAINING_LIBS)
endif # !DISABLED_LEGACY_ENGINE
intsimdmatrix_test_SOURCES = intsimdmatrix_test.cc
intsimdmatrix_test_LDADD = $(TESS_LIBS)
@ -309,8 +329,10 @@ lstm_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS)
lstmtrainer_test_SOURCES = lstmtrainer_test.cc
lstmtrainer_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS) $(LEPTONICA_LIBS)
if !DISABLED_LEGACY_ENGINE
mastertrainer_test_SOURCES = mastertrainer_test.cc
mastertrainer_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS) $(LEPTONICA_LIBS)
endif # !DISABLED_LEGACY_ENGINE
matrix_test_SOURCES = matrix_test.cc
matrix_test_LDADD = $(TESS_LIBS)
@ -329,8 +351,10 @@ normstrngs_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS) $(ICU_I18N_LIBS) $(ICU_U
nthitem_test_SOURCES = nthitem_test.cc
nthitem_test_LDADD = $(TESS_LIBS)
if !DISABLED_LEGACY_ENGINE
osd_test_SOURCES = osd_test.cc
osd_test_LDADD = $(TESS_LIBS) $(LEPTONICA_LIBS)
endif # !DISABLED_LEGACY_ENGINE
pagesegmode_test_SOURCES = pagesegmode_test.cc
pagesegmode_test_LDADD = $(TRAINING_LIBS) $(LEPTONICA_LIBS)
@ -348,8 +372,10 @@ endif # TENSORFLOW
paragraphs_test_SOURCES = paragraphs_test.cc
paragraphs_test_LDADD = $(ABSEIL_LIBS) $(TESS_LIBS)
if !DISABLED_LEGACY_ENGINE
params_model_test_SOURCES = params_model_test.cc
params_model_test_LDADD = $(TRAINING_LIBS)
endif # !DISABLED_LEGACY_ENGINE
progress_test_SOURCES = progress_test.cc
progress_test_LDFLAGS = $(OPENCL_LDFLAGS) $(LEPTONICA_LIBS)
@ -371,8 +397,10 @@ resultiterator_test_LDADD += $(LEPTONICA_LIBS) $(ICU_I18N_LIBS) $(ICU_UC_LIBS)
scanutils_test_SOURCES = scanutils_test.cc
scanutils_test_LDADD = $(TRAINING_LIBS)
if !DISABLED_LEGACY_ENGINE
shapetable_test_SOURCES = shapetable_test.cc
shapetable_test_LDADD = $(ABSEIL_LIBS) $(TRAINING_LIBS)
endif # !DISABLED_LEGACY_ENGINE
stats_test_SOURCES = stats_test.cc
stats_test_LDADD = $(TESS_LIBS)
@ -439,7 +467,9 @@ if T_WIN
apiexample_test_LDADD += -lws2_32
intsimdmatrix_test_LDADD += -lws2_32
matrix_test_LDADD += -lws2_32
if !DISABLED_LEGACY_ENGINE
osd_test_LDADD += -lws2_32
endif # !DISABLED_LEGACY_ENGINE
loadlang_test_LDADD += -lws2_32
endif