Commit 2f05b089 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

src/content_in_doc.cc: Add more options.

parent e07c016a
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.
......
// 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");
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment