27 #ifndef SCRIBO_TEXT_EXTRACT_LINES_HH
28 # define SCRIBO_TEXT_EXTRACT_LINES_HH
35 # include <mln/core/concept/image.hh>
37 # include <scribo/core/def/lbl_type.hh>
38 # include <scribo/core/line_set.hh>
40 # include <scribo/primitive/extract/components.hh>
42 # include <scribo/primitive/link/merge_double_link.hh>
43 # include <scribo/primitive/link/internal/dmax_width_and_height.hh>
44 # include <scribo/primitive/link/with_single_left_link_dmax_ratio.hh>
45 # include <scribo/primitive/link/with_single_right_link_dmax_ratio.hh>
47 # include <scribo/filter/objects_small.hh>
49 # include <scribo/primitive/group/apply.hh>
50 # include <scribo/primitive/group/from_single_link.hh>
52 # include <scribo/filter/object_links_bbox_h_ratio.hh>
54 # include <scribo/text/merging.hh>
75 template <
typename I,
typename N>
76 line_set<mln_ch_value(I,scribo::def::lbl_type)>
83 template <
typename I,
typename N>
84 line_set<mln_ch_value(I,scribo::def::lbl_type)>
92 line_set<mln_ch_value(L,scribo::def::lbl_type)>
96 # ifndef MLN_INCLUDE_ONLY
99 template <
typename I,
typename N>
100 line_set<mln_ch_value(I,scribo::def::lbl_type)>
108 template <typename I, typename N>
109 line_set<mln_ch_value(I,scribo::def::lbl_type)>
113 mln_trace(
"scribo::text::extract_lines");
115 const I& input =
exact(input_);
116 const N& nbh =
exact(nbh_);
118 mln_precondition(input.is_valid());
119 mln_precondition(nbh.is_valid());
123 scribo::def::lbl_type ncomps;
125 comps = scribo::primitive::extract::
components(input, nbh, ncomps);
131 if (exact(separators).is_valid())
132 comps.add_separators(separators);
134 line_set<mln_ch_value(I,scribo::def::lbl_type)>
141 template <typename L>
142 line_set<mln_ch_value(L,scribo::def::lbl_type)>
145 mln_trace(
"scribo::text::extract_lines");
147 mln_precondition(comps.is_valid());
154 primitive::link::internal::dmax_default(1),
161 primitive::link::internal::dmax_default(1),
170 object_links<L> hratio_filtered_links
176 line_set<L> lines(groups);
182 # endif // ! MLN_INCLUDE_ONLY
188 #endif // ! SCRIBO_TEXT_EXTRACT_LINES_HH