diff options
author | Iliyan Malchev <malchev@google.com> | 2008-09-23 17:27:41 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2008-09-23 17:27:41 -0700 |
commit | 8c545af71f797c57cadc429997c82659a7f1997f (patch) | |
tree | f1733577b6e21094853a9b50cec8b4a032e9a1ea | |
parent | e7dbe054cedbeb9c87953245b4da76bb56040c47 (diff) | |
download | tesseract-8c545af71f797c57cadc429997c82659a7f1997f.tar.gz |
helium: add the ability to set a language
Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r-- | helium/tesseract.cpp | 4 | ||||
-rw-r--r-- | helium/tesseract.h | 2 | ||||
-rw-r--r-- | helium/textrecognition.cpp | 4 | ||||
-rw-r--r-- | helium/textrecognition.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/helium/tesseract.cpp b/helium/tesseract.cpp index b1cd06f..8b00760 100644 --- a/helium/tesseract.cpp +++ b/helium/tesseract.cpp @@ -29,8 +29,8 @@ using namespace helium; const char* kArguments[3] = { "tesseract", "out", "batch" }; -int Tesseract::Init(const char* datapath) { - return api_.Init(datapath, NULL); +int Tesseract::Init(const char* datapath, const char *lang) { + return api_.Init(datapath, lang); } void Tesseract::ReadMask(const Mask& mask, bool flipped) { diff --git a/helium/tesseract.h b/helium/tesseract.h index d29b56e..f92d21d 100644 --- a/helium/tesseract.h +++ b/helium/tesseract.h @@ -38,7 +38,7 @@ class Tesseract { // Call this method exactly once to initialize the Tesseract engine with // the data files at the specified path (This should be the path, that // contains the 'tessdata' folder). - static int Init(const char* datapath); + static int Init(const char* datapath, const char *lang = NULL); // Find the baseline, specified by the offset and slope, for the given // Mask. If flipped is true, this method will flip the image vertically diff --git a/helium/textrecognition.cpp b/helium/textrecognition.cpp index cdb7f7e..5768449 100644 --- a/helium/textrecognition.cpp +++ b/helium/textrecognition.cpp @@ -16,9 +16,9 @@ using namespace helium; bool TextRecognition::recognizer_initialized_ = false; -void TextRecognition::Init(const char* data_path) { +void TextRecognition::Init(const char* data_path, const char *lang) { // Allow reinitialization of Tesseract to get around its adaptation. - Tesseract::Init(data_path); + Tesseract::Init(data_path, lang); recognizer_initialized_ = true; } diff --git a/helium/textrecognition.h b/helium/textrecognition.h index d9db474..53f2233 100644 --- a/helium/textrecognition.h +++ b/helium/textrecognition.h @@ -23,7 +23,7 @@ class TextRecognition { // tessdata directory. // This must be called before using RecognizeUsingBinarizer(...), but it // can be callled multiple times to clear OCR's internal adaptation. - static void Init(const char* data_path); + static void Init(const char* data_path, const char *lang = NULL); // This method passes all the binarized masks, that were extracted by the // specified Binarizer, through perspective correction, and |