Skip to content

Commit

Permalink
mark& block legacy OCR Engine untill it will be removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Feb 18, 2018
1 parent 01f9a7f commit 173ad2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
14 changes: 10 additions & 4 deletions api/tesseractmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ void PrintHelpForPSM() {
void PrintHelpForOEM() {
const char* msg =
"OCR Engine modes:\n"
" 0 Original Tesseract only.\n"
" 0 Original Tesseract only (unsupported).\n"
" 1 Neural nets LSTM only.\n"
" 2 Tesseract + LSTM.\n"
" 2 Tesseract + LSTM (unsupported).\n"
" 3 Default, based on what is available.\n";

printf("%s", msg);
Expand Down Expand Up @@ -308,8 +308,14 @@ void ParseArgs(const int argc, char** argv, const char** lang,
*pagesegmode = static_cast<tesseract::PageSegMode>(atoi(argv[i + 1]));
++i;
} else if (strcmp(argv[i], "--oem") == 0 && i + 1 < argc) {
checkArgValues(atoi(argv[i+1]), "OEM", tesseract::OEM_COUNT);
*enginemode = static_cast<tesseract::OcrEngineMode>(atoi(argv[i + 1]));
int oem = atoi(argv[i + 1]);
checkArgValues(oem, "OEM", tesseract::OEM_COUNT);
if (oem == tesseract::OEM_TESSERACT_ONLY ||
oem == tesseract::OEM_TESSERACT_LSTM_COMBINED) {
printf("Legacy OCR Engine is not supported anymore.\n");
exit(2);
}
*enginemode = static_cast<tesseract::OcrEngineMode>(oem);
++i;
} else if (strcmp(argv[i], "--print-parameters") == 0) {
noocr = true;
Expand Down
3 changes: 2 additions & 1 deletion ccstruct/publictypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,11 @@ enum ParagraphJustification {
* mention the connection to OcrEngineMode in the comments.
*/
enum OcrEngineMode {
OEM_TESSERACT_ONLY, // Run Tesseract only - fastest
OEM_TESSERACT_ONLY, // Run Tesseract only - fastest; deprecated
OEM_LSTM_ONLY, // Run just the LSTM line recognizer.
OEM_TESSERACT_LSTM_COMBINED, // Run the LSTM recognizer, but allow fallback
// to Tesseract when things get difficult.
// deprecated
OEM_DEFAULT, // Specify this mode when calling init_*(),
// to indicate that any of the above modes
// should be automatically inferred from the
Expand Down

0 comments on commit 173ad2b

Please sign in to comment.