last-svn-commit-829-gf78df6e disabled tesseract, debug functions added

--- scribo/scribo/core/line_set.hh | 1 + scribo/scribo/debug/bboxes_image.hh | 41 ++++++++++++++++++++ .../toolchain/internal/text_in_doc_functor.hh | 4 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/scribo/scribo/core/line_set.hh b/scribo/scribo/core/line_set.hh index bfa9240..92bdd7d 100644 --- a/scribo/scribo/core/line_set.hh +++ b/scribo/scribo/core/line_set.hh @@ -166,6 +166,7 @@ namespace scribo void update_line_data_(const mln::util::array<line_info<L> >& line_data); + void merge(const line_set<L>& lines); private: /// Duplicate the underlying image and create a new line_set. diff --git a/scribo/scribo/debug/bboxes_image.hh b/scribo/scribo/debug/bboxes_image.hh index ca3d646..0ad8570 100644 --- a/scribo/scribo/debug/bboxes_image.hh +++ b/scribo/scribo/debug/bboxes_image.hh @@ -82,6 +82,15 @@ namespace scribo const component_set<L>& comps, const value::rgb8& value); + // Draw text lines and their components + template <typename I, typename L> + inline + mln_ch_value(I, value::rgb8) + bboxes_image_textline(const Image<I>& input, + const line_set<L>& lines, + const value::rgb8& value, + const value::rgb8& comp_value); + # ifndef MLN_INCLUDE_ONLY template <typename I> @@ -155,6 +164,38 @@ namespace scribo return output; } + template <typename I, typename L> + inline + mln_ch_value(I, value::rgb8) + bboxes_image_textline(const Image<I>& input, + const line_set<L>& lines, + const value::rgb8& value, + const value::rgb8& comp_value) + { + trace::entering("scribo::debug::bboxes_image_textline"); + mln_precondition(exact(input).is_valid()); + + mln_ch_value(I, value::rgb8) + output = data::convert(value::rgb8(), input); + + for_all_lines(l, lines) + { + if (! lines(l).is_hidden() + && text::internal::looks_like_a_text_line(lines(l))) + { + mln::draw::box(output, lines(l).bbox(), value); + const mln::util::array<component_id_t>& comps_id = + lines(l).component_ids(); + const component_set<L>& comps = lines.components(); + for (unsigned i = 0; i < comps_id.nelements(); i++) + mln::draw::box(output, comps(comps_id[i]).bbox(), + comp_value); + } + } + + trace::exiting("scribo::debug::bboxes_image_textline"); + return output; + } # endif // ! MLN_INCLUDE_ONLY diff --git a/scribo/scribo/toolchain/internal/text_in_doc_functor.hh b/scribo/scribo/toolchain/internal/text_in_doc_functor.hh index 62074f0..41bb132 100644 --- a/scribo/scribo/toolchain/internal/text_in_doc_functor.hh +++ b/scribo/scribo/toolchain/internal/text_in_doc_functor.hh @@ -47,7 +47,7 @@ # include <scribo/preprocessing/denoise_fg.hh> -# include <scribo/text/recognition.hh> +//# include <scribo/text/recognition.hh> # include <scribo/text/merging.hh> # include <scribo/make/debug_filename.hh> @@ -383,7 +383,7 @@ namespace scribo on_new_progress_label("Recognizing text"); - scribo::text::recognition(lines, ocr_language.c_str()); + // scribo::text::recognition(lines, ocr_language.c_str()); on_progress(); -- 1.5.6.5
participants (1)
-
Coddy Levi