---
scribo/ChangeLog | 5 +++++
scribo/src/text_in_picture.cc | 22 +++++++++++++---------
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index a67d6ad..81ed8ac 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,10 @@
2013-04-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * scribo/src/text_in_picture.cc: Add more debug options fix return
+ value in main().
+
+2013-04-25 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/toolchain/internal/text_in_picture_functor.hh: Rename
debug outputs.
diff --git a/scribo/src/text_in_picture.cc b/scribo/src/text_in_picture.cc
index 64e1462..eb3b65a 100644
--- a/scribo/src/text_in_picture.cc
+++ b/scribo/src/text_in_picture.cc
@@ -27,7 +27,7 @@
#include <libgen.h>
#include <iostream>
-#include <mln/io/magick/load.hh>
+#include <mln/io/magick/all.hh>
#include <scribo/toolchain/text_in_picture.hh>
#include <scribo/debug/option_parser.hh>
@@ -47,6 +47,8 @@ static const scribo::debug::toggle_data toggle_desc[] =
// name, description, default value
{ "fg-extraction", "Detect and slit foreground/background components.
(default: disabled)", false },
{ "ms-bin", "Use a multi-scale binarization. (default: enabled)",
true },
+ { "alternate-results", "Save debug images with all the text bboxes.
(default: disabled)", false },
+ { "debug", "Enable debug outputs (default: disabled).", false },
{0, 0, false}
};
@@ -77,10 +79,10 @@ int main(int argc, char* argv[])
return 1;
if (options.is_set("debug-prefix"))
- {
scribo::debug::logger().set_filename_prefix(options.opt_value("debug-prefix").c_str());
+
+ if (options.is_enabled("debug"))
scribo::debug::logger().set_level(scribo::debug::All);
- }
mln_trace("main");
@@ -93,6 +95,9 @@ int main(int argc, char* argv[])
bool multi_scale_bin = options.is_enabled("ms-bin");
unsigned lambda = atoi(options.opt_value("lambda").c_str());
+ if (options.is_enabled("alternate-results"))
+ scribo::debug::logger().set_level(scribo::debug::Results);
+
if (verbose)
std::cout << "Using max_dim_size = " << max_dim_size
<< " - fg_extraction = " << fg_extraction
@@ -105,11 +110,10 @@ int main(int argc, char* argv[])
max_dim_size, lambda, verbose);
- io::ppm::save(mln::labeling::colorize(value::rgb8(),
- comps.labeled_image(),
- comps.nelements()),
- options.arg("output.ppm"));
-
+ io::magick::save(mln::labeling::colorize(value::rgb8(),
+ comps.labeled_image(),
+ comps.nelements()),
+ options.arg("output.ppm"));
- return comps.nelements() != 0;
+ return 0;
}
--
1.7.2.5
Show replies by date