27 #include <mln/core/image/image2d.hh>
28 #include <mln/value/int_u8.hh>
29 #include <mln/io/magick/load.hh>
30 #include <mln/io/pbm/save.hh>
31 #include <mln/data/transform.hh>
32 #include <mln/fun/v2v/rgb_to_luma.hh>
34 #include <scribo/binarization/singh.hh>
35 #include <scribo/debug/option_parser.hh>
36 #include <scribo/debug/logger.hh>
40 {
"input.*",
"An image." },
41 {
"output.pbm",
"A binary image." },
58 {
"debug-prefix",
"Enable debug image outputs. Prefix image name with that "
59 "given prefix.",
"<prefix>", 0, 1, 0 },
60 {
"k",
"Singh's formulae parameter",
"<value>", 0, 1,
"0.06" },
61 {
"verbose",
"Enable verbose mode (mute, time, low, medium, full)",
62 "<mode>", scribo::debug::check_verbose_mode, 1,
"mute" },
63 {
"win-size",
"Window size",
"<size>", 0, 1,
"15" },
69 int main(
int argc,
char *argv[])
75 if (!options.parse(argc, argv))
79 if (options.is_set(
"debug-prefix"))
87 unsigned w = atoi(options.opt_value(
"win-size").c_str());
88 double k = atof(options.opt_value(
"k").c_str());