This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch coddy has been updated
via 9a5768720038f180173bc7c600fdf6b77bbfe7ab (commit)
from f78df6e36baadcfbce50bb22a0cf84fa86ed750f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
9a57687 2011-05-25 Coddy Levi <levi(a)lrde.epita.fr>
-----------------------------------------------------------------------
Summary of changes:
scribo/ChangeLog | 6 +
scribo/scribo/inverse_video/handle_collisions.hh | 196 ++++++++++++++++++++++
2 files changed, 202 insertions(+), 0 deletions(-)
create mode 100644 scribo/scribo/inverse_video/handle_collisions.hh
hooks/post-receive
--
Olena, a generic and efficient image processing platform
New algorithm to detect superpositions between two line sets.
* scribo/inverse_video/handle_collisions.hh: New.
---
scribo/ChangeLog | 6 +
scribo/scribo/inverse_video/handle_collisions.hh | 196 ++++++++++++++++++++++
2 files changed, 202 insertions(+), 0 deletions(-)
create mode 100644 scribo/scribo/inverse_video/handle_collisions.hh
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 048a289..e868468 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-25 Coddy Levi <levi(a)lrde.epita.fr>
+
+ New algorithm to detect superpositions between two line sets.
+
+ * scribo/inverse_video/handle_collisions.hh: New.
+
2011-03-22 Guillaume Lazzara <z(a)lrde.epita.fr>
* demo/viewer/xml_widget.cc: Fix a warning.
diff --git a/scribo/scribo/inverse_video/handle_collisions.hh b/scribo/scribo/inverse_video/handle_collisions.hh
new file mode 100644
index 0000000..54e585c
--- /dev/null
+++ b/scribo/scribo/inverse_video/handle_collisions.hh
@@ -0,0 +1,196 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_INVERSE_VIDEO_HANDLE_COLLISIONS_HH
+# define SCRIBO_INVERSE_VIDEO_HANDLE_COLLISIONS_HH
+
+# include <set>
+# include <vector>
+# include <iostream>
+
+# include <mln/data/fill.hh>
+# include <mln/core/image/image2d.hh>
+# include <mln/util/array.hh>
+# include <scribo/core/line_set.hh>
+# include <mln/draw/box.hh>
+# include <mln/literal/colors.hh>
+
+namespace scribo
+{
+
+ namespace inverse_video
+ {
+
+ template <typename I,
+ typename L,
+ typename F>
+ void
+ handle_collisions(const image2d<I>& input,
+ scribo::line_set<L>& ls1,
+ scribo::line_set<L>& ls2,
+ F choose);
+
+# ifndef MLN_INCLUDE_ONLY
+
+ namespace internal
+ {
+ template <typename L>
+ struct order_2_lines_id
+ {
+ order_2_lines_id(const scribo::line_set<L>& ls1,
+ const scribo::line_set<L>& ls2)
+ : ls1_(ls1),
+ ls2_(ls2)
+ {
+ ls1_size_ = ls1_.nelements();
+ }
+
+ bool operator()(const scribo::line_id_t& a,
+ const scribo::line_id_t& b)
+ {
+ const scribo::line_info<L>& la =
+ (a > ls1_size_ ? ls2_(a - ls1_size_ + 1) : ls1_(a));
+ const scribo::line_info<L>& lb =
+ (b > ls1_size_ ? ls2_(b - ls1_size_ + 1) : ls1_(b));
+
+ return la.bbox().nsites() < lb.bbox().nsites();
+ }
+
+ unsigned ls1_size_;
+ const scribo::line_set<L>& ls1_;
+ const scribo::line_set<L>& ls2_;
+ };
+ } // end of namespace scribo::text::internal
+
+ // Facade
+ template <typename I,
+ typename L,
+ typename F>
+ void
+ handle_collisions(image2d<I>& input,
+ scribo::line_set<L>& ls1,
+ scribo::line_set<L>& ls2,
+ F choose)
+ {
+ mln::trace::entering("scribo::inverse_video::handle_collisions");
+
+ mln::image2d<unsigned> billboard(input.domain());
+ mln::data::fill(billboard, 0);
+
+ internal::order_2_lines_id<L> func(ls1, ls2);
+
+ std::vector<scribo::line_id_t> v;
+
+ unsigned ls1_size = ls1.nelements();
+ unsigned n = ls1_size + ls2.nelements();
+ v.reserve(n);
+
+ for (unsigned i = 1; i < n; ++i)
+ v.push_back(i);
+
+ std::sort(v.begin(), v.end(), func);
+
+ for (int i = v.size() - 1; i > 0; --i)
+ {
+ bool inverse_video = (v[i] > ls1_size);
+
+ scribo::line_set<L>& ls = (inverse_video) ? ls2 : ls1;
+ scribo::line_id_t l = (inverse_video) ?
+ (scribo::line_id_t) (v[i] - ls1_size + 1)
+ : v[i];
+
+ if (!scribo::text::internal::looks_like_a_text_line(ls(l))
+ || !ls(l).is_valid())
+ continue;
+
+ unsigned tl, tr, bl, br;
+
+ box2d b = ls(l).bbox();
+
+ tl = billboard(b.pmin());
+ tr = billboard.at_(b.pmin().row(), b.pmax().col());
+ bl = billboard.at_(b.pmax().row(), b.pmin().col());
+ br = billboard(b.pmax());
+
+ std::set<unsigned> labels;
+ labels.insert(tl);
+ labels.insert(tl);
+ labels.insert(bl);
+ labels.insert(br);
+
+ bool chosen = true;
+ for (std::set<unsigned>::const_iterator it = labels.begin();
+ it != labels.end();
+ ++it)
+ {
+ if (*it == 0)
+ continue;
+
+ bool inverse_video_tested = (*it > ls1_size);
+
+ const scribo::line_info<L>& l_tested =
+ (inverse_video_tested ? ls2(*it - ls1_size + 1) : ls1(*it));
+
+ if (!scribo::text::internal::looks_like_a_text_line(l_tested)
+ || !l_tested.is_valid())
+ continue;
+
+ chosen = choose(ls(l), l_tested);
+ /*
+ if (inverse_video != inverse_video_tested)
+ {
+ if (inverse_video_tested)
+ mln::draw::box(input,
+ l_tested.bbox(),
+ mln::literal::blue);
+ else
+ mln::draw::box(input,
+ l_tested.bbox(),
+ mln::literal::green);
+
+ if (inverse_video)
+ mln::draw::box(input,
+ ls(l).bbox(),
+ mln::literal::blue);
+ else
+ mln::draw::box(input,
+ ls(l).bbox(),
+ mln::literal::green);
+ }*/
+ }
+
+ scribo::text::internal::draw_box(billboard, b, v[i]);
+ }
+
+ mln::trace::exiting("scribo::inverse_video::handle_collisions");
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::inverse_video
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_INVERSE_VIDEO_HANDLE_COLLISIONS_HH
--
1.5.6.5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch icdar/hdlac2011 has been updated
via 12da563c7ea1fba00e47b8cdb9adf526421218d2 (commit)
from ebfb6d5d15d50abe54ce41cb88b243c7b03b1935 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
12da563 2011-05-24 Coddy Levi <levi(a)lrde.epita.fr>
-----------------------------------------------------------------------
Summary of changes:
scribo/ChangeLog | 8 +++++++-
scribo/scribo/util/component_outline.hh | 29 +++++++++++++++++++----------
2 files changed, 26 insertions(+), 11 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch icdar/hdlac2011 has been updated
via ebfb6d5d15d50abe54ce41cb88b243c7b03b1935 (commit)
from f8dae9bab9ea4273a4fc426d7a7bbb3a24c4be93 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
ebfb6d5 2011-05-20 Coddy Levi <levi(a)lrde.epita.fr>
-----------------------------------------------------------------------
Summary of changes:
scribo/ChangeLog | 6 ++++++
scribo/scribo/util/component_outline.hh | 21 +++++++++++++--------
2 files changed, 19 insertions(+), 8 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch master has been updated
via 3c76d368389afeb0ef7cab77dbe1901b1bf6ff69 (commit)
from c9b6114cfa70fc440835c55a665a67feca0a1cfa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
3c76d36 Replace img/lena.pgm by "standard" version.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 5 +++++
milena/img/lena.pgm | 3 ++-
2 files changed, 7 insertions(+), 1 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch icdar/hdlac2011 has been updated
via f8dae9bab9ea4273a4fc426d7a7bbb3a24c4be93 (commit)
from 973e5ac6bd3ecea14c6df71aa03a2dd78811b9ea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
f8dae9b Improve results.
-----------------------------------------------------------------------
Summary of changes:
scribo/ChangeLog | 16 +++++++
.../primitive/extract/lines_h_thick_and_thin.hh | 15 ++++++-
scribo/scribo/primitive/extract/non_text_hdoc.hh | 4 ++
scribo/scribo/text/paragraphs.hh | 44 ++++++++++---------
.../toolchain/internal/content_in_hdoc_functor.hh | 15 ++++---
scribo/src/content_in_hdoc.cc | 2 +-
.../src/primitive/extract/lines_thick_and_thin.cc | 2 +-
7 files changed, 67 insertions(+), 31 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform