mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-23 18:49:08 +08:00
Abort with error message if OSD is requested with LSTM-only model
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
c9895dbad4
commit
92999505ee
@ -734,10 +734,15 @@ bin_PROGRAMS = tesseract
|
||||
tesseract_SOURCES = src/tesseract.cpp
|
||||
tesseract_CPPFLAGS =
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/arch
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/ccmain
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/ccstruct
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/ccutil
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/classify
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/cutil
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/dict
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/textord
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/viewer
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/wordrec
|
||||
if OPENCL
|
||||
tesseract_CPPFLAGS += -I$(top_srcdir)/src/opencl
|
||||
endif
|
||||
|
@ -39,6 +39,7 @@
|
||||
#endif
|
||||
#include <tesseract/renderer.h>
|
||||
#include "simddetect.h"
|
||||
#include "tesseractclass.h" // for AnyTessLang
|
||||
#include "tprintf.h" // for tprintf
|
||||
|
||||
#ifdef _OPENMP
|
||||
@ -787,6 +788,12 @@ int main(int argc, char **argv) {
|
||||
(api.GetBoolVariable("tessedit_make_boxes_from_boxes", &b) && b) ||
|
||||
(api.GetBoolVariable("tessedit_train_line_recognizer", &b) && b);
|
||||
|
||||
if (api.GetPageSegMode() == tesseract::PSM_OSD_ONLY) {
|
||||
if (!api.tesseract()->AnyTessLang()) {
|
||||
fprintf(stderr, "Error, OSD requires a model for the legacy engine\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
#ifdef DISABLED_LEGACY_ENGINE
|
||||
auto cur_psm = api.GetPageSegMode();
|
||||
auto osd_warning = std::string("");
|
||||
|
Loading…
Reference in New Issue
Block a user