31 #include <mln/core/image/image2d.hh>
33 #include <mln/io/magick/load.hh>
34 #include <mln/io/pbm/save.hh>
36 #include <mln/value/rgb8.hh>
38 #include <scribo/debug/option_parser.hh>
40 #include <scribo/toolchain/text_in_doc_preprocess.hh>
45 {
"input.*",
"An image." },
46 {
"output.pbm",
"Binary preprocess image." },
55 {
"fg-extraction",
"Detect and slit foreground/background components. (default: disabled)",
false },
64 {
"lambda",
"Set the maximum area of the background objects. It is only useful if fg-extraction is enabled.",
"<size>",
66 {
"verbose",
"Enable verbose mode", 0, 0, 0, 0 },
72 int main(
int argc,
char* argv[])
74 using namespace scribo;
79 if (!options.parse(argc, argv))
85 unsigned lambda = atoi(options.opt_value(
"lambda").c_str());
86 bool fg_extraction = options.is_enabled(
"fg-extraction");
87 bool verbose = options.is_set(
"verbose");
92 lambda, 0.34,
false, verbose);