mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 17:07:39 +08:00
Added warning when using different version of Tesseract
This commit is contained in:
@@ -21,12 +21,20 @@
|
|||||||
|
|
||||||
OCR::OCR(Config* config)
|
OCR::OCR(Config* config)
|
||||||
{
|
{
|
||||||
|
const string EXPECTED_TESSERACT_VERSION = "3.03";
|
||||||
|
|
||||||
this->config = config;
|
this->config = config;
|
||||||
|
|
||||||
this->postProcessor = new PostProcess(config);
|
this->postProcessor = new PostProcess(config);
|
||||||
|
|
||||||
tesseract=new TessBaseAPI();
|
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 requires the prefix directory to be set as an env variable
|
||||||
tesseract->Init(config->getTessdataPrefix().c_str(), config->ocrLanguage.c_str() );
|
tesseract->Init(config->getTessdataPrefix().c_str(), config->ocrLanguage.c_str() );
|
||||||
tesseract->SetVariable("save_blob_choices", "T");
|
tesseract->SetVariable("save_blob_choices", "T");
|
||||||
|
Reference in New Issue
Block a user