27 #include <mln/core/image/image2d.hh>
28 #include <mln/value/int_u8.hh>
29 #include <mln/io/magick/all.hh>
30 #include <mln/data/transform.hh>
31 #include <mln/arith/revert.hh>
32 #include <mln/fun/v2v/rgb_to_luma.hh>
33 #include <mln/logical/not.hh>
35 #include <scribo/binarization/otsu.hh>
36 #include <scribo/debug/option_parser.hh>
37 #include <scribo/debug/logger.hh>
41 {
"input.*",
"An image." },
42 {
"output.pbm",
"A binary image." },
51 {
"negate-input",
"Negate input image before binarizing.",
false },
52 {
"negate-output",
"Negate output image before binarizing.",
false },
61 {
"debug-prefix",
"Enable debug image outputs. Prefix image name with that "
62 "given prefix.",
"<prefix>", 0, 1, 0 },
63 {
"verbose",
"Enable verbose mode (mute, time, low, medium, full)",
64 "<mode>", scribo::debug::check_verbose_mode, 1,
"mute" },
70 int main(
int argc,
char *argv[])
76 if (!options.parse(argc, argv))
80 if (options.is_set(
"debug-prefix"))
88 bool verbose = options.is_set(
"verbose");
98 if (options.is_enabled(
"negate-input"))
103 if (options.is_enabled(
"negate-output"))