
--- scribo/ChangeLog | 4 ++++ scribo/src/content_in_doc.cc | 29 ++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 1bb8769..503f4a5 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,3 +1,7 @@ +2012-11-27 Guillaume Lazzara <z@lrde.epita.fr> + + * src/content_in_doc.cc: Add more options. + 2011-12-06 Guillaume Lazzara <z@lrde.epita.fr> * scribo/text/recognition.hh: Restore previous locale. diff --git a/scribo/src/content_in_doc.cc b/scribo/src/content_in_doc.cc index 0228f30..010a423 100644 --- a/scribo/src/content_in_doc.cc +++ b/scribo/src/content_in_doc.cc @@ -1,5 +1,5 @@ -// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2010, 2011, 2012 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -86,8 +86,15 @@ static const scribo::debug::opt_data opt_desc[] = "fra, deu, ita, nld, por, spa, vie", "<lang>", scribo::debug::check_ocr_lang, 1, "eng" }, { "verbose", "Enable verbose mode", 0, 0, 0, 0 }, - { "xml-format", "Choose betwen page, page-ext (default: page-ext).", "<format>", + { "xml-format", "Choose betwen page, page-ext and full (default: page-ext).", "<format>", scribo::debug::check_xml_format, 1, "page-ext" }, + { "more-xml-format", "Provide an additional xml output. Format can" + " be chosen between page, page-ext and full (default: page-ext).", "<format>", + scribo::debug::check_xml_format, 1, "none" }, + { "more-xml-file", "Filename of the additional xml output.", "<filename>", + 0, 1, "/dev/null" }, + { "debug-regions", "Save a debug image with all the regions.", "<filename>", + 0, 1, "/dev/null" }, {0, 0, 0, 0, 0, 0} }; @@ -175,15 +182,27 @@ int main(int argc, char* argv[]) // Saving results if (verbose) std::cout << "Saving results..." << std::endl; + + // Default XML output if (options.opt_value("xml-format") == "page-ext") scribo::io::xml::save(doc, options.arg("out.xml"), scribo::io::xml::PageExtended); - else if (options.opt_value("xml-format") == "page") + if (options.opt_value("xml-format") == "page") scribo::io::xml::save(doc, options.arg("out.xml"), scribo::io::xml::Page); - else if (options.opt_value("xml-format") == "full") + if (options.opt_value("xml-format") == "full") scribo::io::xml::save(doc, options.arg("out.xml"), scribo::io::xml::Full); + // Additional XML output + if (options.opt_value("more-xml-format") == "page-ext") + scribo::io::xml::save(doc, options.opt_value("more-xml-file"), scribo::io::xml::PageExtended); + if (options.opt_value("more-xml-format") == "page") + scribo::io::xml::save(doc, options.opt_value("more-xml-file"), scribo::io::xml::Page); + if (options.opt_value("more-xml-format") == "full") + scribo::io::xml::save(doc, options.opt_value("more-xml-file"), scribo::io::xml::Full); + if (scribo::debug::logger().is_enabled()) scribo::io::img::save(doc, mln::debug::filename("regions.png"), scribo::io::img::DebugWoImage); + if (options.opt_value("debug-regions") != "/dev/null") + scribo::io::img::save(doc, options.opt_value("debug-regions"), scribo::io::img::DebugWoImage); trace::exiting("main"); } -- 1.7.2.5