* scribo/primitive/extract/lines_h_pattern.hh,
* scribo/primitive/extract/lines_v_pattern.hh: Here.
---
scribo/ChangeLog | 7 +++++++
scribo/scribo/primitive/extract/lines_h_pattern.hh | 12 +++++++-----
scribo/scribo/primitive/extract/lines_v_pattern.hh | 11 +++++++----
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index cddcb15..905d53f 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,12 @@
2013-03-06 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix wrong line reconstruction with lines_*_pattern routines.
+
+ * scribo/primitive/extract/lines_h_pattern.hh,
+ * scribo/primitive/extract/lines_v_pattern.hh: Here.
+
+2013-03-06 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add more tests for lines_*_discontinued routines.
* tests/primitive/extract/Makefile.am: New targets.
diff --git a/scribo/scribo/primitive/extract/lines_h_pattern.hh
b/scribo/scribo/primitive/extract/lines_h_pattern.hh
index 3cedf53..ecfea5f 100644
--- a/scribo/scribo/primitive/extract/lines_h_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_h_pattern.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -44,7 +44,6 @@
# include <scribo/primitive/internal/rd.hh>
-
namespace scribo
{
@@ -106,10 +105,13 @@ namespace scribo
mln_concrete(I) output = lines_pattern(input, length, 1, win);
+ unsigned hl = length;
+ if (! (hl % 2))
+ ++hl;
+ win::rectangle2d w(delta, hl);
+
mln_concrete(I)
- output_dil = morpho::dilation(output,
- win::rectangle2d(2 * delta + 1,
- length + 2));
+ output_dil = morpho::dilation(output, w);
output = scribo::primitive::internal::rd(output, input * output_dil);
diff --git a/scribo/scribo/primitive/extract/lines_v_pattern.hh
b/scribo/scribo/primitive/extract/lines_v_pattern.hh
index 2908c8b..df5ee4c 100644
--- a/scribo/scribo/primitive/extract/lines_v_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_v_pattern.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -88,10 +88,13 @@ namespace scribo
mln_concrete(I) output = lines_pattern(input, length, 0, win);
+ unsigned vl = length;
+ if (! (vl % 2))
+ ++vl;
+ win::rectangle2d w(vl, delta);
+
mln_concrete(I)
- output_dil = morpho::dilation(output,
- win::rectangle2d(2 * delta + 1,
- length + 2));
+ output_dil = morpho::dilation(output, w);
output = scribo::primitive::internal::rd(output, input * output_dil);
--
1.7.2.5