From 0e1d0aae8bac39173ee104cf4f3731a9326fd64d Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 18 May 2014 17:11:16 -0500 Subject: [PATCH] Added warning when using different version of Tesseract --- src/openalpr/ocr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/openalpr/ocr.cpp b/src/openalpr/ocr.cpp index 6545230..6a95596 100644 --- a/src/openalpr/ocr.cpp +++ b/src/openalpr/ocr.cpp @@ -21,12 +21,20 @@ OCR::OCR(Config* config) { + const string EXPECTED_TESSERACT_VERSION = "3.03"; + this->config = config; this->postProcessor = new PostProcess(config); tesseract=new TessBaseAPI(); + if (tesseract->Version() != EXPECTED_TESSERACT_VERSION) + { + std::cerr << "Warning: You are running an unsupported version of Tesseract." << endl; + std::cerr << "Expecting version " << EXPECTED_TESSERACT_VERSION << ", your version is: " << tesseract->Version() << endl; + } + // Tesseract requires the prefix directory to be set as an env variable tesseract->Init(config->getTessdataPrefix().c_str(), config->ocrLanguage.c_str() ); tesseract->SetVariable("save_blob_choices", "T");