Updated code for Tesseract 3.0.3

This commit is contained in:
Matt Hill
2014-05-09 18:20:19 -05:00
parent bab899f4fe
commit cbfa90fc84
6 changed files with 64 additions and 9 deletions

View File

@@ -28,14 +28,8 @@ OCR::OCR(Config* config)
tesseract=new TessBaseAPI();
// Tesseract requires the prefix directory to be set as an env variable
vector<char> tessdataPrefix(config->getTessdataPrefix().size() + 1);
strcpy(tessdataPrefix.data(), config->getTessdataPrefix().c_str());
putenv(tessdataPrefix.data());
tesseract->Init("", config->ocrLanguage.c_str() );
tesseract->Init(config->getTessdataPrefix().c_str(), config->ocrLanguage.c_str() );
tesseract->SetVariable("save_blob_choices", "T");
//tesseract->SetVariable("tessedit_char_whitelist", "ABCDEFGHIJKLMNPQRSTUVWXYZ1234567890");
tesseract->SetPageSegMode(PSM_SINGLE_CHAR);
}