32 #include <mln/core/image/image2d.hh>
34 #include <mln/io/pbm/save.hh>
35 #include <mln/io/magick/load.hh>
37 #include <scribo/toolchain/content_in_doc.hh>
38 #include <scribo/toolchain/text_in_doc_preprocess.hh>
40 #include <scribo/core/document.hh>
42 #include <scribo/debug/usage.hh>
44 #include <scribo/preprocessing/crop_without_localization.hh>
45 #include <scribo/preprocessing/crop.hh>
47 #include <scribo/io/xml/save.hh>
48 #include <scribo/io/img/save.hh>
51 const char *args_desc[][2] =
53 {
"input.*",
"An image." },
54 {
"non_text_comps.pbm",
"Non text components mask." },
55 {
"enable_debug",
"Enable debug image output. Set to 1 or 0." },
56 {
"enable_tabstops",
"Enable tabstops detection. Set to 1 or 0." },
62 int main(
int argc,
char* argv[])
64 using namespace scribo;
67 if (argc != 4 && argc != 3 && argc != 5)
69 "Extract non text components mask/",
70 "input.* non_text_comps.pbm [enable_debug] [enable_tabstops]",
73 std::string out_img = basename(argv[1]);
74 out_img.erase(out_img.size() - 4);
78 if (argc > 3 && atoi(argv[3]))
99 std::string language =
"";
100 bool find_line_seps =
true;
101 bool find_whitespace_seps = (argc > 4 && atoi(argv[4]));
103 std::cout <<
"Running with the following options :"
104 <<
" ocr_language = " << language
105 <<
" | find_lines_seps = " << find_line_seps
106 <<
" | find_whitespace_seps = " << find_whitespace_seps
113 std::cout <<
"Analysing document..." << std::endl;
116 find_line_seps, find_whitespace_seps,
117 !language.empty(), language);
119 std::cout << t << std::endl;