Merge pull request #1944 from stweil/psm

Allow orientation detection with any traineddata
This commit is contained in:
Egor Pugin 2018-10-04 18:29:45 +03:00 committed by GitHub
commit a86292b111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,11 +367,15 @@ static void ParseArgs(const int argc, char** argv, const char** lang,
*arg_i = i;
if (*pagesegmode == tesseract::PSM_OSD_ONLY) {
// That mode requires osd.traineddata, no other language or script files.
// OSD = orientation and script detection.
if (*lang != nullptr && strcmp(*lang, "osd")) {
fprintf(stderr, "Warning, ignoring -l %s for --psm 0\n", *lang);
// If the user explicitly specifies a language (other than osd)
// or a script, only orientation can be detected.
fprintf(stderr, "Warning, detects only orientation with -l %s\n", *lang);
} else {
// That mode requires osd.traineddata to detect orientation and script.
*lang = "osd";
}
*lang = "osd";
}
if (*outputbase == nullptr && noocr == false) {