---
scribo/ChangeLog | 5 +++++
scribo/demo/viewer/main.cc | 14 ++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index c0f58bb..fb44bec 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * demo/viewer/main.cc: Fix an issue with Tesseract 2.x and
+ specific locales.
+
2011-09-15 Roland Levillain <roland(a)lrde.epita.fr>
Update SCRIBO tests w.r.t. the new version of lena.pgm.
diff --git a/scribo/demo/viewer/main.cc b/scribo/demo/viewer/main.cc
index 0c50c7b..704dfe7 100644
--- a/scribo/demo/viewer/main.cc
+++ b/scribo/demo/viewer/main.cc
@@ -18,6 +18,10 @@
#include <QtGui>
#include <iostream>
+# ifdef HAVE_TESSERACT_2
+#include <clocale>
+# endif // ! HAVE_TESSERACT_2
+
#undef MLN_WO_GLOBAL_VARS
#include "viewer.hh"
#include <mln/labeling/colorize.hh>
@@ -45,5 +49,15 @@ int main(int argc, char** argv)
if (!viewer)
return -1;
+
+# ifdef HAVE_TESSERACT_2
+ // Tesseract 2.x is known to have issues while reading training data
+ // depending on the current locales in use. Training data files use
+ // float data and the decimal separator can be either '.' or ','
+ // causing errors.
+ // Setting locale to "C" fix that issue.
+ setlocale(LC_ALL, "C");
+# endif // ! HAVE_TESSERACT_2
+
return viewer->exec();
}
--
1.7.2.5
Show replies by date