Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
29 May '09
* mln/io/pbm/load.hh,
* mln/value/builtin/integers.hh: make them work with ASCII encoded
images.
* tests/io/pbm/Makefile.am,
* tests/io/pgm/Makefile.am: add new tests.
* tests/io/pbm/pbm_ascii.cc,
* tests/io/pgm/pgm_ascii.cc: new tests.
---
milena/ChangeLog | 14 +++++
milena/mln/io/pbm/load.hh | 9 ++--
milena/mln/value/builtin/integers.hh | 9 +++-
milena/tests/io/pbm/Makefile.am | 4 +-
milena/tests/io/pbm/pbm_ascii.cc | 83 +++++++++++++++++++++++++++++
milena/tests/io/pgm/Makefile.am | 2 +
milena/tests/io/pgm/pgm_ascii.cc | 95 ++++++++++++++++++++++++++++++++++
7 files changed, 209 insertions(+), 7 deletions(-)
create mode 100644 milena/tests/io/pbm/pbm_ascii.cc
create mode 100644 milena/tests/io/pgm/pgm_ascii.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 98e1d16..43fe289 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,19 @@
2009-05-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Fix pbm::load and pgm::load with ASCII encoded images.
+
+ * mln/io/pbm/load.hh,
+ * mln/value/builtin/integers.hh: make them work with ASCII encoded
+ images.
+
+ * tests/io/pbm/Makefile.am,
+ * tests/io/pgm/Makefile.am: add new tests.
+
+ * tests/io/pbm/pbm_ascii.cc,
+ * tests/io/pgm/pgm_ascii.cc: new tests.
+
+2009-05-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
* tests/linear/Makefile.am: fix conflict name between gaussian
directory and gaussian test.
diff --git a/milena/mln/io/pbm/load.hh b/milena/mln/io/pbm/load.hh
index 81ad23d..3180c3a 100644
--- a/milena/mln/io/pbm/load.hh
+++ b/milena/mln/io/pbm/load.hh
@@ -93,12 +93,11 @@ namespace mln
mln_fwd_piter(I) p(ima.domain());
for_all(p)
{
- unsigned value;
+ unsigned char value;
file >> value;
- mln_assertion(value == 0 || value == 1);
- ima(p) = (value == 0); // In pbm, '0' means 'white' so 'object', thus 'true'!
- // FIXME: Test alt code below.
- // file >> ima(p);
+
+ mln_assertion(value == '0' || value == '1');
+ ima(p) = (value == '0'); // In pbm, '0' means 'white' so 'object', thus 'true'!
}
}
diff --git a/milena/mln/value/builtin/integers.hh b/milena/mln/value/builtin/integers.hh
index 8e83fe3..efc11d3 100644
--- a/milena/mln/value/builtin/integers.hh
+++ b/milena/mln/value/builtin/integers.hh
@@ -77,7 +77,7 @@ namespace mln
nbits = n,
card = mln_value_card_from_(n)
};
-
+
typedef trait::value::nature::integer nature;
typedef trait::value::kind::data kind;
typedef mln_value_quant_from_(card) quant;
@@ -105,6 +105,13 @@ namespace mln
{ return "signed char"; }
};
+ template <> struct value_< char >
+ : internal::value_integer_< signed char >
+ {
+ static const char* name()
+ { return "char"; }
+ };
+
template <> struct value_< unsigned short >
: internal::value_integer_< unsigned short >
{
diff --git a/milena/tests/io/pbm/Makefile.am b/milena/tests/io/pbm/Makefile.am
index 91d23f0..8649de7 100644
--- a/milena/tests/io/pbm/Makefile.am
+++ b/milena/tests/io/pbm/Makefile.am
@@ -3,8 +3,10 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
- pbm
+ pbm \
+ pbm_ascii
pbm_SOURCES = pbm.cc
+pbm_ascii_SOURCES = pbm_ascii.cc
TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/io/pbm/pbm_ascii.cc b/milena/tests/io/pbm/pbm_ascii.cc
new file mode 100644
index 0000000..72b51a8
--- /dev/null
+++ b/milena/tests/io/pbm/pbm_ascii.cc
@@ -0,0 +1,83 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+/// \file tests/io/pbm/pbm_asci.cc
+///
+/// Test on mln::io::pbm::load and mln::io::pbm::save.
+
+
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/image3d.hh>
+#include <mln/core/routine/duplicate.hh>
+
+#include <mln/value/int_u8.hh>
+
+#include <mln/io/pbm/load.hh>
+#include <mln/io/pbm/save.hh>
+
+#include <mln/level/compare.hh>
+
+#include <mln/literal/colors.hh>
+
+#include "tests/data.hh"
+
+#include <mln/level/convert.hh>
+
+#include <mln/core/image/dmorph/image_if.hh>
+
+#include <mln/make/box2d.hh>
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<bool> lena_raw;
+ io::pbm::load(lena_raw, MLN_TESTS_IMG_DIR "/lena_raw.pbm");
+
+ {
+ image2d<bool> lena_ascii;
+ io::pbm::load(lena_ascii, MLN_TESTS_IMG_DIR "/lena_ascii.pbm");
+
+ mln_assertion(lena_raw == lena_ascii);
+ }
+
+ {
+ image2d<bool> lena_ascii;
+ io::pbm::load(lena_ascii, MLN_TESTS_IMG_DIR "/lena_ascii.pbm");
+ io::pbm::save(lena_ascii, "out.pbm");
+
+ image2d<bool> out;
+ io::pbm::load(out, "out.pbm");
+
+ mln_assertion(out == lena_ascii);
+ mln_assertion(out == lena_raw);
+ }
+
+}
diff --git a/milena/tests/io/pgm/Makefile.am b/milena/tests/io/pgm/Makefile.am
index 929b163..4456e61 100644
--- a/milena/tests/io/pgm/Makefile.am
+++ b/milena/tests/io/pgm/Makefile.am
@@ -6,11 +6,13 @@ check_PROGRAMS = \
pgm16 \
pgm19 \
pgm27 \
+ pgm_ascii \
pgm
pgm16_SOURCES = pgm16.cc
pgm19_SOURCES = pgm19.cc
pgm27_SOURCES = pgm27.cc
+pgm_ascii_SOURCES = pgm_ascii.cc
pgm_SOURCES = pgm.cc
TESTS = $(check_PROGRAMS)
diff --git a/milena/tests/io/pgm/pgm_ascii.cc b/milena/tests/io/pgm/pgm_ascii.cc
new file mode 100644
index 0000000..f80774f
--- /dev/null
+++ b/milena/tests/io/pgm/pgm_ascii.cc
@@ -0,0 +1,95 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+/// \file tests/io/pgm/pgm_asci.cc
+///
+/// Test on mln::io::pgm::load and mln::io::pgm::save.
+
+
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/image3d.hh>
+#include <mln/core/routine/duplicate.hh>
+
+#include <mln/value/int_u8.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+#include <mln/level/compare.hh>
+
+#include <mln/literal/colors.hh>
+
+#include "tests/data.hh"
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<int_u8> lena_raw;
+ io::pgm::load(lena_raw, MLN_TESTS_IMG_DIR "/lena_raw.pgm");
+
+ {
+ image2d<unsigned char> lena_ascii;
+ io::pgm::load(lena_ascii, MLN_TESTS_IMG_DIR "/lena_ascii.pgm");
+ mln_assertion(lena_raw == lena_ascii);
+ }
+ {
+ image2d<unsigned char> lena_ascii;
+ io::pgm::load(lena_ascii, MLN_TESTS_IMG_DIR "/lena_ascii.pgm");
+ io::pgm::save(lena_ascii, "out.pgm");
+
+ image2d<unsigned char> out;
+ io::pgm::load(out, "out.pgm");
+
+ mln_assertion(out == lena_ascii);
+ mln_assertion(lena_raw == out);
+ }
+
+
+
+ {
+ image2d<int_u8> lena_ascii;
+ io::pgm::load(lena_ascii, MLN_TESTS_IMG_DIR "/lena_ascii.pgm");
+ mln_assertion(lena_raw == lena_ascii);
+ }
+ {
+ image2d<int_u8> lena_ascii;
+ io::pgm::load(lena_ascii, MLN_TESTS_IMG_DIR "/lena_ascii.pgm");
+ io::pgm::save(lena_ascii, "out.pgm");
+
+ image2d<unsigned char> out;
+ io::pgm::load(out, "out.pgm");
+
+ mln_assertion(out == lena_ascii);
+ mln_assertion(lena_raw == out);
+ }
+
+}
--
1.5.6.5
1
0
3933: tests/linear/Makefile.am: fix conflict name between gaussian directory and gaussian test.
by Guillaume Lazzara 29 May '09
by Guillaume Lazzara 29 May '09
29 May '09
---
milena/ChangeLog | 5 +++++
milena/tests/linear/Makefile.am | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index b7b4b98..98e1d16 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ * tests/linear/Makefile.am: fix conflict name between gaussian
+ directory and gaussian test.
+
2009-05-29 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Move to trash non-up-to-date image types.
diff --git a/milena/tests/linear/Makefile.am b/milena/tests/linear/Makefile.am
index 1d6e969..b9c9a5d 100644
--- a/milena/tests/linear/Makefile.am
+++ b/milena/tests/linear/Makefile.am
@@ -10,13 +10,13 @@ check_PROGRAMS = \
convolve \
convolve_directional \
convolve_2x1d \
- gaussian \
+ gaussian_ \
lap \
log \
sobel_2d
convolve_SOURCES = convolve.cc
-gaussian_SOURCES = gaussian.cc
+gaussian__SOURCES = gaussian.cc
lap_SOURCES = lap.cc
convolve_directional_SOURCES = convolve_directional.cc
convolve_2x1d_SOURCES = convolve_2x1d.cc
--
1.5.6.5
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
ChangeLog:
2009-05-29 Fabien Freling <fabien.freling(a)lrde.epita.fr>
Plot all points of a specific label.
* fabien/igr/plot_points/int2rgb.hh: Convert a unsigned value
to a rgb8 value, used for visualization.
* fabien/igr/plot_points/plot_points_of_label.cc: Small update.
* fabien/igr/wst_edges.cc: Output watershed dump.
---
plot_points/Makefile | 2 +-
plot_points/int2rgb.hh | 36 ++++++++++++++++++++++++++++++++++++
plot_points/plot_points_of_label.cc | 13 ++++++++++---
wst_edges.cc | 11 ++++++-----
4 files changed, 53 insertions(+), 9 deletions(-)
Index: trunk/milena/sandbox/fabien/igr/wst_edges.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 3931)
+++ trunk/milena/sandbox/fabien/igr/wst_edges.cc (revision 3932)
@@ -5,8 +5,8 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/core/image/image3d.hh>
-#include <mln/core/image/slice_image.hh>
-#include <mln/core/image/image_if.hh>
+#include <mln/core/image/dmorph/slice_image.hh>
+#include <mln/core/image/dmorph/image_if.hh>
#include <mln/core/routine/duplicate.hh>
#include <mln/core/routine/extend.hh>
#include <mln/core/var.hh>
@@ -56,6 +56,8 @@
#include <mln/debug/println.hh>
#include <mln/trace/quiet.hh>
+#include "plot_points/int2rgb.hh"
+
using namespace mln;
using value::int_u8;
@@ -126,7 +128,6 @@
mln_VAR(w_all, wst.unmorph_());
- //io::dump::save(w_all, "watershed_edges.dump");
//data::fill((w | (!world::inter_pixel::is_separator())).rw(), nbasins.next());
mln_VAR(w_pixels, w_all | world::inter_pixel::is_pixel());
data::paste(morpho::dilation(extend(w_pixels, pw::value(w_all)), c4().win()), w_all);
@@ -134,8 +135,8 @@
mln_VAR(w_dots, w_all | world::inter_pixel::dim2::is_dot());
data::paste(morpho::erosion(extend(w_dots, pw::value(w_all)), c4().win()), w_all);
- //io::ppm::save(labeling::colorize(value::rgb8(), w, nbasins.next()), "result.ppm");
- io::pgm::save(labeling::wrap(int_u8(), w_all), "watershed.pgm");
+ io::dump::save(w_all, "watershed.dump");
+ io::ppm::save(debug::int2rgb(w_all), "watershed.ppm");
return 0;
Index: trunk/milena/sandbox/fabien/igr/plot_points/plot_points_of_label.cc
===================================================================
--- trunk/milena/sandbox/fabien/igr/plot_points/plot_points_of_label.cc (revision 3931)
+++ trunk/milena/sandbox/fabien/igr/plot_points/plot_points_of_label.cc (revision 3932)
@@ -41,7 +41,7 @@
// Initialization.
- typedef int_u12 V;
+ typedef float V;
image3d<V> input;
io::dump::load(input, argv[1]);
typedef image2d<util::array<V> > I;
@@ -55,8 +55,15 @@
ima_arr(p).append(tmp_slice(p));
}
+ image2d<label_16> wst;
+ io::dump::load(wst, argv[2]);
image2d<label_16> ima_labels;
- io::dump::load(ima_labels, argv[2]);
+ initialize(ima_labels, ima_arr);
+ mln_piter_(image2d<label_16>) q(ima_labels.domain());
+ for_all(q)
+ {
+ ima_labels(q) = wst.at_(q.row() * 2, q.col() * 2);
+ }
// Plot points.
int origin_x = ima_arr.bbox().pmin()[1];
@@ -69,7 +76,7 @@
int x = p[1] - origin_x;
int y = p[0] - origin_y;
std::ostringstream slabel;
- slabel << "x";
+ slabel << "l" << label << "_x";
if (x < 100)
slabel << "0";
if (x < 10)
Index: trunk/milena/sandbox/fabien/igr/plot_points/int2rgb.hh
===================================================================
--- trunk/milena/sandbox/fabien/igr/plot_points/int2rgb.hh (revision 0)
+++ trunk/milena/sandbox/fabien/igr/plot_points/int2rgb.hh (revision 3932)
@@ -0,0 +1,36 @@
+#include <mln/core/image/image2d.hh>
+#include <mln/value/rgb8.hh>
+
+
+namespace mln
+{
+
+ namespace debug
+ {
+
+ using value::rgb8;
+
+ template <typename V>
+ image2d<rgb8>
+ int2rgb(const image2d<V>& input)
+ {
+ image2d<rgb8> output;
+ initialize(output, input);
+
+ mln_piter(image2d<V>) p(input.domain());
+ for_all(p)
+ {
+ unsigned value = input(p);
+ output(p).blue() = value % 256;
+ value /= 256;
+ output(p).green() = value % 256;
+ value /= 256;
+ output(p).red() = value % 256;
+ }
+
+ return output;
+ }
+
+} // end of namespace mln::debug
+
+} // end of namespace mln
Index: trunk/milena/sandbox/fabien/igr/plot_points/Makefile
===================================================================
--- trunk/milena/sandbox/fabien/igr/plot_points/Makefile (revision 3931)
+++ trunk/milena/sandbox/fabien/igr/plot_points/Makefile (revision 3932)
@@ -4,7 +4,7 @@
${CXX} -I../../../../ ${CXXFLAGS} $^ -o plot_all_points
plot_points_of_label: plot_points_of_label.cc
- ${CXX} -I../../../../ ${CXXFLAGS} $^ -o plot_points_all_label
+ ${CXX} -I../../../../ ${CXXFLAGS} $^ -o plot_points_of_label
clean:
1
0
Re: [Olena-patches] [Olena] #118: Ensure Milena supports separate compilation
by Olena Trac 29 May '09
by Olena Trac 29 May '09
29 May '09
#118: Ensure Milena supports separate compilation
-----------------------+----------------------------------------------------
Reporter: levill_r | Owner: lazzara
Type: defect | Status: closed
Priority: critical | Milestone: Olena 1.0
Component: Milena | Version: 1.0
Resolution: fixed | Keywords: multiple objects separate compilation
-----------------------+----------------------------------------------------
Changes (by lazzara):
* status: new => closed
* resolution: => fixed
Comment:
A new test have been added in r3916.
This test checks that the linker correctly merges global variables in a
multiple-object context.
The test use border::thickness and modify its value.
The test is divided in two files and they are compiled with the same
options. MLN_INCLUDE_ONLY is never defined.
On Linux and MacOS duplicate global symbols seems to be handled correctly.
I consider this ticket currently fixed.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/118#comment:3>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Move to trash non-up-to-date image types.
* mln/core/image/bgraph_image.hh,
* mln/core/image/bgraph_psite.hh,
* mln/core/image/mono_obased_rle_encode.hh,
* mln/core/image/mono_obased_rle_image.hh,
* mln/core/image/mono_rle_encode.hh,
* mln/core/image/mono_rle_image.hh,
* mln/core/image/obased_rle_encode.hh,
* mln/core/image/obased_rle_image.hh,
* mln/core/image/rle_encode.hh,
* mln/core/image/rle_image.hh,
* mln/core/image/sparse_encode.hh,
* mln/core/image/sparse_image.hh,
* mln/core/image/value_enc_image.hh,
* mln/core/image/value_encode.hh,
* tests/core/image/bgraph_image.cc,
* tests/core/image/fi_adaptor.cc,
* tests/core/image/mono_obased_rle_image.cc,
* tests/core/image/mono_rle_image.cc,
* tests/core/image/obased_rle_image.cc,
* tests/core/image/rle_image.cc,
* tests/core/image/sparse_image.cc,
* tests/core/image/value_enc_image.cc: Move...
* trash/bgraph_image.cc,
* trash/bgraph_image.hh,
* trash/bgraph_psite.hh,
* trash/fi_adaptor.cc,
* trash/mono_obased_rle_encode.hh,
* trash/mono_obased_rle_image.cc,
* trash/mono_obased_rle_image.hh,
* trash/mono_rle_encode.hh,
* trash/mono_rle_image.cc,
* trash/mono_rle_image.hh,
* trash/obased_rle_encode.hh,
* trash/obased_rle_image.cc,
* trash/obased_rle_image.hh,
* trash/rle_encode.hh,
* trash/rle_image.cc,
* trash/rle_image.hh,
* trash/sparse_encode.hh,
* trash/sparse_image.cc,
* trash/sparse_image.hh,
* trash/value_enc_image.cc,
* trash/value_enc_image.hh,
* trash/value_encode.hh: ...here.
* tests/core/image/Makefile.am: Remove dead lines.
De-activate code for freeimage since fi_adaptor was trashed.
* mln/core/site_set/status.txt,
* mln/core/image/status.txt: Remove; obsolete.
Makefile.am | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
Index: tests/core/image/Makefile.am
--- tests/core/image/Makefile.am (revision 3930)
+++ tests/core/image/Makefile.am (working copy)
@@ -8,7 +8,6 @@
imorph \
vmorph
-##FIXME: re-enable tests
check_PROGRAMS = \
complex_image \
edge_image \
@@ -20,19 +19,9 @@
line_graph_image \
vertex_image
-## bgraph_image \
-## mono_obased_rle_image \
-## mono_rle_image \
-## obased_rle_image \
-## rle_image \
-## sparse_image \
-## value_enc_image
-
-
noinst_HEADERS = complex_image.hh
-##bgraph_image_SOURCES = bgraph_image.cc
complex_image_SOURCES = complex_image.cc
graph_image_SOURCES = graph_image.cc
flat_image_SOURCES = flat_image.cc
@@ -40,21 +29,15 @@
image2d_SOURCES = image2d.cc
image3d_SOURCES = image3d.cc
line_graph_image_SOURCES = line_graph_image.cc
-##mono_obased_rle_image_SOURCES = mono_obased_rle_image.cc
-##mono_rle_image_SOURCES = mono_rle_image.cc
-##obased_rle_image_SOURCES = obased_rle_image.cc
-##rle_image_SOURCES = rle_image.cc
-##sparse_image_SOURCES = sparse_image.cc
-##value_enc_image_SOURCES = value_enc_image.cc
vertex_image_SOURCES = vertex_image.cc
edge_image_SOURCES = edge_image.cc
# Tests depending on the FreeImagePlus library.
-if FREEIMAGEPLUS
- check_PROGRAMS += fi_adaptor
- fi_adaptor_SOURCES = fi_adaptor.cc
- fi_adaptor_CPPFLAGS = $(AM_CPPFLAGS) $(FREEIMAGEPLUS_CPPFLAGS)
- fi_adaptor_LDFLAGS = $(AM_LDFLAGS) $(FREEIMAGEPLUS_LDFLAGS)
-endif
+#if FREEIMAGEPLUS
+# check_PROGRAMS += fi_adaptor
+# fi_adaptor_SOURCES = fi_adaptor.cc
+# fi_adaptor_CPPFLAGS = $(AM_CPPFLAGS) $(FREEIMAGEPLUS_CPPFLAGS)
+# fi_adaptor_LDFLAGS = $(AM_LDFLAGS) $(FREEIMAGEPLUS_LDFLAGS)
+#endif
TESTS = $(check_PROGRAMS)
1
0
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Propagate update from level to data.
* configure.ac: Propagate update from level to data.
configure.ac | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Index: configure.ac
--- configure.ac (revision 3929)
+++ configure.ac (working copy)
@@ -255,6 +255,8 @@
milena/tests/core/routine/Makefile
milena/tests/core/site_set/Makefile
milena/tests/data/Makefile
+ milena/tests/data/approx/Makefile
+ milena/tests/data/naive/Makefile
milena/tests/debug/Makefile
milena/tests/display/Makefile
milena/tests/draw/Makefile
@@ -287,9 +289,6 @@
milena/tests/io/ppm/Makefile
milena/tests/io/tiff/Makefile
milena/tests/labeling/Makefile
- milena/tests/level/Makefile
- milena/tests/level/approx/Makefile
- milena/tests/level/naive/Makefile
milena/tests/linear/Makefile
milena/tests/linear/gaussian/Makefile
milena/tests/linear/local/Makefile
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix missing remove.
* tests/level/Makefile.am: Remove.
* tests/level: Remove directory.
Makefile.am | 38 --------------------------------------
1 file changed, 38 deletions(-)
Index: tests/level/Makefile.am
--- tests/level/Makefile.am (revision 3928)
+++ tests/level/Makefile.am (working copy)
@@ -1,38 +0,0 @@
-## Process this file through Automake to create Makefile.in.
-
-include $(top_srcdir)/milena/tests/tests.mk
-
-SUBDIRS = approx naive
-
-check_PROGRAMS = \
- abs \
- all_headers \
- apply \
- compare \
- compute \
- convert \
- median \
- median_fast \
- saturate \
- sort_psites \
- stretch \
- transform \
- transform_inplace \
- update
-
-abs_SOURCES = abs.cc
-all_headers_SOURCES = all_headers.cc
-apply_SOURCES = apply.cc
-compare_SOURCES = compare.cc
-compute_SOURCES = compute.cc
-convert_SOURCES = convert.cc
-median_SOURCES = median.cc
-median_fast_SOURCES = median_fast.cc
-saturate_SOURCES = saturate.cc
-sort_psites_SOURCES = sort_psites.cc
-stretch_SOURCES = stretch.cc
-transform_SOURCES = transform.cc
-transform_inplace_SOURCES = transform_inplace.cc
-update_SOURCES = update.cc
-
-TESTS = $(check_PROGRAMS)
1
0
29 May '09
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Rename level/ stuff to data/ and labeling/level to /value.
* mln/labeling/level.hh,
* mln/labeling/level.spe.hh,
* tests/labeling/level.cc: Rename as...
* mln/labeling/value.hh,
* mln/labeling/value.spe.hh,
* tests/labeling/value.cc: ...those.
Update
* mln/labeling/all.hh: Update.
* mln/data/approx,
* tests/data/approx,
* mln/data/naive,
* tests/data/naive: New directories.
* mln/level/update.hh,
* mln/level/apply.hh,
* mln/level/was.median.hh,
* mln/level/compare.hh,
* mln/level/essential.hh,
* mln/level/saturate.hh,
* mln/level/median.hh,
* mln/level/transform.spe.hh,
* mln/level/naive/essential.hh,
* mln/level/naive/all.hh,
* mln/level/naive/median.hh,
* mln/level/abs.hh,
* mln/level/transform_inplace.hh,
* mln/level/to_enc.hh,
* mln/level/all.hh,
* mln/level/fast_median.hh,
* mln/level/approx/essential.hh,
* mln/level/approx/all.hh,
* mln/level/approx/median.hh,
* mln/level/replace.hh,
* mln/level/apply.spe.hh,
* mln/level/transform.hh,
* mln/level/stretch.hh,
* mln/level/compute.hh,
* mln/level/sort_psites.hh,
* mln/level/convert.hh,
* mln/level/sort_offsets.hh: Move to...
* mln/data/update.hh,
* mln/data/was.median.hh,
* mln/data/transform.spe.hh,
* mln/data/to_enc.hh,
* mln/data/transform.hh,
* mln/data/replace.hh,
* mln/data/approx/essential.hh,
* mln/data/approx/all.hh,
* mln/data/approx/median.hh,
* mln/data/apply.spe.hh,
* mln/data/stretch.hh,
* mln/data/sort_offsets.hh,
* mln/data/apply.hh,
* mln/data/compare.hh,
* mln/data/saturate.hh,
* mln/data/median.hh,
* mln/data/naive/essential.hh,
* mln/data/naive/all.hh,
* mln/data/naive/median.hh,
* mln/data/abs.hh,
* mln/data/transform_inplace.hh,
* mln/data/fast_median.hh,
* mln/data/compute.hh,
* mln/data/sort_psites.hh,
* mln/data/convert.hh: ...those new files.
Update.
* mln/data/all.hh,
* mln/data/essential.hh: Update.
* mln/level: Remove this directory.
* mln/all.hh: Update.
* tests/level/median.cc,
* tests/level/transform_full.cc,
* tests/level/compute_full.cc,
* tests/level/stretch_full.cc,
* tests/level/all_headers.cc,
* tests/level/abs.cc,
* tests/level/transform_inplace.cc,
* tests/level/apply_full.cc,
* tests/level/compare_full.cc,
* tests/level/median_fast.cc,
* tests/level/saturate_full.cc,
* tests/level/replace.cc,
* tests/level/transform.cc,
* tests/level/stretch.cc,
* tests/level/compute.cc,
* tests/level/naive,
* tests/level/naive/median.cc,
* tests/level/naive/Makefile.am,
* tests/level/sort_psites.cc,
* tests/level/convert.cc,
* tests/level/update.cc,
* tests/level/approx,
* tests/level/approx/median.cc,
* tests/level/approx/Makefile.am,
* tests/level/apply.cc,
* tests/level/compare.cc,
* tests/level/abs_full.cc,
* tests/level/saturate.cc: Move to...
* tests/data/transform_full.cc,
* tests/data/median.cc,
* tests/data/compute_full.cc,
* tests/data/all_headers.cc,
* tests/data/abs.cc,
* tests/data/transform_inplace.cc,
* tests/data/apply_full.cc,
* tests/data/median_fast.cc,
* tests/data/compute.cc,
* tests/data/sort_psites.cc,
* tests/data/convert.cc,
* tests/data/update.cc,
* tests/data/abs_full.cc,
* tests/data/stretch_full.cc,
* tests/data/compare_full.cc,
* tests/data/saturate_full.cc,
* tests/data/replace.cc,
* tests/data/transform.cc,
* tests/data/stretch.cc,
* tests/data/apply.cc,
* tests/data/compare.cc,
* tests/data/saturate.cc: ...those new files.
Update.
* tests/data/Makefile.am: Update.
* tests/Makefile.am: Update.
Propagate those renamings.
* trash/to_tiles.hh,
* trash/display_save.hh,
* trash/translate_image.cc,
* trash/display_color_pretty.cc,
* trash/save_and_show.cc,
* trash/to_tiles.cc,
* trash/display_color_pretty.hh,
* mln/trait/accumulators.hh,
* mln/debug/superpose.hh,
* mln/world/binary_2d/subsample.hh,
* mln/world/binary_2d/enlarge.hh,
* mln/core/image/imorph/labeled_image.hh,
* mln/core/concept/object.hh,
* mln/arith/min.hh,
* mln/arith/min.spe.hh,
* mln/arith/diff_abs.hh,
* mln/data/approx/essential.hh,
* mln/data/approx/all.hh,
* mln/data/approx/median.hh,
* mln/data/naive/essential.hh,
* mln/data/naive/all.hh,
* mln/data/naive/median.hh,
* mln/linear/sobel_2d.hh,
* mln/linear/gaussian.hh,
* mln/linear/gaussian/impl.hh,
* mln/transform/hough.hh,
* mln/estim/sum.hh,
* mln/estim/min_max.hh,
* mln/estim/mean.hh,
* mln/essential/routine.hh,
* mln/binarization/binarization.hh,
* mln/morpho/watershed/superpose.hh,
* mln/morpho/tree/compute_parent.hh,
* mln/morpho/tree/max.hh,
* mln/morpho/approx/dilation.hh,
* mln/morpho/plus.hh,
* mln/morpho/min.hh,
* mln/morpho/reconstruction/by_erosion/union_find.hh,
* mln/morpho/reconstruction/by_dilation/union_find.hh,
* mln/morpho/minus.hh,
* mln/morpho/complementation.hh,
* mln/morpho/Rd.hh,
* mln/morpho/includes.hh,
* mln/morpho/leveling_filter.hh,
* mln/morpho/algebraic_filter.hh,
* mln/logical/and.hh,
* mln/logical/and_not.hh,
* mln/logical/includes.hh,
* mln/logical/xor.hh,
* mln/logical/not.hh,
* mln/logical/or.hh,
* mln/canvas/morpho/attribute_filter.hh,
* mln/canvas/labeling.hh,
* mln/labeling/colorize.hh,
* mln/labeling/regional_minima.hh,
* mln/labeling/regional_maxima.hh,
* mln/labeling/mean_values.hh,
* mln/labeling/blobs.hh,
* mln/labeling/relabel.hh,
* mln/labeling/wrap.hh,
* mln/labeling/foreground.hh,
* mln/labeling/pack.hh,
* mln/labeling/background.hh,
* mln/util/tree_to_image.hh,
* tools/seed2tiling.cc,
* tests/topo/skeleton/crest.cc,
* tests/debug/iota.cc,
* tests/world/inter_pixel/compute.cc,
* tests/world/inter_pixel/immerse.cc,
* tests/world/inter_pixel/dim2/make_edge_image.cc,
* tests/world/inter_pixel/display_edge.cc,
* tests/world/binary_2d/enlarge.cc,
* tests/core/other/clock_test.cc,
* tests/core/image/sparse_image.cc,
* tests/core/image/obased_rle_image.cc,
* tests/core/image/value_enc_image.cc,
* tests/core/image/plain.cc,
* tests/core/image/dmorph/slice_image.cc,
* tests/core/image/fi_adaptor.cc,
* tests/core/image/mono_rle_image.cc,
* tests/core/image/rle_image.cc,
* tests/core/image/vmorph/cast_image.cc,
* tests/core/image/mono_obased_rle_image.cc,
* tests/draw/graph.cc,
* tests/draw/line.cc,
* tests/opt/at.cc,
* tests/transformation/rotate.cc,
* tests/arith/minus.cc,
* tests/arith/diff_abs.cc,
* tests/arith/times.cc,
* tests/arith/plus.cc,
* tests/arith/revert.cc,
* tests/data/fill_with_image.cc,
* tests/data/approx/median.cc,
* tests/data/paste_full.cc,
* tests/data/paste.cc,
* tests/data/naive/median.cc,
* tests/linear/convolve.cc,
* tests/linear/lap.cc,
* tests/linear/log.cc,
* tests/linear/convolve_directional.cc,
* tests/linear/convolve_2x1d.cc,
* tests/linear/sobel_2d.cc,
* tests/linear/gaussian.cc,
* tests/transform/distance_and_closest_point_geodesic.cc,
* tests/accu/transform_snake.cc,
* tests/accu/image/to_result.cc,
* tests/accu/image/take_n_times.cc,
* tests/accu/image/init.cc,
* tests/accu/image/take.cc,
* tests/accu/image/set_value.cc,
* tests/accu/image/untake.cc,
* tests/accu/image/take_as_init.cc,
* tests/accu/transform_diagonal.cc,
* tests/accu/transform.cc,
* tests/accu/nil.cc,
* tests/accu/transform_line.cc,
* tests/accu/min.cc,
* tests/accu/max.cc,
* tests/accu/line.cc,
* tests/accu/transform_directional.cc,
* tests/make/image3d.cc,
* tests/convert/to_image.cc,
* tests/geom/seed2tiling_roundness.cc,
* tests/geom/seed2tiling.cc,
* tests/fun/v2v/hsl_to_rgb.cc,
* tests/fun/v2v/rgb_to_hsl.cc,
* tests/binarization/threshold.cc,
* tests/morpho/artificial_line_graph_image_wst.cc,
* tests/morpho/watershed/flooding.cc,
* tests/morpho/watershed/superpose.cc,
* tests/morpho/closing/area.cc,
* tests/morpho/tree/compute_attribute_image.cc,
* tests/morpho/tree/filter/filter.cc,
* tests/morpho/tree/compute_parent.cc,
* tests/morpho/tree/max.cc,
* tests/morpho/tree/data.cc,
* tests/morpho/skeleton_constrained.cc,
* tests/morpho/reconstruction/by_erosion/union_find.cc,
* tests/morpho/reconstruction/by_dilation/union_find.cc,
* tests/morpho/rank_filter.cc,
* tests/morpho/lena_line_graph_image_wst2.cc,
* tests/io/pgm/pgm27.cc,
* tests/io/pgm/pgm19.cc,
* tests/io/pgm/pgm.cc,
* tests/io/pgm/pgm16.cc,
* tests/io/fits/fits.cc,
* tests/io/dump/dump.cc,
* tests/io/tiff/load.cc,
* tests/io/tiff/tiff2pbm.cc,
* tests/io/dicom/dicom.cc,
* tests/io/magick/save.cc,
* tests/io/magick/load.cc,
* tests/io/ppm/ppm.cc,
* tests/io/ppm/ppm23.cc,
* tests/io/ppm/ppm16.cc,
* tests/io/pbm/pbm.cc,
* tests/logical/not.cc,
* tests/logical/or.cc,
* tests/logical/and.cc,
* tests/logical/and_not.cc,
* tests/logical/xor.cc,
* tests/canvas/chamfer.cc,
* tests/canvas/browsing/snake_generic_2d_vert.cc,
* tests/canvas/browsing/snake_generic_2d_hori.cc,
* tests/canvas/browsing/snake_generic_3d_vert.cc,
* tests/canvas/browsing/diagonal2d.cc,
* tests/canvas/browsing/snake_generic_3d_hori.cc,
* tests/canvas/browsing/backdiagonal2d.cc,
* tests/labeling/mean_values.cc,
* tests/labeling/n_max.cc,
* tests/labeling/flat_zones.cc,
* tests/labeling/wrap.cc,
* tests/labeling/foreground.cc,
* tests/labeling/pack.cc,
* tests/labeling/Makefile.am,
* tests/labeling/colorize.cc,
* tests/util/tree_to_image.cc,
* tests/util/tree_fast_to_image.cc,
* apps/statues/mesh-max-curv.cc,
* apps/statues/mesh-complex-max-curv.cc,
* doc/benchmark/canvas.cc,
* doc/benchmark/median/median_bench.cc,
* doc/examples/trash/tuto_one.cc,
* doc/examples/trash/labeling_algo.cc,
* doc/examples/trash/tuto_bis.cc,
* doc/examples/trash/graph.cc,
* doc/examples/accu-right-instanciation.cc,
* doc/examples/extend.cc,
* doc/examples/tuto3/first_routine.cc: Propagate renamings.
apps/statues/mesh-complex-max-curv.cc | 6 -
apps/statues/mesh-max-curv.cc | 2
doc/benchmark/canvas.cc | 10 -
doc/benchmark/median/median_bench.cc | 12 +-
doc/examples/accu-right-instanciation.cc | 4
doc/examples/extend.cc | 4
doc/examples/trash/graph.cc | 6 -
doc/examples/trash/labeling_algo.cc | 4
doc/examples/trash/tuto_bis.cc | 4
doc/examples/trash/tuto_one.cc | 4
doc/examples/tuto3/first_routine.cc | 2
mln/all.hh | 8 -
mln/arith/diff_abs.hh | 4
mln/arith/min.hh | 8 -
mln/arith/min.spe.hh | 8 -
mln/binarization/binarization.hh | 4
mln/canvas/labeling.hh | 12 +-
mln/canvas/morpho/attribute_filter.hh | 12 +-
mln/core/concept/object.hh | 2
mln/core/image/imorph/labeled_image.hh | 4
mln/data/abs.hh | 22 ++--
mln/data/all.hh | 20 +++
mln/data/apply.hh | 22 ++--
mln/data/apply.spe.hh | 14 +-
mln/data/approx/all.hh | 10 -
mln/data/approx/essential.hh | 4
mln/data/approx/median.hh | 30 ++---
mln/data/compare.hh | 14 +-
mln/data/compute.hh | 20 +--
mln/data/convert.hh | 30 ++---
mln/data/essential.hh | 9 +
mln/data/fast_median.hh | 8 -
mln/data/median.hh | 26 ++---
mln/data/naive/all.hh | 10 -
mln/data/naive/essential.hh | 4
mln/data/naive/median.hh | 14 +-
mln/data/replace.hh | 18 +--
mln/data/saturate.hh | 28 ++---
mln/data/sort_offsets.hh | 36 +++---
mln/data/sort_psites.hh | 8 -
mln/data/stretch.hh | 22 ++--
mln/data/to_enc.hh | 14 +-
mln/data/transform.hh | 36 +++---
mln/data/transform.spe.hh | 84 ++++++++--------
mln/data/transform_inplace.hh | 88 ++++++++---------
mln/data/update.hh | 32 +++---
mln/data/was.median.hh | 10 -
mln/debug/superpose.hh | 4
mln/essential/routine.hh | 2
mln/estim/mean.hh | 6 -
mln/estim/min_max.hh | 4
mln/estim/sum.hh | 6 -
mln/labeling/all.hh | 2
mln/labeling/background.hh | 8 -
mln/labeling/blobs.hh | 2
mln/labeling/colorize.hh | 8 -
mln/labeling/foreground.hh | 12 +-
mln/labeling/mean_values.hh | 6 -
mln/labeling/pack.hh | 12 +-
mln/labeling/regional_maxima.hh | 2
mln/labeling/regional_minima.hh | 2
mln/labeling/relabel.hh | 8 -
mln/labeling/value.hh | 51 ++++-----
mln/labeling/value.spe.hh | 40 +++----
mln/labeling/wrap.hh | 4
mln/linear/gaussian.hh | 6 -
mln/linear/gaussian/impl.hh | 6 -
mln/linear/sobel_2d.hh | 6 -
mln/logical/and.hh | 4
mln/logical/and_not.hh | 4
mln/logical/includes.hh | 4
mln/logical/not.hh | 4
mln/logical/or.hh | 4
mln/logical/xor.hh | 4
mln/morpho/Rd.hh | 2
mln/morpho/algebraic_filter.hh | 4
mln/morpho/approx/dilation.hh | 2
mln/morpho/complementation.hh | 2
mln/morpho/includes.hh | 2
mln/morpho/leveling_filter.hh | 4
mln/morpho/min.hh | 2
mln/morpho/minus.hh | 2
mln/morpho/plus.hh | 2
mln/morpho/reconstruction/by_dilation/union_find.hh | 6 -
mln/morpho/reconstruction/by_erosion/union_find.hh | 6 -
mln/morpho/tree/compute_parent.hh | 2
mln/morpho/tree/max.hh | 4
mln/morpho/watershed/superpose.hh | 4
mln/trait/accumulators.hh | 2
mln/transform/hough.hh | 4
mln/util/tree_to_image.hh | 2
mln/world/binary_2d/enlarge.hh | 4
mln/world/binary_2d/subsample.hh | 2
tests/Makefile.am | 1
tests/accu/image/init.cc | 2
tests/accu/image/set_value.cc | 2
tests/accu/image/take.cc | 2
tests/accu/image/take_as_init.cc | 2
tests/accu/image/take_n_times.cc | 2
tests/accu/image/to_result.cc | 2
tests/accu/image/untake.cc | 2
tests/accu/line.cc | 2
tests/accu/max.cc | 6 -
tests/accu/min.cc | 6 -
tests/accu/nil.cc | 6 -
tests/accu/transform.cc | 2
tests/accu/transform_diagonal.cc | 2
tests/accu/transform_directional.cc | 2
tests/accu/transform_line.cc | 2
tests/accu/transform_snake.cc | 2
tests/arith/diff_abs.cc | 2
tests/arith/minus.cc | 2
tests/arith/plus.cc | 4
tests/arith/revert.cc | 2
tests/arith/times.cc | 2
tests/binarization/threshold.cc | 2
tests/canvas/browsing/backdiagonal2d.cc | 12 +-
tests/canvas/browsing/diagonal2d.cc | 13 +-
tests/canvas/browsing/snake_generic_2d_hori.cc | 2
tests/canvas/browsing/snake_generic_2d_vert.cc | 2
tests/canvas/browsing/snake_generic_3d_hori.cc | 2
tests/canvas/browsing/snake_generic_3d_vert.cc | 2
tests/canvas/chamfer.cc | 2
tests/convert/to_image.cc | 2
tests/core/image/dmorph/slice_image.cc | 2
tests/core/image/fi_adaptor.cc | 4
tests/core/image/mono_obased_rle_image.cc | 8 -
tests/core/image/mono_rle_image.cc | 8 -
tests/core/image/obased_rle_image.cc | 8 -
tests/core/image/plain.cc | 2
tests/core/image/rle_image.cc | 8 -
tests/core/image/sparse_image.cc | 8 -
tests/core/image/value_enc_image.cc | 10 -
tests/core/image/vmorph/cast_image.cc | 2
tests/core/other/clock_test.cc | 6 -
tests/data/Makefile.am | 36 ++++++
tests/data/abs.cc | 8 -
tests/data/abs_full.cc | 10 -
tests/data/all_headers.cc | 6 -
tests/data/apply.cc | 8 -
tests/data/apply_full.cc | 10 -
tests/data/approx/median.cc | 10 -
tests/data/compare.cc | 6 -
tests/data/compare_full.cc | 8 -
tests/data/compute.cc | 10 -
tests/data/compute_full.cc | 28 ++---
tests/data/convert.cc | 12 +-
tests/data/fill_with_image.cc | 2
tests/data/median.cc | 14 +-
tests/data/median_fast.cc | 8 -
tests/data/naive/median.cc | 8 -
tests/data/paste.cc | 2
tests/data/paste_full.cc | 4
tests/data/replace.cc | 10 -
tests/data/saturate.cc | 8 -
tests/data/saturate_full.cc | 12 +-
tests/data/sort_psites.cc | 10 -
tests/data/stretch.cc | 8 -
tests/data/stretch_full.cc | 12 +-
tests/data/transform.cc | 26 ++---
tests/data/transform_full.cc | 10 -
tests/data/transform_inplace.cc | 36 +++---
tests/data/update.cc | 12 +-
tests/debug/iota.cc | 2
tests/draw/graph.cc | 2
tests/draw/line.cc | 2
tests/fun/v2v/hsl_to_rgb.cc | 6 -
tests/fun/v2v/rgb_to_hsl.cc | 6 -
tests/geom/seed2tiling.cc | 2
tests/geom/seed2tiling_roundness.cc | 2
tests/io/dicom/dicom.cc | 2
tests/io/dump/dump.cc | 2
tests/io/fits/fits.cc | 2
tests/io/magick/load.cc | 2
tests/io/magick/save.cc | 2
tests/io/pbm/pbm.cc | 2
tests/io/pgm/pgm.cc | 2
tests/io/pgm/pgm16.cc | 6 -
tests/io/pgm/pgm19.cc | 8 -
tests/io/pgm/pgm27.cc | 8 -
tests/io/ppm/ppm.cc | 2
tests/io/ppm/ppm16.cc | 2
tests/io/ppm/ppm23.cc | 2
tests/io/tiff/load.cc | 2
tests/io/tiff/tiff2pbm.cc | 4
tests/labeling/Makefile.am | 4
tests/labeling/colorize.cc | 2
tests/labeling/flat_zones.cc | 2
tests/labeling/foreground.cc | 6 -
tests/labeling/mean_values.cc | 2
tests/labeling/n_max.cc | 4
tests/labeling/pack.cc | 2
tests/labeling/value.cc | 8 -
tests/labeling/wrap.cc | 2
tests/linear/convolve.cc | 4
tests/linear/convolve_2x1d.cc | 4
tests/linear/convolve_directional.cc | 4
tests/linear/gaussian.cc | 2
tests/linear/lap.cc | 4
tests/linear/log.cc | 4
tests/linear/sobel_2d.cc | 4
tests/logical/and.cc | 2
tests/logical/and_not.cc | 2
tests/logical/not.cc | 2
tests/logical/or.cc | 2
tests/logical/xor.cc | 2
tests/make/image3d.cc | 2
tests/morpho/artificial_line_graph_image_wst.cc | 2
tests/morpho/closing/area.cc | 6 -
tests/morpho/lena_line_graph_image_wst2.cc | 2
tests/morpho/rank_filter.cc | 4
tests/morpho/reconstruction/by_dilation/union_find.cc | 2
tests/morpho/reconstruction/by_erosion/union_find.cc | 2
tests/morpho/skeleton_constrained.cc | 2
tests/morpho/tree/compute_attribute_image.cc | 4
tests/morpho/tree/compute_parent.cc | 6 -
tests/morpho/tree/data.cc | 4
tests/morpho/tree/filter/filter.cc | 4
tests/morpho/tree/max.cc | 2
tests/morpho/watershed/flooding.cc | 6 -
tests/morpho/watershed/superpose.cc | 2
tests/opt/at.cc | 2
tests/topo/skeleton/crest.cc | 2
tests/transform/distance_and_closest_point_geodesic.cc | 2
tests/transformation/rotate.cc | 2
tests/util/tree_fast_to_image.cc | 4
tests/util/tree_to_image.cc | 4
tests/world/binary_2d/enlarge.cc | 2
tests/world/inter_pixel/compute.cc | 2
tests/world/inter_pixel/dim2/make_edge_image.cc | 2
tests/world/inter_pixel/display_edge.cc | 2
tests/world/inter_pixel/immerse.cc | 2
tools/seed2tiling.cc | 6 -
trash/display_color_pretty.cc | 6 -
trash/display_color_pretty.hh | 8 -
trash/display_save.hh | 4
trash/save_and_show.cc | 4
trash/to_tiles.cc | 22 ++--
trash/to_tiles.hh | 4
trash/translate_image.cc | 8 -
240 files changed, 928 insertions(+), 876 deletions(-)
Index: trash/to_tiles.hh
--- trash/to_tiles.hh (revision 3927)
+++ trash/to_tiles.hh (working copy)
@@ -34,7 +34,7 @@
*/
# include <mln/core/image/translate_image.hh>
-# include <mln/level/paste.hh>
+# include <mln/data/paste.hh>
# include <mln/geom/nrows.hh>
# include <mln/geom/ncols.hh>
@@ -84,7 +84,7 @@
translate_image<I> tr_ima(v_ima[i], dp);
/// Paste translated image into output.
- level::paste(tr_ima, output);
+ data::paste(tr_ima, output);
}
return output;
Index: trash/display_save.hh
--- trash/display_save.hh (revision 3927)
+++ trash/display_save.hh (working copy)
@@ -38,8 +38,8 @@
# include <mln/core/image/image_if.hh>
# include <mln/core/image/image2d.hh>
# include <mln/value/rgb8.hh>
-# include <mln/level/fill.hh>
-# include <mln/level/paste.hh>
+# include <mln/data/fill.hh>
+# include <mln/data/paste.hh>
# include <mln/display/color_pretty.hh>
# include <mln/io/ppm/save.hh>
Index: trash/translate_image.cc
--- trash/translate_image.cc (revision 3927)
+++ trash/translate_image.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
-#include <mln/level/fill.hh>
-#include <mln/level/paste.hh>
+#include <mln/data/fill.hh>
+#include <mln/data/paste.hh>
#include <mln/border/fill.hh>
#include <mln/debug/println_with_border.hh>
#include <mln/debug/println.hh>
@@ -67,8 +67,8 @@
std::cout << std::endl;
I out (4,4);
- level::paste(ima, out);
- level::paste(tmp, out);
+ data::paste(ima, out);
+ data::paste(tmp, out);
std::cout << "pasted image :"
<< std::endl;
debug::println (out);
Index: trash/display_color_pretty.cc
--- trash/display_color_pretty.cc (revision 3927)
+++ trash/display_color_pretty.cc (working copy)
@@ -31,13 +31,13 @@
# include <mln/core/image/image2d.hh>
# include <mln/value/int_u8.hh>
-# include <mln/level/fill.hh>
+# include <mln/data/fill.hh>
# include <mln/core/site_set/p_set.hh>
# include <mln/core/image/sub_image.hh>
# include <mln/value/rgb8.hh>
# include <mln/display/color_pretty.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
int main()
@@ -48,7 +48,7 @@
/// Test on color_pretty.
{
image2d<int_u8> ima (2, 2);
- level::fill (ima, 51);
+ data::fill (ima, 51);
p_set<point2d > s;
s.insert(point2d(0, 0));
Index: trash/save_and_show.cc
--- trash/save_and_show.cc (revision 3927)
+++ trash/save_and_show.cc (working copy)
@@ -42,7 +42,7 @@
#include <mln/display/show.hh>
#include <mln/io/ppm/save.hh>
#include <mln/display/save_and_show.hh>
-#include <mln/level/fill.hh>
+#include <mln/data/fill.hh>
#include "tests/data.hh"
@@ -74,7 +74,7 @@
/// Test with color image.
{
image2d<value::rgb8> ima (100, 100);
- level::fill(ima, value::rgb8 (0, 0, 255));
+ data::fill(ima, value::rgb8 (0, 0, 255));
display::save_and_show (ima, "display", 1);
}
Index: trash/to_tiles.cc
--- trash/to_tiles.cc (revision 3927)
+++ trash/to_tiles.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
-#include <mln/level/fill.hh>
-#include <mln/level/paste.hh>
+#include <mln/data/fill.hh>
+#include <mln/data/paste.hh>
#include <mln/border/fill.hh>
#include <mln/debug/println_with_border.hh>
#include <mln/debug/println.hh>
@@ -49,39 +49,39 @@
std::vector<I> vec;
I ima1 (4, 2, 1);
- level::fill(ima1, 1);
+ data::fill(ima1, 1);
vec.push_back(ima1);
I ima2 (4, 2, 1);
- level::fill(ima2, 2);
+ data::fill(ima2, 2);
vec.push_back(ima2);
I ima3 (4, 2, 1);
- level::fill(ima3, 3);
+ data::fill(ima3, 3);
vec.push_back(ima3);
I ima4 (4, 2, 1);
- level::fill(ima4, 4);
+ data::fill(ima4, 4);
vec.push_back(ima4);
I ima5 (4, 2, 1);
- level::fill(ima5, 5);
+ data::fill(ima5, 5);
vec.push_back(ima5);
I ima6 (4, 2, 1);
- level::fill(ima6, 6);
+ data::fill(ima6, 6);
vec.push_back(ima6);
I ima7 (4, 2, 1);
- level::fill(ima7, 7);
+ data::fill(ima7, 7);
vec.push_back(ima7);
I ima8 (4, 2, 1);
- level::fill(ima8, 8);
+ data::fill(ima8, 8);
vec.push_back(ima8);
I ima9 (4, 2, 1);
- level::fill(ima9, 9);
+ data::fill(ima9, 9);
vec.push_back(ima9);
I output = convert::to_tiles(vec, 1.33333f);
Index: trash/display_color_pretty.hh
--- trash/display_color_pretty.hh (revision 3927)
+++ trash/display_color_pretty.hh (working copy)
@@ -37,8 +37,8 @@
# include <mln/trait/image_from_grid.hh>
# include <mln/core/image/image2d.hh>
# include <mln/value/rgb8.hh>
-# include <mln/level/fill.hh>
-# include <mln/level/paste.hh>
+# include <mln/data/fill.hh>
+# include <mln/data/paste.hh>
# include <mln/core/site_set/p_set.hh>
# include <mln/metal/is_not.hh>
@@ -124,7 +124,7 @@
const I& input = exact (input_);
image2d<value::rgb8> output(input.domain().bbox());
- level::fill(output, value::rgb8(255, 0, 0));
+ data::fill(output, value::rgb8(255, 0, 0));
{
mln_piter(I) p(input.domain());
@@ -150,7 +150,7 @@
const I& input = exact (input_);
image2d<value::rgb8> output(input.domain().bbox());
- level::fill(output, value::rgb8(0, 0, 0));
+ data::fill(output, value::rgb8(0, 0, 0));
{
mln_piter(p_set<mln_psite(I) >) p(s1_);
Index: mln/trait/accumulators.hh
--- mln/trait/accumulators.hh (revision 3927)
+++ mln/trait/accumulators.hh (working copy)
@@ -46,7 +46,7 @@
# define mln_trait_accumulator_has_stop(A) typename mln::trait::accumulator_< A >::has_stop
/// Shortcut to the accumulator property about behavior when pixel is given as take() value
-/// Used for instance in mln::canvas::morpho::leveling
+/// Used for instance in mln::canvas::morpho::dataing
# define mln_trait_accumulator_when_pix(A) typename mln::trait::accumulator_< A >::when_pix
Index: mln/debug/superpose.hh
--- mln/debug/superpose.hh (revision 3927)
+++ mln/debug/superpose.hh (working copy)
@@ -37,7 +37,7 @@
# include <mln/core/image/dmorph/image_if.hh>
# include <mln/value/rgb8.hh>
# include <mln/data/fill.hh>
-# include <mln/level/convert.hh>
+# include <mln/data/convert.hh>
# include <mln/pw/all.hh>
# include <mln/literal/colors.hh>
@@ -91,7 +91,7 @@
mln_precondition(object.is_valid());
mln_precondition(input.domain() == object.domain());
- mln_ch_value(I,value::rgb8) output = level::convert(value::rgb8(), input);
+ mln_ch_value(I,value::rgb8) output = data::convert(value::rgb8(), input);
data::fill((output | pw::value(object)).rw(), object_color);
trace::exiting("debug::superpose");
Index: mln/world/binary_2d/subsample.hh
--- mln/world/binary_2d/subsample.hh (revision 3927)
+++ mln/world/binary_2d/subsample.hh (working copy)
@@ -73,7 +73,7 @@
if (n == 0)
{
image2d<value::int_u8>
- output = level::convert(int_u8(), input);
+ output = data::convert(int_u8(), input);
trace::exiting("world::binary_2d::subsample");
return output;
Index: mln/world/binary_2d/enlarge.hh
--- mln/world/binary_2d/enlarge.hh (revision 3927)
+++ mln/world/binary_2d/enlarge.hh (working copy)
@@ -44,7 +44,7 @@
# include <mln/fun/p2v/ternary.hh>
# include <mln/fun/v2b/threshold.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
# include <mln/pw/image.hh>
# include <mln/pw/cst.hh>
@@ -294,7 +294,7 @@
{
mln_ch_value(I,value::int_u8) tmp = do_enlarge_gl(input, n);
I output
- = level::transform(tmp, fun::v2b::threshold<value::int_u8>(150));
+ = data::transform(tmp, fun::v2b::threshold<value::int_u8>(150));
return output;
}
Index: mln/core/image/imorph/labeled_image.hh
--- mln/core/image/imorph/labeled_image.hh (revision 3927)
+++ mln/core/image/imorph/labeled_image.hh (working copy)
@@ -53,7 +53,7 @@
# ifndef NDEBUG
# include <mln/accu/max.hh>
-# include <mln/level/compute.hh>
+# include <mln/data/compute.hh>
# endif // ! NDEBUG
@@ -253,7 +253,7 @@
void
labeled_image<I>::init_(const I& ima, const mln_value(I)& nlabels)
{
- mln_precondition(level::compute(accu::meta::max(), ima) == nlabels);
+ mln_precondition(data::compute(accu::meta::max(), ima) == nlabels);
this->data_ = new internal::data< labeled_image<I> >(ima, nlabels);
this->update_();
}
Index: mln/core/concept/object.hh
--- mln/core/concept/object.hh (revision 3927)
+++ mln/core/concept/object.hh (working copy)
@@ -85,7 +85,7 @@
* <LI> \ref mln::histo
* <LI> \ref mln::io
* <LI> \ref mln::labeling
- * <LI> \ref mln::level
+ * <LI> \ref mln::data
* <LI> \ref mln::linear
* <LI> \ref mln::literal
* <LI> \ref mln::logical
Index: mln/all.hh
--- mln/all.hh (revision 3927)
+++ mln/all.hh (working copy)
@@ -26,8 +26,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ALL_HH_
-# define MLN_ALL_HH_
+#ifndef MLN_ALL_HH
+# define MLN_ALL_HH
/// \file mln/all.hh
///
@@ -53,7 +53,6 @@
#include <mln/histo/all.hh>
#include <mln/io/all.hh>
#include <mln/labeling/all.hh>
-#include <mln/level/all.hh>
#include <mln/linear/all.hh>
#include <mln/literal/all.hh>
#include <mln/logical/all.hh>
@@ -78,5 +77,4 @@
#include <mln/essential/2d.hh>
#include <mln/essential/3d.hh>
-#endif // ! MLN_ALL_HH_
-
+#endif // ! MLN_ALL_HH
Index: mln/arith/min.hh
--- mln/arith/min.hh (revision 3927)
+++ mln/arith/min.hh (working copy)
@@ -80,27 +80,27 @@
inline
void min_(const L& lhs, const R& rhs, O& output)
{
- trace::entering("level::arith::generic::min_");
+ trace::entering("data::arith::generic::min_");
mln_piter(L) p(lhs.domain());
for_all(p)
output(p) = lhs(p) < rhs(p) ? lhs(p) : rhs(p);
- trace::entering("level::arith::generic::min_");
+ trace::entering("data::arith::generic::min_");
}
template <typename L, typename R>
inline
void min_inplace_(L& lhs, const R& rhs)
{
- trace::entering("level::arith::generic::min_inplace_");
+ trace::entering("data::arith::generic::min_inplace_");
mln_piter(L) p(lhs.domain());
for_all(p)
if (rhs(p) < lhs(p))
lhs(p) = rhs(p);
- trace::exiting("level::arith::generic::min_inplace_");
+ trace::exiting("data::arith::generic::min_inplace_");
}
} // end of namespace mln::arith::impl::generic
Index: mln/arith/min.spe.hh
--- mln/arith/min.spe.hh (revision 3927)
+++ mln/arith/min.spe.hh (working copy)
@@ -73,7 +73,7 @@
void min_(trait::image::speed::fastest, const L& lhs,
trait::image::speed::fastest, const R& rhs, O& output)
{
- trace::entering("level::arith::min_");
+ trace::entering("data::arith::min_");
mln_pixter(const L) lp(lhs);
mln_pixter(const R) rp(rhs);
@@ -81,7 +81,7 @@
for_all_3(lp, rp, op)
op.val() = lp.val() < rp.val() ? lp.val() : rp.val();
- trace::exiting("level::arith::min_");
+ trace::exiting("data::arith::min_");
}
template <typename L, typename R>
@@ -97,7 +97,7 @@
void min_inplace_(trait::image::speed::fastest, L& lhs,
trait::image::speed::fastest, const R& rhs)
{
- trace::entering("level::arith::min_inplace_");
+ trace::entering("data::arith::min_inplace_");
mln_pixter(L) lp(lhs);
mln_pixter(const R) rp(rhs);
@@ -105,7 +105,7 @@
if (rp.val() < lp.val())
lp.val() = rp.val();
- trace::exiting("level::arith::min_inplace_");
+ trace::exiting("data::arith::min_inplace_");
}
} // end of namespace mln::arith::impl
Index: mln/arith/diff_abs.hh
--- mln/arith/diff_abs.hh (revision 3927)
+++ mln/arith/diff_abs.hh (working copy)
@@ -37,7 +37,7 @@
# include <mln/arith/includes.hh>
# include <mln/fun/vv2v/diff_abs.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
namespace mln
{
@@ -70,7 +70,7 @@
mln_precondition(exact(rhs).is_valid());
mln_precondition(exact(rhs).domain() == exact(lhs).domain());
- mln_concrete(I) output = level::transform(lhs, rhs, fun::vv2v::diff_abs<mln_value(I)>());
+ mln_concrete(I) output = data::transform(lhs, rhs, fun::vv2v::diff_abs<mln_value(I)>());
trace::exiting("arith::diff_abs");
return output;
Index: mln/data/update.hh
--- mln/data/update.hh (revision 3920)
+++ mln/data/update.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_LEVEL_UPDATE_HH
# define MLN_LEVEL_UPDATE_HH
-/*! \file mln/level/update.hh
+/*! \file mln/data/update.hh
*
* \brief Update an accumulator with image pixel values.
*/
@@ -41,7 +41,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/*! Update an accumulator with the pixel values of the image \p input.
@@ -90,51 +90,51 @@
namespace generic
{
- /// Generic implementation of level::update.
+ /// Generic implementation of data::update.
template <typename A, typename I>
inline
mln_result(A)
update(Accumulator<A>& a_, const Image<I>& input_)
{
- trace::entering("level::impl::generic::update");
+ trace::entering("data::impl::generic::update");
A& a = exact(a_);
const I& input = exact(input_);
- level::internal::update_tests(a, input);
+ data::internal::update_tests(a, input);
mln_piter(I) p(input.domain());
for_all(p)
a.take(input(p));
- trace::exiting("level::impl::generic::update");
+ trace::exiting("data::impl::generic::update");
return a.to_result();
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
- /// Fastest implementation of level::update.
+ /// Fastest implementation of data::update.
template <typename A, typename I>
inline
mln_result(A)
update_fastest(Accumulator<A>& a_, const Image<I>& input_)
{
- trace::entering("level::impl::update_fastest");
+ trace::entering("data::impl::update_fastest");
A& a = exact(a_);
const I& input = exact(input_);
- level::internal::update_tests(a, input);
+ data::internal::update_tests(a, input);
mln_pixter(const I) pxl(input);
for_all(pxl)
a.take(pxl.val());
- trace::exiting("level::impl::update_fastest");
+ trace::exiting("data::impl::update_fastest");
return a.to_result();
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -181,18 +181,18 @@
mln_result(A)
update(Accumulator<A>& a, const Image<I>& input)
{
- trace::entering("level::update");
+ trace::entering("data::update");
- level::internal::update_tests(a, input);
+ data::internal::update_tests(a, input);
mln_result(A) r = internal::update_dispatch(a, input);
- trace::exiting("level::update");
+ trace::exiting("data::update");
return r;
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/was.median.hh
--- mln/data/was.median.hh (revision 3920)
+++ mln/data/was.median.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_LEVEL_WAS_MEDIAN_HH
# define MLN_LEVEL_WAS_MEDIAN_HH
-/*! \file mln/level/was.median.hh
+/*! \file mln/data/was.median.hh
*
* \brief Obsolete routines for median filtering.
*/
@@ -44,7 +44,7 @@
# include <mln/win/diff.hh>
# include <mln/win/shift.hh>
-# include <mln/level/median.hh>
+# include <mln/data/median.hh>
# include <mln/win/hline2d.hh>
# include <mln/opt/at.hh>
@@ -52,7 +52,7 @@
namespace mln
{
- namespace level
+ namespace data
{
namespace impl
@@ -199,9 +199,9 @@
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/transform.spe.hh
--- mln/data/transform.spe.hh (revision 3920)
+++ mln/data/transform.spe.hh (working copy)
@@ -29,9 +29,9 @@
#ifndef MLN_LEVEL_TRANSFORM_SPE_HH
# define MLN_LEVEL_TRANSFORM_SPE_HH
-/// \file mln/level/transform.spe.hh
+/// \file mln/data/transform.spe.hh
///
-/// Specializations for mln::level::transform.
+/// Specializations for mln::data::transform.
# ifndef MLN_LEVEL_TRANSFORM_HH
# error "Forbidden inclusion of *.spe.hh"
@@ -53,7 +53,7 @@
namespace mln
{
- namespace level
+ namespace data
{
// Forward declarations.
@@ -100,14 +100,14 @@
mln_ch_value(I, mln_result(F))
transform_lowq_v2v(const Image<I>& input_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_lowq_v2v");
+ trace::entering("data::impl::transform_lowq_v2v");
mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
trait::image::pw_io::read_write)::check();
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
@@ -119,7 +119,7 @@
for_all(p)
output(p) = lut(input(p));
- trace::exiting("level::impl::transform_lowq_v2v");
+ trace::exiting("data::impl::transform_lowq_v2v");
return output;
}
@@ -128,14 +128,14 @@
mln_ch_value(I, mln_result(F))
transform_lowq_i2v(const Image<I>& input_, const Function_i2v<F>& f_)
{
- trace::entering("level::impl::transform_lowq");
+ trace::entering("data::impl::transform_lowq");
mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
trait::image::pw_io::read_write)::check();
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
@@ -144,7 +144,7 @@
for_all(p)
output(p) = f(input(p));
- trace::exiting("level::impl::transform_lowq");
+ trace::exiting("data::impl::transform_lowq");
return output;
}
@@ -153,14 +153,14 @@
mln_ch_value(I, mln_result(F))
transform_taken_v2v(const Image<I>& input_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_taken_v2v");
+ trace::entering("data::impl::transform_taken_v2v");
mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
trait::image::pw_io::read_write)::check();
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
@@ -172,7 +172,7 @@
for_all(p)
output(p) = lut(input(p));
- trace::exiting("level::impl::transform_taken_v2v");
+ trace::exiting("data::impl::transform_taken_v2v");
return output;
}
@@ -181,14 +181,14 @@
mln_ch_value(I, mln_result(F))
transform_taken_i2v(const Image<I>& input_, const Function_i2v<F>& f_)
{
- trace::entering("level::impl::transform_taken_i2v");
+ trace::entering("data::impl::transform_taken_i2v");
mlc_is(mln_trait_image_pw_io(mln_ch_value(I, mln_result(F))),
trait::image::pw_io::read_write)::check();
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
@@ -197,7 +197,7 @@
for_all(p)
output(p) = f(input(p));
- trace::exiting("level::impl::transform_taken_i2v");
+ trace::exiting("data::impl::transform_taken_i2v");
return output;
}
@@ -206,11 +206,11 @@
mln_ch_value(I, mln_result(F))
transform_singleton(const Image<I>& input_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_singleton");
+ trace::entering("data::impl::transform_singleton");
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
@@ -218,7 +218,7 @@
mln_result(F) val = f(opt::value(input));
data::fill_with_value(output, val);
- trace::exiting("level::impl::transform_singleton");
+ trace::exiting("data::impl::transform_singleton");
return output;
}
@@ -227,12 +227,12 @@
mln_ch_value(I, mln_result(F))
transform_fast(const Image<I>& input_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_fast");
+ trace::entering("data::impl::transform_fast");
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
typedef mln_ch_value(I, mln_result(F)) O;
O output;
@@ -243,7 +243,7 @@
for_all_2(pi, po)
po.val() = f(pi.val());
- trace::exiting("level::impl::transform_fast");
+ trace::exiting("data::impl::transform_fast");
return output;
}
@@ -252,11 +252,11 @@
mln_ch_value(I, mln_result(F))
transform_fast_lowq(const Image<I>& input_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_fast_lowq");
+ trace::entering("data::impl::transform_fast_lowq");
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
typedef mln_ch_value(I, mln_result(F)) O;
O output;
@@ -270,7 +270,7 @@
for_all_2(pi, po)
po.val() = lut(pi.val());
- trace::exiting("level::impl::transform_fast_lowq");
+ trace::exiting("data::impl::transform_fast_lowq");
return output;
}
@@ -280,12 +280,12 @@
transform_fastest(const Image<I1>& input1_, const Image<I2>& input2_,
const Function_vv2v<F>& f_)
{
- trace::entering("level::impl::transform_fastest");
+ trace::entering("data::impl::transform_fastest");
const I1& input1 = exact(input1_);
const I2& input2 = exact(input2_);
const F& f = exact(f_);
- level::internal::transform_tests(input1, input2, f);
+ data::internal::transform_tests(input1, input2, f);
typedef mln_ch_value(I1, mln_result(F)) O;
O output;
@@ -297,13 +297,13 @@
for_all_3(pi1, pi2, po)
po.val() = f(pi1.val(), pi2.val());
- trace::exiting("level::impl::transform_fastest");
+ trace::exiting("data::impl::transform_fastest");
return output;
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -320,7 +320,7 @@
trait::image::quant::any,
const Image<I>& input, const Function_v2v<F>& f)
{
- return level::impl::generic::transform(input, f);
+ return data::impl::generic::transform(input, f);
}
template <typename I, typename F>
@@ -330,7 +330,7 @@
trait::image::quant::any,
const Image<I>& input, const Function_v2v<F>& f)
{
- return level::impl::generic::transform(input, f);
+ return data::impl::generic::transform(input, f);
}
template <typename I, typename F>
@@ -340,7 +340,7 @@
trait::image::quant::low,
const Image<I>& input, const Function_v2v<F>& f)
{
- return level::impl::transform_taken_v2v(input, f);
+ return data::impl::transform_taken_v2v(input, f);
}
template <typename I, typename F>
@@ -350,7 +350,7 @@
trait::image::quant::low,
const Image<I>& input, const Function_i2v<F>& f)
{
- return level::impl::transform_taken_i2v(input, f);
+ return data::impl::transform_taken_i2v(input, f);
}
template <typename I, typename F>
@@ -360,7 +360,7 @@
trait::image::quant::low,
const Image<I>& input, const Function_v2v<F>& f)
{
- return level::impl::transform_lowq_v2v(input, f);
+ return data::impl::transform_lowq_v2v(input, f);
}
template <typename I, typename F>
@@ -370,7 +370,7 @@
trait::image::quant::low,
const Image<I>& input, const Function_i2v<F>& f)
{
- return level::impl::transform_lowq_i2v(input, f);
+ return data::impl::transform_lowq_i2v(input, f);
}
template <typename I, typename F>
@@ -380,7 +380,7 @@
trait::image::value_access::direct,
const Image<I>& input, const Function_v2v<F>& f)
{
- return level::impl::transform_fast(input, f);
+ return data::impl::transform_fast(input, f);
}
template <typename I, typename F>
@@ -390,7 +390,7 @@
trait::image::value_access::direct,
const Image<I>& input, const Function_v2v<F>& f)
{
- return level::impl::transform_fast_lowq(input, f);
+ return data::impl::transform_fast_lowq(input, f);
}
template <typename I, typename F>
@@ -400,7 +400,7 @@
trait::image::value_access::direct,
const Image<I>& input, const Function_i2v<F>& f)
{
- return level::impl::transform_fast(input, f);
+ return data::impl::transform_fast(input, f);
}
template <typename I, typename F>
@@ -433,7 +433,7 @@
transform_dispatch(trait::image::value_storage::singleton,
const Image<I>& input, const Function_v2v<F>& f)
{
- return level::impl::transform_singleton(input, f);
+ return data::impl::transform_singleton(input, f);
}
template <typename I, typename F>
@@ -469,7 +469,7 @@
const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
{
- return level::impl::generic::transform(input1, input2, f);
+ return data::impl::generic::transform(input1, input2, f);
}
template <typename I1, typename I2, typename F>
@@ -481,7 +481,7 @@
const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
{
- return level::impl::transform_fastest(input1, input2, f);
+ return data::impl::transform_fastest(input1, input2, f);
}
// end of Dispatch for transformation from a couple of images.
@@ -510,11 +510,11 @@
input1, input2, f);
}
- } // end of namespace mln::level::internal
+ } // end of namespace mln::data::internal
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/to_enc.hh
--- mln/data/to_enc.hh (revision 3920)
+++ mln/data/to_enc.hh (working copy)
@@ -28,20 +28,20 @@
#ifndef MLN_LEVEL_TO_ENC_HH
# define MLN_LEVEL_TO_ENC_HH
-/*! \file mln/level/to_enc.hh
+/*! \file mln/data/to_enc.hh
*
* \brief Transform with fun::v2v::enc the contents of an image into
* another one.
*/
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
# include <mln/fun/v2v/enc.hh>
namespace mln
{
- namespace level
+ namespace data
{
/*! Set the \p output image with the encoding values of the image \p input pixels.
@@ -61,17 +61,17 @@
inline
void to_enc(const Image<I>& input, Image<O>& output)
{
- trace::entering("level::to_enc");
+ trace::entering("data::to_enc");
mln_precondition(exact(output).domain() == exact(input).domain());
- output = level::transform(input, fun::v2v::enc< mln_value(I) >());
+ output = data::transform(input, fun::v2v::enc< mln_value(I) >());
- trace::exiting("level::to_enc");
+ trace::exiting("data::to_enc");
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/all.hh
--- mln/data/all.hh (revision 3927)
+++ mln/data/all.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
@@ -52,8 +52,26 @@
}
+# include <mln/data/abs.hh>
+# include <mln/data/apply.hh>
+# include <mln/data/approx/all.hh>
+# include <mln/data/compare.hh>
+# include <mln/data/compute.hh>
+# include <mln/data/convert.hh>
+# include <mln/data/fast_median.hh>
# include <mln/data/fill.hh>
+# include <mln/data/median.hh>
+# include <mln/data/naive/all.hh>
# include <mln/data/paste.hh>
+# include <mln/data/replace.hh>
+# include <mln/data/saturate.hh>
+# include <mln/data/sort_offsets.hh>
+# include <mln/data/sort_psites.hh>
+# include <mln/data/stretch.hh>
+# include <mln/data/to_enc.hh>
+# include <mln/data/transform.hh>
+# include <mln/data/update.hh>
+//<< # include <mln/data/was.median.hh> >>
Index: mln/data/transform.hh
--- mln/data/transform.hh (revision 3920)
+++ mln/data/transform.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_TRANSFORM_HH
# define MLN_LEVEL_TRANSFORM_HH
-/// \file mln/level/transform.hh
+/// \file mln/data/transform.hh
///
/// Transform the contents of an image into another one.
///
@@ -42,13 +42,13 @@
# include <mln/value/set.hh>
// Specializations are in:
-# include <mln/level/transform.spe.hh>
+# include <mln/data/transform.spe.hh>
namespace mln
{
- namespace level
+ namespace data
{
/*! Transform the image \p input through a function \p f.
@@ -116,7 +116,7 @@
(void) f;
}
- } // end of namespace mln::level::internal
+ } // end of namespace mln::data::internal
@@ -130,17 +130,17 @@
namespace generic
{
- /// Generic implementation of level::transform.
+ /// Generic implementation of data::transform.
template <typename I, typename F>
mln_ch_value(I, mln_result(F))
transform(const Image<I>& input_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::generic::transform");
+ trace::entering("data::impl::generic::transform");
const I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_tests(input, f);
+ data::internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
initialize(output, input);
@@ -149,7 +149,7 @@
for_all(p)
output(p) = f(input(p));
- trace::exiting("level::impl::generic::transform");
+ trace::exiting("data::impl::generic::transform");
return output;
}
@@ -160,13 +160,13 @@
const Image<I2>& input2_,
const Function_vv2v<F>& f_)
{
- trace::entering("level::impl::generic::transform");
+ trace::entering("data::impl::generic::transform");
const I1& input1 = exact(input1_);
const I2& input2 = exact(input2_);
const F& f = exact(f_);
- level::internal::transform_tests(input1, input2, f);
+ data::internal::transform_tests(input1, input2, f);
mln_ch_value(I1, mln_result(F)) output;
initialize(output, input1);
@@ -175,14 +175,14 @@
for_all(p)
output(p) = f(input1(p), input2(p));
- trace::exiting("level::impl::generic::transform");
+ trace::exiting("data::impl::generic::transform");
return output;
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -194,14 +194,14 @@
mln_ch_value(I, mln_result(F))
transform(const Image<I>& input, const Function_v2v<F>& f)
{
- trace::entering("level::transform");
+ trace::entering("data::transform");
internal::transform_tests(input, f);
mln_ch_value(I, mln_result(F)) output;
output = internal::transform_dispatch(input, f);
- trace::exiting("level::transform");
+ trace::exiting("data::transform");
return output;
}
@@ -212,21 +212,21 @@
transform(const Image<I1>& input1, const Image<I2>& input2,
const Function_vv2v<F>& f)
{
- trace::entering("level::transform");
+ trace::entering("data::transform");
internal::transform_tests(input1, input2, f);
mln_ch_value(I1, mln_result(F)) output;
output = internal::transform_dispatch(input1, input2, f);
- trace::exiting("level::transform");
+ trace::exiting("data::transform");
return output;
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/replace.hh
--- mln/data/replace.hh (revision 3920)
+++ mln/data/replace.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_REPLACE_HH
# define MLN_LEVEL_REPLACE_HH
-/// \file mln/level/replace.hh
+/// \file mln/data/replace.hh
///
/// Replace the contents of an image into another one.
@@ -44,7 +44,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/*! Replace \p old_value by \p new_value in the image \p input
@@ -71,18 +71,18 @@
void replace_(Image<I>& input_, const mln_value(I)& old_value,
const mln_value(I)& new_value)
{
- trace::entering("level::impl::generic::replace");
+ trace::entering("data::impl::generic::replace");
I& input = exact(input_);
data::fill((input | (pw::value(input) == pw::cst(old_value))).rw(),
new_value);
- trace::exiting("level::impl::generic::replace");
+ trace::exiting("data::impl::generic::replace");
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -91,19 +91,19 @@
void replace(Image<I>& input,
const mln_value(I)& old_value, const mln_value(I)& new_value)
{
- trace::entering("level::replace");
+ trace::entering("data::replace");
mln_precondition(exact(input).is_valid());
impl::generic::replace_<I>(exact(input), old_value, new_value);
- trace::exiting("level::replace");
+ trace::exiting("data::replace");
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/approx/essential.hh
--- mln/data/approx/essential.hh (revision 3927)
+++ mln/data/approx/essential.hh (working copy)
@@ -28,13 +28,13 @@
#ifndef MLN_LEVEL_APPROX_ESSENTIAL_HH
# define MLN_LEVEL_APPROX_ESSENTIAL_HH
-/*! \file mln/level/approx/essential.hh
+/*! \file mln/data/approx/essential.hh
*
* \brief File that includes essential level-related routines with
* approximation.
*/
-# include <mln/level/approx/all.hh>
+# include <mln/data/approx/all.hh>
#endif // ! MLN_LEVEL_APPROX_ESSENTIAL_HH
Index: mln/data/approx/all.hh
--- mln/data/approx/all.hh (revision 3927)
+++ mln/data/approx/all.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_LEVEL_APPROX_ALL_HH
# define MLN_LEVEL_APPROX_ALL_HH
-/*! \file mln/level/approx/all.hh
+/*! \file mln/data/approx/all.hh
*
* \brief File that includes all level-related routines with
* approximation.
@@ -38,23 +38,23 @@
namespace mln
{
- namespace level
+ namespace data
{
/// \brief Namespace of image processing routines related to pixel
/// levels with approximation.
namespace approx
{
- /// Implementation namespace of level::approx namespace.
+ /// Implementation namespace of data::approx namespace.
namespace impl {}
}
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
-# include <mln/level/approx/median.hh>
+# include <mln/data/approx/median.hh>
#endif // ! MLN_LEVEL_APPROX_ALL_HH
Index: mln/data/approx/median.hh
--- mln/data/approx/median.hh (revision 3927)
+++ mln/data/approx/median.hh (working copy)
@@ -29,11 +29,11 @@
#ifndef MLN_LEVEL_APPROX_MEDIAN_HH
# define MLN_LEVEL_APPROX_MEDIAN_HH
-/// \file mln/level/approx/median.hh
+/// \file mln/data/approx/median.hh
///
/// Approximates of some median filters of an image.
-# include <mln/level/median.hh>
+# include <mln/data/median.hh>
# include <mln/win/rectangle2d.hh>
# include <mln/win/disk2d.hh>
# include <mln/win/octagon2d.hh>
@@ -48,7 +48,7 @@
namespace mln
{
- namespace level
+ namespace data
{
namespace approx
@@ -114,17 +114,17 @@
mln_concrete(I)
median(const Image<I>& input, const win::rectangle2d& win)
{
- trace::entering("level::approx::median");
+ trace::entering("data::approx::median");
mln_concrete(I) output;
win::hline2d win1(win.width());
- output = level::median(input, win1);
+ output = data::median(input, win1);
win::vline2d win2(win.height());
- output = level::median(output, win2);
+ output = data::median(output, win2);
- trace::exiting("level::approx::median");
+ trace::exiting("data::approx::median");
return output;
}
@@ -134,24 +134,24 @@
mln_concrete(I)
median(const Image<I>& input, const win::disk2d& win)
{
- trace::entering("level::approx::median");
+ trace::entering("data::approx::median");
const unsigned len = win.diameter() / 3 + 1;
mln_concrete(I) output;
win::diag2d win1(len);
- output = level::median(input, win1);
+ output = data::median(input, win1);
win::backdiag2d win2(len);
- output = level::median(output, win2);
+ output = data::median(output, win2);
win::hline2d win3(len);
- output = level::median(input, win3);
+ output = data::median(input, win3);
win::vline2d win4(len);
- output = level::median(output, win4);
+ output = data::median(output, win4);
- trace::exiting("level::approx::median");
+ trace::exiting("data::approx::median");
return output;
}
@@ -166,9 +166,9 @@
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level::approx
+ } // end of namespace mln::data::approx
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/apply.spe.hh
--- mln/data/apply.spe.hh (revision 3920)
+++ mln/data/apply.spe.hh (working copy)
@@ -28,9 +28,9 @@
#ifndef MLN_LEVEL_APPLY_SPE_HH
# define MLN_LEVEL_APPLY_SPE_HH
-/*! \file mln/level/apply.spe.hh
+/*! \file mln/data/apply.spe.hh
*
- * \brief Specializations for mln::level::apply.
+ * \brief Specializations for mln::data::apply.
*/
# ifndef MLN_LEVEL_APPLY_HH
@@ -47,7 +47,7 @@
namespace mln
{
- namespace level
+ namespace data
{
namespace impl
@@ -73,19 +73,19 @@
inline
void apply_(trait::image::speed::fastest, I& input, const F& f)
{
- trace::entering("level::impl::apply_");
+ trace::entering("data::impl::apply_");
mln_pixter(I) pxl(input);
for_all(pxl)
pxl.val() = f(pxl.val());
- trace::exiting("level::impl::apply_");
+ trace::exiting("data::impl::apply_");
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/stretch.hh
--- mln/data/stretch.hh (revision 3920)
+++ mln/data/stretch.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_STRETCH_HH
# define MLN_LEVEL_STRETCH_HH
-/// \file mln/level/stretch.hh
+/// \file mln/data/stretch.hh
///
/// Transform linearly the contents of an image into another one in a
/// stretching way.
@@ -41,7 +41,7 @@
# include <mln/estim/min_max.hh>
# include <mln/value/int_u.hh>
# include <mln/fun/v2v/linear.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
# include <mln/value/internal/encoding.hh>
@@ -49,7 +49,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/*! Stretch the values of \p input so that they can be stored in
@@ -72,7 +72,7 @@
namespace impl
{
- /// Generic implementation of level::stretch.
+ /// Generic implementation of data::stretch.
///
/// \param[in] v A value to set the output value type.
/// \param[in] input The input image.
@@ -84,7 +84,7 @@
mln_ch_value(I, V)
stretch(V, const Image<I>& input)
{
- trace::entering("level::impl::stretch");
+ trace::entering("data::impl::stretch");
mlc_converts_to(float, V)::check();
@@ -105,7 +105,7 @@
a = (M - m) / (max - min),
b = (m * max - M * min) / (max - min);
fun::v2v::linear_sat<mln_value(I), double, V> f(a, b);
- output = level::transform(input, f);
+ output = data::transform(input, f);
}
else
{
@@ -113,11 +113,11 @@
trace::warning("output has no significative data!");
}
- trace::exiting("level::impl::stretch");
+ trace::exiting("data::impl::stretch");
return output;
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -128,19 +128,19 @@
mln_ch_value(I, V)
stretch(V, const Image<I>& input)
{
- trace::entering("level::stretch");
+ trace::entering("data::stretch");
mln_precondition(exact(input).is_valid());
mln_ch_value(I, V) output = impl::stretch(V(), input);
- trace::exiting("level::stretch");
+ trace::exiting("data::stretch");
return output;
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/sort_offsets.hh
--- mln/data/sort_offsets.hh (revision 3920)
+++ mln/data/sort_offsets.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_SORT_OFFSETS_HH
# define MLN_LEVEL_SORT_OFFSETS_HH
-/// \file mln/level/sort_offsets.hh
+/// \file mln/data/sort_offsets.hh
/// \brief Sort_Offsets the contents of an image into another one.
///
/// \todo Factor code + optimize.
@@ -46,7 +46,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/// Sort pixel offsets of the image \p input wrt increasing pixel
@@ -95,7 +95,7 @@
util::array<unsigned>
sort_offsets_increasing(const Image<I>& input_)
{
- trace::entering("level::impl::generic::sort_offsets_increasing");
+ trace::entering("data::impl::generic::sort_offsets_increasing");
const I& input = exact(input_);
@@ -107,7 +107,7 @@
std::sort(v.hook_std_vector_().begin(), v.hook_std_vector_().end(),
value_offset_less_<I>(input));
- trace::exiting("level::impl::generic::sort_offsets_increasing");
+ trace::exiting("data::impl::generic::sort_offsets_increasing");
return v;
}
@@ -133,7 +133,7 @@
util::array<unsigned>
sort_offsets_decreasing(const Image<I>& input_)
{
- trace::entering("level::impl::generic::sort_offsets_decreasing");
+ trace::entering("data::impl::generic::sort_offsets_decreasing");
const I& input = exact(input_);
@@ -145,12 +145,12 @@
std::sort(v.hook_std_vector_().begin(), v.hook_std_vector_().end(),
value_offset_greater_<I>(input));
- trace::exiting("level::impl::generic::sort_offsets_decreasing");
+ trace::exiting("data::impl::generic::sort_offsets_decreasing");
return v;
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
@@ -161,7 +161,7 @@
util::array<unsigned>
sort_offsets_increasing_radix(const Image<I>& input_)
{
- trace::entering("level::impl::sort_offsets_increasing_radix");
+ trace::entering("data::impl::sort_offsets_increasing_radix");
const I& input = exact(input_);
@@ -184,7 +184,7 @@
for_all(pxl)
vec[loc[vset.index_of(pxl.val())]++] = pxl.offset();
- trace::exiting("level::impl::sort_offsets_increasing_radix");
+ trace::exiting("data::impl::sort_offsets_increasing_radix");
return vec;
}
@@ -196,7 +196,7 @@
util::array<unsigned>
sort_offsets_decreasing_radix(const Image<I>& input_)
{
- trace::entering("level::impl::sort_offsets_decreasing_radix");
+ trace::entering("data::impl::sort_offsets_decreasing_radix");
const I& input = exact(input_);
@@ -219,12 +219,12 @@
for_all(pxl)
vec[loc[vset.index_of(pxl.val())]++] = pxl.offset();
- trace::exiting("level::impl::sort_offsets_decreasing_radix");
+ trace::exiting("data::impl::sort_offsets_decreasing_radix");
return vec;
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -289,7 +289,7 @@
input);
}
- } // end of namespace mln::level::internal
+ } // end of namespace mln::data::internal
@@ -300,14 +300,14 @@
util::array<unsigned>
sort_offsets_increasing(const Image<I>& input)
{
- trace::entering("level::sort_offsets_increasing");
+ trace::entering("data::sort_offsets_increasing");
mlc_is(mln_trait_image_speed(I),
trait::image::speed::fastest)::check();
mln_precondition(exact(input).is_valid());
util::array<unsigned> output = internal::sort_offsets_increasing_dispatch(input);
- trace::exiting("level::sort_offsets_increasing");
+ trace::exiting("data::sort_offsets_increasing");
return output;
}
@@ -316,20 +316,20 @@
util::array<unsigned>
sort_offsets_decreasing(const Image<I>& input)
{
- trace::entering("level::sort_offsets_decreasing");
+ trace::entering("data::sort_offsets_decreasing");
mlc_is(mln_trait_image_speed(I),
trait::image::speed::fastest)::check();
mln_precondition(exact(input).is_valid());
util::array<unsigned> output = internal::sort_offsets_decreasing_dispatch(input);
- trace::exiting("level::sort_offsets_decreasing");
+ trace::exiting("data::sort_offsets_decreasing");
return output;
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/apply.hh
--- mln/data/apply.hh (revision 3920)
+++ mln/data/apply.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_LEVEL_APPLY_HH
# define MLN_LEVEL_APPLY_HH
-/*! \file mln/level/apply.hh
+/*! \file mln/data/apply.hh
*
* \brief Apply a function-object onto image pixel values.
*/
@@ -37,13 +37,13 @@
# include <mln/core/concept/function.hh>
// Specializations are in:
-# include <mln/level/apply.spe.hh>
+# include <mln/data/apply.spe.hh>
namespace mln
{
- namespace level
+ namespace data
{
/*! Apply a function-object to the image \p input.
@@ -54,7 +54,7 @@
* This routine runs: \n
* for all p of \p input, \p input(p) = \p f( \p input(p) ) \n
*
- * This routine is equivalent to level::tranform(input, f, input)
+ * This routine is equivalent to data::tranform(input, f, input)
* but it is faster since a single iterator is required.
*
* \todo Add versions for lowq images.
@@ -76,18 +76,18 @@
inline
void apply_(I& input, const F& f)
{
- trace::entering("level::impl::generic::apply_");
+ trace::entering("data::impl::generic::apply_");
mln_piter(I) p(input.domain());
for_all(p)
input(p) = f(input(p));
- trace::exiting("level::impl::generic::apply_");
+ trace::exiting("data::impl::generic::apply_");
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
// Facade.
@@ -96,18 +96,18 @@
inline
void apply(Image<I>& input, const Function_v2v<F>& f)
{
- trace::entering("level::apply");
+ trace::entering("data::apply");
mln_precondition(exact(input).is_valid());
impl::apply_(mln_trait_image_speed(I)(), exact(input),
exact(f));
- trace::exiting("level::apply");
+ trace::exiting("data::apply");
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/compare.hh
--- mln/data/compare.hh (revision 3920)
+++ mln/data/compare.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_COMPARE_HH
# define MLN_LEVEL_COMPARE_HH
-/// \file mln/level/compare.hh
+/// \file mln/data/compare.hh
///
/// Comparison operators between the pixel values of images.
@@ -87,7 +87,7 @@
inline
bool operator == (const Image<L>& lhs_, const Image<R>& rhs_)
{
- trace::entering("level::compare (==)");
+ trace::entering("data::compare (==)");
const L& lhs = exact(lhs_);
const R& rhs = exact(rhs_);
@@ -99,7 +99,7 @@
typedef fun::vv2b::eq<mln_value(L), mln_value(R)> F;
bool res = test::predicate(lhs_, rhs_, F());
- trace::exiting("level::compare (==)");
+ trace::exiting("data::compare (==)");
return res;
}
@@ -108,7 +108,7 @@
inline
bool operator < (const Image<L>& lhs_, const Image<R>& rhs_)
{
- trace::entering("level::compare (<)");
+ trace::entering("data::compare (<)");
const L& lhs = exact(lhs_);
const R& rhs = exact(rhs_);
@@ -118,7 +118,7 @@
typedef fun::vv2b::lt<mln_value(L), mln_value(R)> F;
bool res = test::predicate(lhs_, rhs_, F());
- trace::exiting("level::compare (<)");
+ trace::exiting("data::compare (<)");
return res;
}
@@ -127,7 +127,7 @@
inline
bool operator <= (const Image<L>& lhs_, const Image<R>& rhs_)
{
- trace::entering("level::compare (<=)");
+ trace::entering("data::compare (<=)");
const L& lhs = exact(lhs_);
const R& rhs = exact(rhs_);
@@ -137,7 +137,7 @@
typedef fun::vv2b::le<mln_value(L), mln_value(R)> F;
bool res = test::predicate(lhs_, rhs_, F());
- trace::exiting("level::compare (<=)");
+ trace::exiting("data::compare (<=)");
return res;
}
Index: mln/data/essential.hh
--- mln/data/essential.hh (revision 3927)
+++ mln/data/essential.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -33,8 +34,14 @@
/// File that includes essential data-related routines.
+# include <mln/data/apply.hh>
+# include <mln/data/compare.hh>
+# include <mln/data/convert.hh>
# include <mln/data/fill.hh>
# include <mln/data/paste.hh>
+# include <mln/data/saturate.hh>
+# include <mln/data/stretch.hh>
+# include <mln/data/transform.hh>
#endif // ! MLN_DATA_ESSENTIAL_HH
Index: mln/data/saturate.hh
--- mln/data/saturate.hh (revision 3920)
+++ mln/data/saturate.hh (working copy)
@@ -29,19 +29,19 @@
#ifndef MLN_LEVEL_SATURATE_HH
# define MLN_LEVEL_SATURATE_HH
-/// \file mln/level/saturate.hh
+/// \file mln/data/saturate.hh
///
/// Apply a saturation function to image pixel values.
# include <mln/fun/v2v/saturate.hh>
-# include <mln/level/apply.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/apply.hh>
+# include <mln/data/transform.hh>
namespace mln
{
- namespace level
+ namespace data
{
@@ -89,14 +89,14 @@
mln_ch_value(I, V)
saturate(V, const Image<I>& input)
{
- trace::entering("level::saturate");
+ trace::entering("data::saturate");
mln_precondition(exact(input).is_valid());
fun::v2v::saturate<V> f;
- mln_ch_value(I, V) output = level::transform(input, f);
+ mln_ch_value(I, V) output = data::transform(input, f);
- trace::exiting("level::saturate");
+ trace::exiting("data::saturate");
return output;
}
@@ -106,14 +106,14 @@
saturate(const Image<I>& input,
const V& min, const V& max)
{
- trace::entering("level::saturate");
+ trace::entering("data::saturate");
mln_precondition(exact(input).is_valid());
fun::v2v::saturate<V> f(min, max);
- mln_ch_value(I, V) output = level::transform(input, f);
+ mln_ch_value(I, V) output = data::transform(input, f);
- trace::exiting("level::saturate");
+ trace::exiting("data::saturate");
return output;
}
@@ -122,19 +122,19 @@
void saturate_inplace(Image<I>& input,
const mln_value(I)& min, const mln_value(I)& max)
{
- trace::entering("level::saturate_inplace");
+ trace::entering("data::saturate_inplace");
mln_precondition(exact(input).is_valid());
fun::v2v::saturate<mln_value(I)> f(min, max);
- level::apply(input, f);
+ data::apply(input, f);
- trace::exiting("level::saturate_inplace");
+ trace::exiting("data::saturate_inplace");
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/median.hh
--- mln/data/median.hh (revision 3920)
+++ mln/data/median.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_MEDIAN_HH
# define MLN_LEVEL_MEDIAN_HH
-/// \file mln/level/median.hh
+/// \file mln/data/median.hh
///
/// Median filtering of an image.
///
@@ -51,7 +51,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/*! Compute in \p output the median filter of image \p input by
@@ -83,7 +83,7 @@
(void) win;
}
- } // end of namespace level::internal
+ } // end of namespace data::internal
namespace impl
@@ -189,7 +189,7 @@
mln_concrete(I)
median(const Image<I>& input, const Window<W>& win)
{
- trace::entering("level::impl::generic::median");
+ trace::entering("data::impl::generic::median");
mlc_equal(mln_trait_image_quant(I),
trait::image::quant::low)::check();
@@ -203,11 +203,11 @@
median_t<I,W,O> f(exact(input), exact(win), output);
canvas::browsing::snake_fwd(f);
- trace::exiting("level::impl::generic::median");
+ trace::exiting("data::impl::generic::median");
return output;
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
template <typename I,
@@ -216,7 +216,7 @@
mln_concrete(I)
median_line(const Image<I>& input, const win::line<M,i,C>& win)
{
- trace::entering("level::impl::median_line");
+ trace::entering("data::impl::median_line");
mlc_equal(mln_trait_image_quant(I),
trait::image::quant::low)::check();
@@ -225,12 +225,12 @@
accu::median_h<mln_value(I)> a;
mln_concrete(I) output = accu::transform_line(a, input, win.length(), i);
- trace::exiting("level::impl::median_line");
+ trace::exiting("data::impl::median_line");
return output;
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -263,7 +263,7 @@
return median_dispatch_wrt_win(input, exact(win));
}
- } // end of namespace level::internal
+ } // end of namespace data::internal
// Facade.
@@ -272,7 +272,7 @@
mln_concrete(I)
median(const Image<I>& input, const Window<W>& win)
{
- trace::entering("level::median");
+ trace::entering("data::median");
mlc_equal(mln_trait_image_quant(I),
trait::image::quant::low)::check();
@@ -281,13 +281,13 @@
mln_concrete(I) output;
output = internal::median_dispatch(input, win);
- trace::exiting("level::median");
+ trace::exiting("data::median");
return output;
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/naive/essential.hh
--- mln/data/naive/essential.hh (revision 3927)
+++ mln/data/naive/essential.hh (working copy)
@@ -28,12 +28,12 @@
#ifndef MLN_LEVEL_NAIVE_ESSENTIAL_HH
# define MLN_LEVEL_NAIVE_ESSENTIAL_HH
-/*! \file mln/level/naive/essential.hh
+/*! \file mln/data/naive/essential.hh
*
* \brief File that includes essential level-related routines with
* naive approach.
*/
-# include <mln/level/naive/all.hh>
+# include <mln/data/naive/all.hh>
#endif // ! MLN_LEVEL_NAIVE_ESSENTIAL_HH
Index: mln/data/naive/all.hh
--- mln/data/naive/all.hh (revision 3927)
+++ mln/data/naive/all.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_LEVEL_NAIVE_ALL_HH
# define MLN_LEVEL_NAIVE_ALL_HH
-/*! \file mln/level/naive/all.hh
+/*! \file mln/data/naive/all.hh
*
* \brief File that includes all level-related routines with
* naive approach.
@@ -39,23 +39,23 @@
{
- namespace level
+ namespace data
{
/// \brief Namespace of image processing routines related to pixel levels
/// with naive approach.
namespace naive
{
- /// Implementation namespace of level::naive namespace.
+ /// Implementation namespace of data::naive namespace.
namespace impl {}
}
- } // end of namespace level
+ } // end of namespace data
} // end of namespace mln
-# include <mln/level/naive/median.hh>
+# include <mln/data/naive/median.hh>
#endif // ! MLN_LEVEL_NAIVE_ALL_HH
Index: mln/data/naive/median.hh
--- mln/data/naive/median.hh (revision 3927)
+++ mln/data/naive/median.hh (working copy)
@@ -29,19 +29,19 @@
#ifndef MLN_LEVEL_NAIVE_MEDIAN_HH
# define MLN_LEVEL_NAIVE_MEDIAN_HH
-/// \file mln/level/naive/median.hh
+/// \file mln/data/naive/median.hh
///
/// Naive version of median filtering.
# include <mln/core/concept/image.hh>
# include <mln/core/alias/window2d.hh>
-# include <mln/level/median.hh>
+# include <mln/data/median.hh>
namespace mln
{
- namespace level
+ namespace data
{
namespace naive
@@ -59,7 +59,7 @@
*
* \pre \p input and \p output have to be initialized.
*
- * \see mln::level::median
+ * \see mln::data::median
*/
template <typename I, typename W, typename O>
void median(const Image<I>& input, const Window<W>& win,
@@ -91,7 +91,7 @@
}
- } // end of namespace mln::level::naive::impl
+ } // end of namespace mln::data::naive::impl
@@ -107,9 +107,9 @@
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level::naive
+ } // end of namespace mln::data::naive
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/abs.hh
--- mln/data/abs.hh (revision 3920)
+++ mln/data/abs.hh (working copy)
@@ -28,21 +28,21 @@
#ifndef MLN_LEVEL_ABS_HH
# define MLN_LEVEL_ABS_HH
-/*! \file mln/level/abs.hh
+/*! \file mln/data/abs.hh
*
* \brief Apply the absolute value (abs) function to image pixel
* values.
*/
# include <mln/fun/v2v/abs.hh>
-# include <mln/level/apply.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/apply.hh>
+# include <mln/data/transform.hh>
namespace mln
{
- namespace level
+ namespace data
{
@@ -69,29 +69,29 @@
inline
void abs(const Image<I>& input, Image<O>& output)
{
- trace::entering("level::abs");
+ trace::entering("data::abs");
mln_precondition(exact(input).domain() == exact(output).domain());
- exact(output) = level::transform(input, fun::v2v::abs<mln_value(I)>());
+ exact(output) = data::transform(input, fun::v2v::abs<mln_value(I)>());
- trace::exiting("level::abs");
+ trace::exiting("data::abs");
}
template <typename I>
inline
void abs_inplace(Image<I>& input)
{
- trace::entering("level::abs_inplace");
+ trace::entering("data::abs_inplace");
mln_precondition(exact(input).is_valid());
- level::apply(input, fun::v2v::abs<mln_value(I)>());
+ data::apply(input, fun::v2v::abs<mln_value(I)>());
- trace::exiting("level::abs_inplace");
+ trace::exiting("data::abs_inplace");
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/transform_inplace.hh
--- mln/data/transform_inplace.hh (revision 3920)
+++ mln/data/transform_inplace.hh (working copy)
@@ -29,11 +29,11 @@
#ifndef MLN_LEVEL_TRANSFORM_INPLACE_HH
# define MLN_LEVEL_TRANSFORM_INPLACE_HH
-/// \file mln/level/transform_inplace.hh
+/// \file mln/data/transform_inplace.hh
///
/// Transform inplace the contents of an image through a function.
///
-/// \todo Take into account more properties; see level/transform.hh.
+/// \todo Take into account more properties; see data/transform.hh.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
@@ -45,7 +45,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/*! Transform inplace the image \p ima through a function \p f.
@@ -131,7 +131,7 @@
(void) f;
}
- } // end of namespace mln::level::internal
+ } // end of namespace mln::data::internal
namespace impl
@@ -146,7 +146,7 @@
void
transform_inplace(Image<I>& ima_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::generic::transform_inplace");
+ trace::entering("data::impl::generic::transform_inplace");
mlc_is(mln_trait_image_pw_io(I),
trait::image::pw_io::read_write)::check();
@@ -154,13 +154,13 @@
I& ima = exact(ima_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(ima, f);
+ data::internal::transform_inplace_tests(ima, f);
mln_piter(I) p(ima.domain());
for_all(p)
ima(p) = f(ima(p));
- trace::exiting("level::impl::generic::transform_inplace");
+ trace::exiting("data::impl::generic::transform_inplace");
}
template <typename I1, typename I2, typename F>
@@ -168,7 +168,7 @@
transform_inplace(Image<I1>& ima_, const Image<I2>& aux_,
const Function_vv2v<F>& f_)
{
- trace::entering("level::impl::generic::transform_inplace");
+ trace::entering("data::impl::generic::transform_inplace");
mlc_is(mln_trait_image_pw_io(I1),
trait::image::pw_io::read_write)::check();
@@ -177,16 +177,16 @@
const I2& aux = exact(aux_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(ima, aux, f);
+ data::internal::transform_inplace_tests(ima, aux, f);
mln_piter(I1) p(ima.domain());
for_all(p)
ima(p) = f(ima(p), aux(p));
- trace::exiting("level::impl::generic::transform_inplace");
+ trace::exiting("data::impl::generic::transform_inplace");
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
/// Specialized implementation
@@ -195,7 +195,7 @@
transform_inplace_lowq(Image<I>& input_,
const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_inplace_lowq");
+ trace::entering("data::impl::transform_inplace_lowq");
mlc_is(mln_trait_image_pw_io(I),
trait::image::pw_io::read_write)::check();
@@ -203,7 +203,7 @@
I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(input, f);
+ data::internal::transform_inplace_tests(input, f);
value::lut_vec<mln_vset(I), mln_result(F)>
lut(input.values_eligible(), f);
@@ -212,7 +212,7 @@
for_all(p)
input(p) = lut(input(p));
- trace::exiting("level::impl::transform_inplace_lowq");
+ trace::exiting("data::impl::transform_inplace_lowq");
}
template <typename I, typename F>
@@ -220,7 +220,7 @@
transform_inplace_taken(Image<I>& input_,
const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_inplace_taken");
+ trace::entering("data::impl::transform_inplace_taken");
mlc_is(mln_trait_image_pw_io(I),
trait::image::pw_io::read_write)::check();
@@ -228,7 +228,7 @@
I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(input, f);
+ data::internal::transform_inplace_tests(input, f);
value::lut_vec<mln_vset(I), mln_result(F)>
lut(input.taken_values(), f);
@@ -237,7 +237,7 @@
for_all(p)
input(p) = lut(input(p));
- trace::exiting("level::impl::transform_inplace_taken");
+ trace::exiting("data::impl::transform_inplace_taken");
}
@@ -246,34 +246,34 @@
transform_inplace_singleton(Image<I>& input_,
const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_inplace_singleton");
+ trace::entering("data::impl::transform_inplace_singleton");
I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(input, f);
+ data::internal::transform_inplace_tests(input, f);
opt::value(input) = f(opt::value(input));
- trace::exiting("level::impl::transform_inplace_singleton");
+ trace::exiting("data::impl::transform_inplace_singleton");
}
template <typename I, typename F>
void
transform_inplace_fastest(Image<I>& ima_, const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_inplace_fastest");
+ trace::entering("data::impl::transform_inplace_fastest");
I& ima = exact(ima_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(ima, f);
+ data::internal::transform_inplace_tests(ima, f);
mln_pixter(I) p(ima);
for_all(p)
p.val() = f(p.val());
- trace::exiting("level::impl::transform_inplace_fastest");
+ trace::exiting("data::impl::transform_inplace_fastest");
}
@@ -282,12 +282,12 @@
transform_inplace_fastest_lowq(Image<I>& input_,
const Function_v2v<F>& f_)
{
- trace::entering("level::impl::transform_inplace_fastest_lowq");
+ trace::entering("data::impl::transform_inplace_fastest_lowq");
I& input = exact(input_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(input, f);
+ data::internal::transform_inplace_tests(input, f);
value::lut_vec<mln_vset(I), mln_result(F)>
lut(input.values_eligible(), f);
@@ -296,7 +296,7 @@
for_all(pi)
pi.val() = lut(pi.val());
- trace::exiting("level::impl::transform_inplace_fastest_lowq");
+ trace::exiting("data::impl::transform_inplace_fastest_lowq");
}
@@ -305,7 +305,7 @@
transform_inplace_fastest(Image<I1>& ima_, const Image<I2>& aux_,
const Function_vv2v<F>& f_)
{
- trace::entering("level::impl::transform_inplace_fastest");
+ trace::entering("data::impl::transform_inplace_fastest");
mlc_is(mln_trait_image_pw_io(I1),
trait::image::pw_io::read_write)::check();
@@ -314,18 +314,18 @@
const I2& aux = exact(aux_);
const F& f = exact(f_);
- level::internal::transform_inplace_tests(ima, aux, f);
+ data::internal::transform_inplace_tests(ima, aux, f);
mln_pixter(I1) pi(ima);
mln_pixter(const I2) pa(aux);
for_all_2(pi, pa)
pi.val() = f(pi.val(), pa.val());
- trace::exiting("level::impl::transform_inplace_fastest");
+ trace::exiting("data::impl::transform_inplace_fastest");
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
@@ -343,7 +343,7 @@
trait::image::quant::any,
Image<I>& ima, const Function_v2v<F>& f)
{
- level::impl::generic::transform_inplace(ima, f);
+ data::impl::generic::transform_inplace(ima, f);
}
template <typename I, typename F>
@@ -352,7 +352,7 @@
trait::image::quant::any,
Image<I>& ima, const Function_v2v<F>& f)
{
- level::impl::transform_inplace_taken(ima, f);
+ data::impl::transform_inplace_taken(ima, f);
}
template <typename I, typename F>
@@ -361,7 +361,7 @@
trait::image::quant::low,
Image<I>& ima, const Function_v2v<F>& f)
{
- level::impl::transform_inplace_lowq(ima, f);
+ data::impl::transform_inplace_lowq(ima, f);
}
@@ -372,7 +372,7 @@
transform_inplace_dispatch_fast(trait::image::quant::any,
Image<I>& ima, const Function_v2v<F>& f)
{
- level::impl::transform_inplace_fastest(ima, f);
+ data::impl::transform_inplace_fastest(ima, f);
}
template <typename I, typename F>
@@ -380,7 +380,7 @@
transform_inplace_dispatch_fast(trait::image::quant::low,
Image<I>& ima, const Function_v2v<F>& f)
{
- level::impl::transform_inplace_fastest_lowq(ima, f);
+ data::impl::transform_inplace_fastest_lowq(ima, f);
}
@@ -404,7 +404,7 @@
trait::image::value_access::any,
Image<I>& ima, const Function_v2v<F>& f)
{
- level::impl::transform_inplace_singleton(ima, f);
+ data::impl::transform_inplace_singleton(ima, f);
}
@@ -444,7 +444,7 @@
Image<I1>& ima, const Image<I2>& aux,
const Function_vv2v<F>& f)
{
- level::impl::generic::transform_inplace(ima, aux, f);
+ data::impl::generic::transform_inplace(ima, aux, f);
}
template <typename I1, typename I2, typename F>
@@ -456,7 +456,7 @@
Image<I1>& ima, const Image<I2>& aux,
const Function_vv2v<F>& f)
{
- level::impl::transform_inplace_fastest(ima, aux, f);
+ data::impl::transform_inplace_fastest(ima, aux, f);
}
template <typename I1, typename I2, typename F>
@@ -471,7 +471,7 @@
ima, aux, f);
}
- } // end of namespace mln::level::internal
+ } // end of namespace mln::data::internal
@@ -481,12 +481,12 @@
void
transform_inplace(Image<I>& ima, const Function_v2v<F>& f)
{
- trace::entering("level::transform_inplace");
+ trace::entering("data::transform_inplace");
internal::transform_inplace_tests(ima, f);
internal::transform_inplace_dispatch(ima, f);
- trace::exiting("level::transform_inplace");
+ trace::exiting("data::transform_inplace");
}
template <typename I1, typename I2, typename F>
@@ -494,18 +494,18 @@
transform_inplace(Image<I1>& ima, const Image<I2>& aux,
const Function_vv2v<F>& f)
{
- trace::entering("level::transform_inplace");
+ trace::entering("data::transform_inplace");
internal::transform_inplace_tests(ima, aux, f);
internal::transform_inplace_dispatch(ima, aux, f);
- trace::exiting("level::transform_inplace");
+ trace::exiting("data::transform_inplace");
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/fast_median.hh
--- mln/data/fast_median.hh (revision 3920)
+++ mln/data/fast_median.hh (working copy)
@@ -28,7 +28,7 @@
#ifndef MLN_LEVEL_FAST_MEDIAN_HH
# define MLN_LEVEL_FAST_MEDIAN_HH
-/*! \file mln/level/fast_median.hh
+/*! \file mln/data/fast_median.hh
*
* \brief Fast Median filtering of an image.
*
@@ -51,7 +51,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/*! Compute in \p output the median filter of image \p input by
@@ -159,7 +159,7 @@
}
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
// facade
@@ -174,7 +174,7 @@
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/compute.hh
--- mln/data/compute.hh (revision 3920)
+++ mln/data/compute.hh (working copy)
@@ -29,11 +29,11 @@
#ifndef MLN_LEVEL_COMPUTE_HH
# define MLN_LEVEL_COMPUTE_HH
-/// \file mln/level/compute.hh
+/// \file mln/data/compute.hh
///
/// Compute an accumulator onto image pixel values.
-# include <mln/level/update.hh>
+# include <mln/data/update.hh>
# include <mln/core/concept/meta_accumulator.hh>
@@ -41,7 +41,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/// Compute an accumulator onto the pixel values of the image \p input.
@@ -50,7 +50,7 @@
/// \param[in] input The input image.
/// \return The accumulator result.
///
- /// It fully relies on level::update.
+ /// It fully relies on data::update.
///
template <typename A, typename I>
mln_result(A)
@@ -79,15 +79,15 @@
mln_result(A)
compute(const Accumulator<A>& a_, const Image<I>& input)
{
- trace::entering("level::compute");
+ trace::entering("data::compute");
A a = exact(a_);
- level::internal::update_tests(a, input);
+ data::internal::update_tests(a, input);
a.init();
- level::internal::update_dispatch(a, input);
+ data::internal::update_dispatch(a, input);
- trace::exiting("level::compute");
+ trace::exiting("data::compute");
return a;
}
@@ -99,12 +99,12 @@
typedef mln_accu_with(A, mln_value(I)) A_;
A_ a_ = accu::unmeta(exact(a), mln_value(I)());
- return level::compute(a_, input); // Call the previous version.
+ return data::compute(a_, input); // Call the previous version.
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/sort_psites.hh
--- mln/data/sort_psites.hh (revision 3920)
+++ mln/data/sort_psites.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_SORT_PSITES_HH
# define MLN_LEVEL_SORT_PSITES_HH
-/// \file mln/level/sort_psites.hh
+/// \file mln/data/sort_psites.hh
/// \brief Sort_Psites the contents of an image into another one.
///
/// \todo Factor code + optimize.
@@ -46,7 +46,7 @@
namespace mln
{
- namespace level
+ namespace data
{
/*! Sort psites the image \p input through a function \p f to set
@@ -210,7 +210,7 @@
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
// Facades.
@@ -237,7 +237,7 @@
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/data/convert.hh
--- mln/data/convert.hh (revision 3920)
+++ mln/data/convert.hh (working copy)
@@ -29,7 +29,7 @@
#ifndef MLN_LEVEL_CONVERT_HH
# define MLN_LEVEL_CONVERT_HH
-/// \file mln/level/convert.hh
+/// \file mln/data/convert.hh
///
/// Convert the contents of an image into another one.
///
@@ -37,13 +37,13 @@
# include <mln/core/routine/duplicate.hh>
# include <mln/fun/v2v/convert.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
namespace mln
{
- namespace level
+ namespace data
{
/// Convert the image \p input by changing the value type.
@@ -71,7 +71,7 @@
(void) input;
}
- } // using namespace mln::level::internal
+ } // using namespace mln::data::internal
namespace impl
{
@@ -84,17 +84,17 @@
mln_ch_value(I, V)
convert(const V& v, const Image<I>& input)
{
- trace::entering("level::impl::generic::convert");
+ trace::entering("data::impl::generic::convert");
internal::convert_tests(v, input);
fun::v2v::convert<V> f;
- mln_ch_value(I, V) output = level::transform(input, f);
+ mln_ch_value(I, V) output = data::transform(input, f);
- trace::exiting("level::impl::generic::convert");
+ trace::exiting("data::impl::generic::convert");
return output;
}
- } // end of namespace mln::level::impl::generic
+ } // end of namespace mln::data::impl::generic
template <typename V, typename I>
@@ -102,17 +102,17 @@
mln_ch_value(I,V)
convert_identity(const V& v, const Image<I>& input)
{
- trace::entering("level::impl::convert_identity");
+ trace::entering("data::impl::convert_identity");
internal::convert_tests(v, input);
mln_concrete(I) output = duplicate(input);
- trace::exiting("level::impl::convert_identity");
+ trace::exiting("data::impl::convert_identity");
return output;
}
- } // end of namespace mln::level::impl
+ } // end of namespace mln::data::impl
namespace internal
{
@@ -147,7 +147,7 @@
v, input);
}
- } // end of namespace mln::level::internal
+ } // end of namespace mln::data::internal
// Facade.
@@ -156,20 +156,20 @@
mln_ch_value(I, V)
convert(const V& v, const Image<I>& input)
{
- trace::entering("level::convert");
+ trace::entering("data::convert");
internal::convert_tests(v, input);
mln_ch_value(I, V) output = internal::convert_dispatch(v, input);
- trace::exiting("level::convert");
+ trace::exiting("data::convert");
return output;
}
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace mln::level
+ } // end of namespace mln::data
} // end of namespace mln
Index: mln/linear/sobel_2d.hh
--- mln/linear/sobel_2d.hh (revision 3927)
+++ mln/linear/sobel_2d.hh (working copy)
@@ -41,7 +41,7 @@
# include <mln/metal/int.hh>
# include <mln/arith/plus.hh>
-# include <mln/level/abs.hh>
+# include <mln/data/abs.hh>
# include <mln/fun/x2v/l1_norm.hh>
# include <mln/fun/vv2v/vec.hh>
# include <mln/linear/convolve_2x1d.hh>
@@ -134,7 +134,7 @@
J h = sobel_2d_h(input),
v = sobel_2d_v(input);
fun::vv2v::vec<mln_value(J)> f;
- mln_ch_convolve_grad(I, int) output = level::transform(h, v, f);
+ mln_ch_convolve_grad(I, int) output = data::transform(h, v, f);
trace::exiting("linear::sobel_2d");
return output;
@@ -151,7 +151,7 @@
typedef mln_ch_convolve_grad(I, int) G;
G grad = sobel_2d(input);
fun::x2v::l1_norm<mln_value(G)> f;
- mln_ch_convolve(I, int) output = level::transform(grad, f);
+ mln_ch_convolve(I, int) output = data::transform(grad, f);
trace::exiting("linear::sobel_2d");
return output;
Index: mln/linear/gaussian.hh
--- mln/linear/gaussian.hh (revision 3927)
+++ mln/linear/gaussian.hh (working copy)
@@ -49,7 +49,7 @@
# include <mln/geom/ninds.hh>
# include <mln/geom/nslis.hh>
# include <mln/data/paste.hh>
-# include <mln/level/stretch.hh>
+# include <mln/data/stretch.hh>
# include <mln/algebra/vec.hh>
@@ -557,7 +557,7 @@
work_img, coef, i);
// Convert work_img into result type
- data::paste(level::stretch(mln_value(I)(), work_img), out);
+ data::paste(data::stretch(mln_value(I)(), work_img), out);
}
template <class I, class F, class O>
@@ -581,7 +581,7 @@
work_img, coef, dir);
// Convert work_img into result type
- data::paste(level::stretch(mln_value(I)(), work_img), out);
+ data::paste(data::stretch(mln_value(I)(), work_img), out);
}
Index: mln/linear/gaussian/impl.hh
--- mln/linear/gaussian/impl.hh (revision 3927)
+++ mln/linear/gaussian/impl.hh (working copy)
@@ -49,7 +49,7 @@
# include <mln/geom/ninds.hh>
# include <mln/geom/nslis.hh>
# include <mln/data/paste.hh>
-# include <mln/level/stretch.hh>
+# include <mln/data/stretch.hh>
# include <mln/algebra/vec.hh>
# include <mln/linear/gaussian/internal/coefficients.hh>
@@ -364,7 +364,7 @@
work_img, coef, i);
// Convert work_img into result type
- data::paste(level::stretch(mln_value(I)(), work_img), out);
+ data::paste(data::stretch(mln_value(I)(), work_img), out);
}
template <class I, class F, class O>
@@ -388,7 +388,7 @@
work_img, coef, dir);
// Convert work_img into result type
- data::paste(level::stretch(mln_value(I)(), work_img), out);
+ data::paste(data::stretch(mln_value(I)(), work_img), out);
}
Index: mln/transform/hough.hh
--- mln/transform/hough.hh (revision 3927)
+++ mln/transform/hough.hh (working copy)
@@ -53,7 +53,7 @@
//FIXME: to be removed. For debug purpose.
-//#include <mln/level/convert.hh>
+//#include <mln/data/convert.hh>
//#include <mln/value/rgb8.hh>
//#include <mln/draw/line.hh>
//#include <mln/literal/colors.hh>
@@ -189,7 +189,7 @@
//
// std::cout << b << " - " << e << std::endl;
//
-// image2d<value::rgb8> toto = level::convert(value::rgb8(), input);
+// image2d<value::rgb8> toto = data::convert(value::rgb8(), input);
// draw::line(toto, b, e, literal::red);
// io::ppm::save(toto, "tmp_input.ppm");
// }
Index: mln/estim/sum.hh
--- mln/estim/sum.hh (revision 3927)
+++ mln/estim/sum.hh (working copy)
@@ -36,7 +36,7 @@
/// \todo Sum works on level so move into mln/level; otherwise on pix then ambiguous.
# include <mln/accu/sum.hh>
-# include <mln/level/compute.hh>
+# include <mln/data/compute.hh>
namespace mln
@@ -70,7 +70,7 @@
mln_sum(mln_value(I)) sum(const Image<I>& input)
{
mln_precondition(exact(input).is_valid());
- return level::compute(accu::meta::sum(), input);
+ return data::compute(accu::meta::sum(), input);
}
template <typename I, typename S>
@@ -79,7 +79,7 @@
{
mln_precondition(exact(input).is_valid());
accu::sum<mln_value(I), S> a;
- result = level::compute(a, input);
+ result = data::compute(a, input);
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/estim/min_max.hh
--- mln/estim/min_max.hh (revision 3927)
+++ mln/estim/min_max.hh (working copy)
@@ -36,7 +36,7 @@
/// \todo Overload while returning an std::pair.
# include <mln/accu/min_max.hh>
-# include <mln/level/compute.hh>
+# include <mln/data/compute.hh>
namespace mln
@@ -65,7 +65,7 @@
{
mln_precondition(exact(input).is_valid());
typedef mln_value(I) V;
- std::pair<V, V> mm = level::compute(accu::meta::min_max(), input);
+ std::pair<V, V> mm = data::compute(accu::meta::min_max(), input);
min = mm.first;
max = mm.second;
}
Index: mln/estim/mean.hh
--- mln/estim/mean.hh (revision 3927)
+++ mln/estim/mean.hh (working copy)
@@ -34,7 +34,7 @@
/// Compute the mean pixel value.
# include <mln/accu/mean.hh>
-# include <mln/level/compute.hh>
+# include <mln/data/compute.hh>
namespace mln
@@ -71,7 +71,7 @@
mln_sum(mln_value(I)) mean(const Image<I>& input)
{
mln_precondition(exact(input).is_valid());
- return level::compute(accu::meta::mean(), input);
+ return data::compute(accu::meta::mean(), input);
}
template <typename S, typename I, typename M>
@@ -80,7 +80,7 @@
{
mln_precondition(exact(input).is_valid());
accu::mean<mln_value(I), S, M> a;
- result = level::compute(a, input);
+ result = data::compute(a, input);
}
# endif // ! MLN_INCLUDE_ONLY
Index: mln/essential/routine.hh
--- mln/essential/routine.hh (revision 3927)
+++ mln/essential/routine.hh (working copy)
@@ -50,7 +50,7 @@
# include <mln/histo/essential.hh>
# include <mln/io/essential.hh>
# include <mln/labeling/essential.hh>
-# include <mln/level/essential.hh>
+# include <mln/data/essential.hh>
# include <mln/linear/essential.hh>
# include <mln/literal/essential.hh>
# include <mln/logical/essential.hh>
Index: mln/binarization/binarization.hh
--- mln/binarization/binarization.hh (revision 3927)
+++ mln/binarization/binarization.hh (working copy)
@@ -34,7 +34,7 @@
/// Threshold the contents of an image into another binary one.
# include <mln/core/concept/function.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
namespace mln
@@ -69,7 +69,7 @@
trace::entering("binarization::impl::binarization_");
mln_concrete_ch_value(I, bool) output(input.domain());
- output = level::transform(input, fun);
+ output = data::transform(input, fun);
trace::exiting("binarization::impl::binarization_");
return output;
Index: mln/morpho/watershed/superpose.hh
--- mln/morpho/watershed/superpose.hh (revision 3927)
+++ mln/morpho/watershed/superpose.hh (working copy)
@@ -35,7 +35,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/image/dmorph/image_if.hh>
-# include <mln/level/convert.hh>
+# include <mln/data/convert.hh>
# include <mln/data/fill.hh>
# include <mln/value/rgb8.hh>
# include <mln/literal/colors.hh>
@@ -96,7 +96,7 @@
mln_precondition(input.is_valid());
mln_precondition(ws_ima.is_valid());
- mln_ch_value(I,value::rgb8) output = level::convert(value::rgb8(), input);
+ mln_ch_value(I,value::rgb8) output = data::convert(value::rgb8(), input);
data::fill((output | (pw::value(ws_ima) == pw::cst(literal::zero))).rw(),
wsl_color);
Index: mln/morpho/tree/compute_parent.hh
--- mln/morpho/tree/compute_parent.hh (revision 3927)
+++ mln/morpho/tree/compute_parent.hh (working copy)
@@ -37,7 +37,7 @@
///
/// \todo Augment and improve documentation.
///
-/// \todo Change level::sort so that the explanations below are valid
+/// \todo Change data::sort so that the explanations below are valid
/// whatever the choice 'increasing or decreasing'.
# include <mln/core/concept/image.hh>
Index: mln/morpho/tree/max.hh
--- mln/morpho/tree/max.hh (revision 3927)
+++ mln/morpho/tree/max.hh (working copy)
@@ -33,7 +33,7 @@
/// Compute a canonized (parenthood) max-tree from an image.
# include <mln/morpho/tree/compute_parent.hh>
-# include <mln/level/sort_psites.hh>
+# include <mln/data/sort_psites.hh>
namespace mln
@@ -72,7 +72,7 @@
mln_precondition(nbh.is_valid());
// For the max-tree, childhood maps "increasing level":
- p_array<mln_psite(I)> s = level::sort_psites_increasing(f);
+ p_array<mln_psite(I)> s = data::sort_psites_increasing(f);
mln_ch_value(I, mln_psite(I)) output = compute_parent(f, nbh, s);
trace::exiting("morpho::tree::max");
Index: mln/morpho/approx/dilation.hh
--- mln/morpho/approx/dilation.hh (revision 3927)
+++ mln/morpho/approx/dilation.hh (working copy)
@@ -35,7 +35,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/routine/duplicate.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/transform/distance_front.hh>
# include <mln/pw/all.hh>
Index: mln/morpho/reconstruction/by_erosion/union_find.hh
--- mln/morpho/reconstruction/by_erosion/union_find.hh (revision 3927)
+++ mln/morpho/reconstruction/by_erosion/union_find.hh (working copy)
@@ -33,8 +33,8 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/data/fill.hh>
-# include <mln/level/compare.hh>
-# include <mln/level/sort_psites.hh>
+# include <mln/data/compare.hh>
+# include <mln/data/sort_psites.hh>
namespace mln
@@ -144,7 +144,7 @@
initialize(deja_vu, f);
data::fill(deja_vu, false);
- s = level::sort_psites_increasing(g);
+ s = data::sort_psites_increasing(g);
}
// First pass.
Index: mln/morpho/reconstruction/by_dilation/union_find.hh
--- mln/morpho/reconstruction/by_dilation/union_find.hh (revision 3927)
+++ mln/morpho/reconstruction/by_dilation/union_find.hh (working copy)
@@ -33,8 +33,8 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/data/fill.hh>
-# include <mln/level/compare.hh>
-# include <mln/level/sort_psites.hh>
+# include <mln/data/compare.hh>
+# include <mln/data/sort_psites.hh>
namespace mln
@@ -145,7 +145,7 @@
initialize(deja_vu, f);
data::fill(deja_vu, false);
- s = level::sort_psites_decreasing(g);
+ s = data::sort_psites_decreasing(g);
}
// First pass.
Index: mln/morpho/min.hh
--- mln/morpho/min.hh (revision 3927)
+++ mln/morpho/min.hh (working copy)
@@ -35,7 +35,7 @@
* (logical and or arithmetical min) of an image.
*/
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/logical/and.hh>
# include <mln/arith/min.hh>
Index: mln/morpho/plus.hh
--- mln/morpho/plus.hh (revision 3927)
+++ mln/morpho/plus.hh (working copy)
@@ -35,7 +35,7 @@
* (logical or or arithmetical plus) of an image.
*/
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/logical/or.hh>
# include <mln/arith/plus.hh>
Index: mln/morpho/minus.hh
--- mln/morpho/minus.hh (revision 3927)
+++ mln/morpho/minus.hh (working copy)
@@ -35,7 +35,7 @@
* not" or arithmetical min) of an image.
*/
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/logical/and_not.hh>
# include <mln/arith/minus.hh>
Index: mln/morpho/complementation.hh
--- mln/morpho/complementation.hh (revision 3927)
+++ mln/morpho/complementation.hh (working copy)
@@ -35,7 +35,7 @@
* (logical or arithmetical) of an image.
*/
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/logical/not.hh>
# include <mln/arith/revert.hh>
Index: mln/morpho/Rd.hh
--- mln/morpho/Rd.hh (revision 3927)
+++ mln/morpho/Rd.hh (working copy)
@@ -41,7 +41,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/trait/value_.hh>
# include <mln/data/fill.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/util/ord.hh>
Index: mln/morpho/includes.hh
--- mln/morpho/includes.hh (revision 3927)
+++ mln/morpho/includes.hh (working copy)
@@ -54,7 +54,7 @@
# include <mln/fun/v2v/saturate.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/data/fill.hh>
# include <mln/test/positive.hh>
Index: mln/morpho/leveling_filter.hh
--- mln/morpho/leveling_filter.hh (revision 3927)
+++ mln/morpho/leveling_filter.hh (working copy)
@@ -39,8 +39,8 @@
# include <mln/trait/accumulators.hh>
-# include <mln/level/sort_psites.hh>
-# include <mln/level/sort_offsets.hh>
+# include <mln/data/sort_psites.hh>
+# include <mln/data/sort_offsets.hh>
# include <mln/canvas/morpho/attribute_filter.hh>
Index: mln/morpho/algebraic_filter.hh
--- mln/morpho/algebraic_filter.hh (revision 3927)
+++ mln/morpho/algebraic_filter.hh (working copy)
@@ -39,8 +39,8 @@
# include <mln/trait/accumulators.hh>
-# include <mln/level/sort_psites.hh>
-# include <mln/level/sort_offsets.hh>
+# include <mln/data/sort_psites.hh>
+# include <mln/data/sort_offsets.hh>
# include <mln/canvas/morpho/attribute_filter.hh>
Index: mln/logical/and.hh
--- mln/logical/and.hh (revision 3927)
+++ mln/logical/and.hh (working copy)
@@ -83,7 +83,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(land, L, R) f;
- mln_ch_fun_vv2v(land, L, R) output = level::transform(lhs, rhs, f);
+ mln_ch_fun_vv2v(land, L, R) output = data::transform(lhs, rhs, f);
trace::exiting("logical::and_");
return output;
@@ -101,7 +101,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(land, L, R) f;
- level::transform_inplace(lhs, rhs, f);
+ data::transform_inplace(lhs, rhs, f);
trace::exiting("logical::and_inplace");
}
Index: mln/logical/and_not.hh
--- mln/logical/and_not.hh (revision 3927)
+++ mln/logical/and_not.hh (working copy)
@@ -83,7 +83,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(land_not, L, R) f;
- mln_ch_fun_vv2v(land_not, L, R) output = level::transform(lhs, rhs, f);
+ mln_ch_fun_vv2v(land_not, L, R) output = data::transform(lhs, rhs, f);
trace::exiting("logical::and_not");
return output;
@@ -101,7 +101,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(land_not, L, R) f;
- level::transform_inplace(lhs, rhs, f);
+ data::transform_inplace(lhs, rhs, f);
trace::exiting("logical::and_not_inplace");
}
Index: mln/logical/includes.hh
--- mln/logical/includes.hh (revision 3927)
+++ mln/logical/includes.hh (working copy)
@@ -32,8 +32,8 @@
# include <mln/core/concept/image.hh>
-# include <mln/level/transform.hh>
-# include <mln/level/transform_inplace.hh>
+# include <mln/data/transform.hh>
+# include <mln/data/transform_inplace.hh>
# include <mln/fun/vv2v/macros.hh>
Index: mln/logical/xor.hh
--- mln/logical/xor.hh (revision 3927)
+++ mln/logical/xor.hh (working copy)
@@ -83,7 +83,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(lxor, L, R) f;
- mln_ch_fun_vv2v(lxor, L, R) output = level::transform(lhs, rhs, f);
+ mln_ch_fun_vv2v(lxor, L, R) output = data::transform(lhs, rhs, f);
trace::exiting("logical::xor_");
return output;
@@ -101,7 +101,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(lxor, L, R) f;
- level::transform_inplace(lhs, rhs, f);
+ data::transform_inplace(lhs, rhs, f);
trace::exiting("logical::xor_inplace");
}
Index: mln/logical/not.hh
--- mln/logical/not.hh (revision 3927)
+++ mln/logical/not.hh (working copy)
@@ -80,7 +80,7 @@
mln_precondition(exact(input).is_valid());
fun::v2b::lnot<mln_value(I)> f;
- mln_concrete(I) output = level::transform(input, f);
+ mln_concrete(I) output = data::transform(input, f);
trace::exiting("logical::not_");
return output;
@@ -95,7 +95,7 @@
mln_precondition(exact(input).is_valid());
fun::v2b::lnot<mln_value(I)> f;
- level::transform_inplace(input, f);
+ data::transform_inplace(input, f);
trace::exiting("logical::not_inplace");
}
Index: mln/logical/or.hh
--- mln/logical/or.hh (revision 3927)
+++ mln/logical/or.hh (working copy)
@@ -83,7 +83,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(lor, L, R) f;
- mln_ch_fun_vv2v(lor, L, R) output = level::transform(lhs, rhs, f);
+ mln_ch_fun_vv2v(lor, L, R) output = data::transform(lhs, rhs, f);
trace::exiting("logical::or_");
return output;
@@ -101,7 +101,7 @@
internal::tests(lhs, rhs);
mln_fun_vv2v(lor, L, R) f;
- level::transform_inplace(lhs, rhs, f);
+ data::transform_inplace(lhs, rhs, f);
trace::exiting("logical::or_inplace");
}
Index: mln/canvas/morpho/attribute_filter.hh
--- mln/canvas/morpho/attribute_filter.hh (revision 3927)
+++ mln/canvas/morpho/attribute_filter.hh (working copy)
@@ -38,14 +38,14 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/concept/accumulator.hh>
-# include <mln/level/sort_offsets.hh>
+# include <mln/data/sort_offsets.hh>
# include <mln/trait/accumulators.hh>
# include <mln/util/pix.hh>
# include <mln/border/get.hh>
# include <mln/data/fill.hh>
# include <mln/extension/adjust_fill.hh>
-# include <mln/level/sort_psites.hh>
+# include <mln/data/sort_psites.hh>
namespace mln
@@ -406,8 +406,8 @@
bool increasing)
{
p_array<mln_psite(I)> s = increasing ?
- level::sort_psites_increasing(input) :
- level::sort_psites_decreasing(input);
+ data::sort_psites_increasing(input) :
+ data::sort_psites_decreasing(input);
return impl::generic::attribute_filter(input, nbh, s, a, lambda);
}
@@ -429,8 +429,8 @@
util::array<unsigned> s =
increasing ?
- level::sort_offsets_increasing(input) :
- level::sort_offsets_decreasing(input);
+ data::sort_offsets_increasing(input) :
+ data::sort_offsets_decreasing(input);
return impl::attribute_filter_fastest(input, nbh, s, a, lambda);
}
Index: mln/canvas/labeling.hh
--- mln/canvas/labeling.hh (revision 3927)
+++ mln/canvas/labeling.hh (working copy)
@@ -42,8 +42,8 @@
# include <mln/convert/to_upper_window.hh>
# include <mln/extension/adjust_fill.hh>
-# include <mln/level/sort_psites.hh>
-# include <mln/level/sort_offsets.hh>
+# include <mln/data/sort_psites.hh>
+# include <mln/data/sort_offsets.hh>
namespace mln
@@ -524,8 +524,8 @@
{
p_array<mln_psite(I)> s =
increasing ?
- level::sort_psites_increasing(input) :
- level::sort_psites_decreasing(input);
+ data::sort_psites_increasing(input) :
+ data::sort_psites_decreasing(input);
return impl::generic::labeling(input, nbh, nlabels, s,
functor);
}
@@ -539,8 +539,8 @@
{
util::array<unsigned> s =
increasing ?
- level::sort_offsets_increasing(input) :
- level::sort_offsets_decreasing(input);
+ data::sort_offsets_increasing(input) :
+ data::sort_offsets_decreasing(input);
return impl::labeling_sorted_fastest(input, nbh, nlabels, s,
functor);
}
Index: mln/labeling/colorize.hh
--- mln/labeling/colorize.hh (revision 3927)
+++ mln/labeling/colorize.hh (working copy)
@@ -37,8 +37,8 @@
# include <mln/fun/i2v/array.hh>
# include <mln/value/rgb8.hh>
# include <mln/literal/black.hh>
-# include <mln/level/transform.hh>
-# include <mln/level/compute.hh>
+# include <mln/data/transform.hh>
+# include <mln/data/compute.hh>
# include <mln/accu/max.hh>
@@ -138,7 +138,7 @@
f(i) = internal::random_color(value);
}
mln_assertion(f.size() >= (label_count));
- mln_ch_value(L, V) output = level::transform(input, f);
+ mln_ch_value(L, V) output = data::transform(input, f);
trace::exiting("labeling::colorize");
return output;
@@ -154,7 +154,7 @@
mln_precondition(exact(input).is_valid());
accu::max<mln_value(L)> accu;
- mln_value(L) nlabels = level::compute(accu, input);
+ mln_value(L) nlabels = data::compute(accu, input);
mln_ch_value(L,V) output = colorize(value, input, nlabels);
Index: mln/labeling/regional_minima.hh
--- mln/labeling/regional_minima.hh (revision 3927)
+++ mln/labeling/regional_minima.hh (working copy)
@@ -37,7 +37,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/canvas/labeling.hh>
# include <mln/data/fill.hh>
-# include <mln/level/sort_psites.hh>
+# include <mln/data/sort_psites.hh>
namespace mln
Index: mln/labeling/regional_maxima.hh
--- mln/labeling/regional_maxima.hh (revision 3927)
+++ mln/labeling/regional_maxima.hh (working copy)
@@ -37,7 +37,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/canvas/labeling.hh>
# include <mln/data/fill.hh>
-# include <mln/level/sort_psites.hh>
+# include <mln/data/sort_psites.hh>
namespace mln
Index: mln/labeling/mean_values.hh
--- mln/labeling/mean_values.hh (revision 3927)
+++ mln/labeling/mean_values.hh (working copy)
@@ -42,7 +42,7 @@
# include <mln/accu/mean.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
# include <mln/labeling/compute.hh>
@@ -119,7 +119,7 @@
convert::from_to(m_3f, m);
m[0] = 150u; //FIXME: handle label 0 correctly.
- mln_concrete(I) output = level::transform(lbl, m);
+ mln_concrete(I) output = data::transform(lbl, m);
trace::exiting("mln::labeling::impl::generic::mean_values");
return output;
@@ -149,7 +149,7 @@
convert::from_to(m_3f, m);
m[0] = literal::yellow; //FIXME: handle label 0 correctly.
- mln_concrete(I) output = level::transform(lbl,
+ mln_concrete(I) output = data::transform(lbl,
convert::to< fun::i2v::array<mln_value(I)> >(m));
Index: mln/labeling/blobs.hh
--- mln/labeling/blobs.hh (revision 3927)
+++ mln/labeling/blobs.hh (working copy)
@@ -36,7 +36,7 @@
///
/// \todo Handle abort in a nice way...
///
-/// \todo Add a 2nd version precising the 'level' to label.
+/// \todo Add a 2nd version precising the 'value' to label.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
Index: mln/labeling/value.spe.hh
--- mln/labeling/value.spe.hh (revision 3920)
+++ mln/labeling/value.spe.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -26,18 +26,18 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_LABELING_LEVEL_SPE_HH
-# define MLN_LABELING_LEVEL_SPE_HH
+#ifndef MLN_LABELING_VALUE_SPE_HH
+# define MLN_LABELING_VALUE_SPE_HH
-/// \file mln/labeling/level.spe.hh
+/// \file mln/labeling/value.spe.hh
///
-/// Specialization for mln::labeling::level.
+/// Specialization for mln::labeling::value.
///
/// \todo Re-activate the fastest version in dispatch...
-# ifndef MLN_LABELING_LEVEL_HH
+# ifndef MLN_LABELING_VALUE_HH
# error "Forbidden inclusion of *.spe.hh"
-# endif // ! MLN_LABELING_LEVEL_HH
+# endif // ! MLN_LABELING_VALUE_HH
# include <mln/extension/adjust_fill.hh>
# include <mln/value/other.hh>
@@ -51,17 +51,17 @@
{
/*! Connected component labeling of the image objects at a given
- * level.
+ * value.
*
* \param[in] input The input image.
- * \param[in] val The level to consider for the labeling.
- * \param[in] nbh The connexity of the level components.
+ * \param[in] val The value to consider for the labeling.
+ * \param[in] nbh The connexity of the value components.
* \param[out] nlabels The number of labels.
* \return The label image.
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
- level(const Image<I>& input, const mln_value(I)& val,
+ value(const Image<I>& input, const mln_value(I)& val,
const Neighborhood<N>& nbh, L& nlabels);
@@ -77,7 +77,7 @@
template <typename I, typename N, typename L>
mln_ch_value(I, L)
- level(const Image<I>& input, const mln_value(I)& val,
+ value(const Image<I>& input, const mln_value(I)& val,
const Neighborhood<N>& nbh,
L& nlabels);
@@ -88,7 +88,7 @@
// Fastest functor.
template <typename I_, typename N_, typename L_>
- struct level_fastest_functor
+ struct value_fastest_functor
{
// requirements from mln::canvas::labeling:
@@ -114,7 +114,7 @@
const mln_value(I_)& val;
- level_fastest_functor(const I_& input, const mln_value(I_)& val,
+ value_fastest_functor(const I_& input, const mln_value(I_)& val,
const N_& nbh)
: input(input),
nbh(nbh),
@@ -128,24 +128,24 @@
template <typename I, typename N, typename L>
mln_ch_value(I, L)
- level_fastest(const Image<I>& input, const mln_value(I)& val,
+ value_fastest(const Image<I>& input, const mln_value(I)& val,
const Neighborhood<N>& nbh,
L& nlabels)
{
- trace::entering("labeling::impl::level_fastest");
+ trace::entering("labeling::impl::value_fastest");
// FIXME: HERE
extension::adjust_fill(input, nbh.delta(), value::other(val));
- typedef level_fastest_functor<I,N,L> F;
+ typedef value_fastest_functor<I,N,L> F;
F f(input, val, nbh);
canvas::labeling_fastest<F> run(f);
nlabels = run.nlabels;
// FIXME: Handle run.status
- trace::exiting("labeling::impl::level_fastest");
+ trace::exiting("labeling::impl::value_fastest");
return run.output;
}
@@ -160,4 +160,4 @@
} // end of namespace mln
-#endif // ! MLN_LABELING_LEVEL_SPE_HH
+#endif // ! MLN_LABELING_VALUE_SPE_HH
Index: mln/labeling/relabel.hh
--- mln/labeling/relabel.hh (revision 3927)
+++ mln/labeling/relabel.hh (working copy)
@@ -38,8 +38,8 @@
# include <mln/make/relabelfun.hh>
-# include <mln/level/transform.hh>
-# include <mln/level/transform_inplace.hh>
+# include <mln/data/transform.hh>
+# include <mln/data/transform_inplace.hh>
# include <mln/value/label.hh>
@@ -188,7 +188,7 @@
internal::relabel_tests(label, nlabels, fv2v);
- mln_concrete(I) output = level::transform(label, fv2v);
+ mln_concrete(I) output = data::transform(label, fv2v);
trace::exiting("labeling::relabel");
return output;
@@ -228,7 +228,7 @@
internal::relabel_inplace_tests(label, nlabels, fv2v);
- level::transform_inplace(label, fv2v);
+ data::transform_inplace(label, fv2v);
trace::exiting("labeling::relabel_inplace");
}
Index: mln/labeling/all.hh
--- mln/labeling/all.hh (revision 3927)
+++ mln/labeling/all.hh (working copy)
@@ -60,11 +60,11 @@
# include <mln/labeling/fill_holes.hh>
# include <mln/labeling/flat_zones.hh>
# include <mln/labeling/foreground.hh>
-# include <mln/labeling/level.hh>
# include <mln/labeling/n_max.hh>
# include <mln/labeling/pack.hh>
# include <mln/labeling/regional_maxima.hh>
# include <mln/labeling/regional_minima.hh>
+# include <mln/labeling/value.hh>
#endif // ! MLN_LABELING_ALL_HH
Index: mln/labeling/wrap.hh
--- mln/labeling/wrap.hh (revision 3927)
+++ mln/labeling/wrap.hh (working copy)
@@ -35,7 +35,7 @@
/// Lmax] (using modulus).
# include <mln/core/concept/image.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
# include <mln/fun/v2v/wrap.hh>
# include <mln/metal/converts_to.hh>
# include <mln/metal/is_a.hh>
@@ -82,7 +82,7 @@
mln_precondition(exact(input).is_valid());
(void) value_type;
- mln_ch_value(I,V) output = level::transform(input, fun::v2v::wrap<V>());
+ mln_ch_value(I,V) output = data::transform(input, fun::v2v::wrap<V>());
trace::exiting("labeling::wrap");
return output;
Index: mln/labeling/foreground.hh
--- mln/labeling/foreground.hh (revision 3927)
+++ mln/labeling/foreground.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -34,7 +34,7 @@
/// Connected component labeling of the object part in a binary
/// image.
-# include <mln/labeling/level.hh>
+# include <mln/labeling/value.hh>
namespace mln
@@ -53,10 +53,10 @@
*
* \pre The input image has to be binary (checked at compile-time).
*
- * This routine actually calls mln::labeling::level with the level
+ * This routine actually calls mln::labeling::value with the
* value set to \c true.
*
- * \see mln::labeling::level
+ * \see mln::labeling::value
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
@@ -79,7 +79,7 @@
mln_precondition(exact(input).is_valid());
mln_precondition(exact(nbh).is_valid());
- mln_ch_value(I, L) output = labeling::level(input, true, nbh, nlabels);
+ mln_ch_value(I, L) output = labeling::value(input, true, nbh, nlabels);
trace::exiting("labeling::foreground");
return output;
Index: mln/labeling/value.hh
--- mln/labeling/value.hh (revision 3920)
+++ mln/labeling/value.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -26,13 +26,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_LABELING_LEVEL_HH
-# define MLN_LABELING_LEVEL_HH
+#ifndef MLN_LABELING_VALUE_HH
+# define MLN_LABELING_VALUE_HH
-/// \file mln/labeling/level.hh
+/// \file mln/labeling/value.hh
///
-/// Connected component labeling of the image objects at a given
-/// level.
+/// Connected component labeling of image sites at a given value.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
@@ -47,18 +46,18 @@
namespace labeling
{
- /*! Connected component labeling of the image objects at a given
- * level.
- *
- * \param[in] input The input image.
- * \param[in] val The level to consider for the labeling.
- * \param[in] nbh The connexity of the level components.
- * \param[out] nlabels The number of labels.
- * \return The label image.
- */
+ /// \brief Connected component labeling of the image sites at a given
+ /// value.
+ ///
+ /// \param[in] input The input image.
+ /// \param[in] val The value to consider.
+ /// \param[in] nbh The connectivity of components.
+ /// \param[out] nlabels The number of labels.
+ /// \return The label image.
+ //
template <typename I, typename N, typename L>
mln_ch_value(I, L)
- level(const Image<I>& input, const mln_value(I)& val,
+ value(const Image<I>& input, const mln_value(I)& val,
const Neighborhood<N>& nbh, L& nlabels);
@@ -72,7 +71,7 @@
template <typename I, typename N, typename L>
void
- level_tests(const Image<I>& input, const mln_value(I)& val, const Neighborhood<N>& nbh,
+ value_tests(const Image<I>& input, const mln_value(I)& val, const Neighborhood<N>& nbh,
L& nlabels)
{
mln_precondition(exact(input).is_valid());
@@ -94,7 +93,7 @@
// Generic functor.
template <typename I>
- struct level_functor
+ struct value_functor
{
typedef mln_psite(I) P;
@@ -127,7 +126,7 @@
// end of Requirements.
- level_functor(const Image<I>& input_, const mln_value(I)& val)
+ value_functor(const Image<I>& input_, const mln_value(I)& val)
: input(exact(input_)),
val(val)
{
@@ -143,18 +142,18 @@
template <typename I, typename N, typename L>
mln_ch_value(I, L)
- level(const Image<I>& input, const mln_value(I)& val, const Neighborhood<N>& nbh,
+ value(const Image<I>& input, const mln_value(I)& val, const Neighborhood<N>& nbh,
L& nlabels)
{
- trace::entering("labeling::level");
+ trace::entering("labeling::value");
- internal::level_tests(input, val, nbh, nlabels);
+ internal::value_tests(input, val, nbh, nlabels);
mln_ch_value(I, L) output;
- impl::level_functor<I> f(input, val);
+ impl::value_functor<I> f(input, val);
output = canvas::labeling_video(input, nbh, nlabels, f);
- trace::exiting("labeling::level");
+ trace::exiting("labeling::value");
return output;
}
@@ -165,4 +164,4 @@
} // end of namespace mln
-#endif // ! MLN_LABELING_LEVEL_HH
+#endif // ! MLN_LABELING_VALUE_HH
Index: mln/labeling/pack.hh
--- mln/labeling/pack.hh (revision 3927)
+++ mln/labeling/pack.hh (working copy)
@@ -38,8 +38,8 @@
# include <mln/make/relabelfun.hh>
-# include <mln/level/compute.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/compute.hh>
+# include <mln/data/transform.hh>
# include <mln/accu/label_used.hh>
@@ -106,11 +106,11 @@
internal::pack_tests(label, new_nlabels);
fun::i2v::array<bool>
- fv2b = level::compute(accu::meta::label_used(), label);
+ fv2b = data::compute(accu::meta::label_used(), label);
mln_value(I) tmp_nlabels = fv2b.size() - 1;
mln_concrete(I)
- output = level::transform(label,
+ output = data::transform(label,
make::relabelfun(fv2b,
tmp_nlabels,
new_nlabels));
@@ -130,10 +130,10 @@
internal::pack_tests(label, new_nlabels);
fun::i2v::array<bool>
- fv2b = level::compute(accu::meta::label_used(), label);
+ fv2b = data::compute(accu::meta::label_used(), label);
mln_value(I) tmp_nlabels = fv2b.size() - 1;
- exact(label) = level::transform(label,
+ exact(label) = data::transform(label,
make::relabelfun(fv2b,
tmp_nlabels,
new_nlabels));
Index: mln/labeling/background.hh
--- mln/labeling/background.hh (revision 3927)
+++ mln/labeling/background.hh (working copy)
@@ -34,7 +34,7 @@
/// Connected component labeling of the background in a binary
/// image.
-# include <mln/labeling/level.hh>
+# include <mln/labeling/value.hh>
namespace mln
@@ -53,10 +53,10 @@
*
* \pre The input image has to be binary (checked at compile-time).
*
- * This routine actually calls mln::labeling::level with the level
+ * This routine actually calls mln::labeling::value with the
* value set to \c false.
*
- * \see mln::labeling::level
+ * \see mln::labeling::value
*/
template <typename I, typename N, typename L>
mln_ch_value(I, L)
@@ -79,7 +79,7 @@
mln_precondition(exact(input).is_valid());
mln_precondition(exact(nbh).is_valid());
- mln_ch_value(I, L) output = labeling::level(input, false, nbh, nlabels);
+ mln_ch_value(I, L) output = labeling::value(input, false, nbh, nlabels);
trace::exiting("labeling::background");
return output;
Index: mln/util/tree_to_image.hh
--- mln/util/tree_to_image.hh (revision 3927)
+++ mln/util/tree_to_image.hh (working copy)
@@ -43,7 +43,7 @@
namespace mln
{
- namespace level
+ namespace data
{
template <typename I, typename D>
void fill(Image<I>& ima, const D& data);
Index: tools/seed2tiling.cc
--- tools/seed2tiling.cc (revision 3927)
+++ tools/seed2tiling.cc (working copy)
@@ -36,7 +36,7 @@
# include <mln/core/image/dmorph/sub_image.hh>
# include <mln/core/alias/neighb2d.hh>
# include <mln/value/int_u8.hh>
-# include <mln/level/stretch.hh>
+# include <mln/data/stretch.hh>
# include <mln/border/fill.hh>
# include <mln/io/pbm/load.hh>
# include <mln/io/pgm/save.hh>
@@ -80,7 +80,7 @@
image2d<unsigned> inte = geom::seeds2tiling(lab, c4());
border::fill(inte, 0);
- image2d<int_u8> inte2 = level::stretch(int_u8(), inte);
+ image2d<int_u8> inte2 = data::stretch(int_u8(), inte);
io::pgm::save(inte2, "ima1.pgm");
std::cout << "ima1 generate with seeds2tiling"
@@ -88,7 +88,7 @@
inte = geom::seeds2tiling_roundness(lab, w_win, max, c4());
border::fill(inte, 0);
- inte2 = level::stretch(int_u8(), inte);
+ inte2 = data::stretch(int_u8(), inte);
io::pgm::save(inte2, "ima2.pgm");
std::cout << "ima2 generate with seeds2tiling_roundness"
Index: tests/topo/skeleton/crest.cc
--- tests/topo/skeleton/crest.cc (revision 3927)
+++ tests/topo/skeleton/crest.cc (working copy)
@@ -32,7 +32,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/image/image2d.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/logical/not.hh>
Index: tests/debug/iota.cc
--- tests/debug/iota.cc (revision 3927)
+++ tests/debug/iota.cc (working copy)
@@ -35,7 +35,7 @@
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
{
Index: tests/world/inter_pixel/compute.cc
--- tests/world/inter_pixel/compute.cc (revision 3927)
+++ tests/world/inter_pixel/compute.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/core/var.hh>
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/world/inter_pixel/immerse.hh>
#include <mln/world/inter_pixel/compute.hh>
Index: tests/world/inter_pixel/immerse.cc
--- tests/world/inter_pixel/immerse.cc (revision 3927)
+++ tests/world/inter_pixel/immerse.cc (working copy)
@@ -31,7 +31,7 @@
#include <mln/core/var.hh>
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/world/inter_pixel/immerse.hh>
Index: tests/world/inter_pixel/dim2/make_edge_image.cc
--- tests/world/inter_pixel/dim2/make_edge_image.cc (revision 3927)
+++ tests/world/inter_pixel/dim2/make_edge_image.cc (working copy)
@@ -35,7 +35,7 @@
#include <mln/value/int_u8.hh>
#include <mln/make/image.hh>
#include <mln/math/abs.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
namespace mln
Index: tests/world/inter_pixel/display_edge.cc
--- tests/world/inter_pixel/display_edge.cc (revision 3927)
+++ tests/world/inter_pixel/display_edge.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/var.hh>
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/world/inter_pixel/immerse.hh>
#include <mln/world/inter_pixel/compute.hh>
#include <mln/world/inter_pixel/display_edge.hh>
Index: tests/world/binary_2d/enlarge.cc
--- tests/world/binary_2d/enlarge.cc (revision 3927)
+++ tests/world/binary_2d/enlarge.cc (working copy)
@@ -1,5 +1,5 @@
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/world/binary_2d/enlarge.hh>
#include <mln/make/image.hh>
#include <mln/value/int_u8.hh>
Index: tests/core/other/clock_test.cc
--- tests/core/other/clock_test.cc (revision 3927)
+++ tests/core/other/clock_test.cc (working copy)
@@ -152,7 +152,7 @@
data::fill(ima, t);
- image2d<unsigned> out = labeling::level(ima, false, c8(), n);
+ image2d<unsigned> out = labeling::value(ima, false, c8(), n);
tmp = testc4(ima, p);
if (tmp != n)
{
@@ -172,11 +172,11 @@
/// 0 before
data::fill(ima, u);
- out = labeling::level(ima, false, c4(), m);
+ out = labeling::value(ima, false, c4(), m);
/// 1 after
data::fill(ima, t);
- image2d<unsigned> out2 = labeling::level(ima, false, c4(), n);
+ image2d<unsigned> out2 = labeling::value(ima, false, c4(), n);
int diff = n - m;
if (diff < 0)
Index: tests/core/image/sparse_image.cc
--- tests/core/image/sparse_image.cc (revision 3927)
+++ tests/core/image/sparse_image.cc (working copy)
@@ -37,9 +37,9 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/blobs.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <mln/core/image/sparse_encode.hh>
@@ -69,7 +69,7 @@
c4(), n);
sparse_image<point2d, int_u8> sparse =
- sparse_encode(level::transform(labels, fold_t()));
+ sparse_encode(data::transform(labels, fold_t()));
std::cout << n << ", compression ratio: " << sparse.compression()
<< std::endl;
@@ -77,5 +77,5 @@
data::fill(cmp, literal::zero);
data::paste(sparse, cmp);
- mln_assertion(cmp == level::transform(labels, fold_t()));
+ mln_assertion(cmp == data::transform(labels, fold_t()));
}
Index: tests/core/image/obased_rle_image.cc
--- tests/core/image/obased_rle_image.cc (revision 3927)
+++ tests/core/image/obased_rle_image.cc (working copy)
@@ -37,9 +37,9 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/blobs.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <mln/core/image/obased_rle_encode.hh>
@@ -69,12 +69,12 @@
c4(), n);
obased_rle_image<point2d, int_u8> rle =
- obased_rle_encode(level::transform(labels, fold_t()));
+ obased_rle_encode(data::transform(labels, fold_t()));
std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
data::fill(cmp, literal::zero);
data::paste(rle, cmp);
- mln_assertion(cmp == level::transform(labels, fold_t()));
+ mln_assertion(cmp == data::transform(labels, fold_t()));
}
Index: tests/core/image/plain.cc
--- tests/core/image/plain.cc (revision 3927)
+++ tests/core/image/plain.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/core/image/imorph/plain.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/data/fill.hh>
Index: tests/core/image/value_enc_image.cc
--- tests/core/image/value_enc_image.cc (revision 3927)
+++ tests/core/image/value_enc_image.cc (working copy)
@@ -39,9 +39,9 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/blobs.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <mln/core/alias/p_runs2d.hh>
@@ -144,14 +144,14 @@
c4(), n);
value_enc_image<point2d, int_u8> val_enc =
- value_encode(level::transform(labels, fold_t()));
+ value_encode(data::transform(labels, fold_t()));
data::fill(cmp, literal::zero);
data::paste(val_enc, cmp);
std::cout << val_enc.values().size() << std::endl;
- mln_assertion(cmp == level::transform(labels, fold_t()));
+ mln_assertion(cmp == data::transform(labels, fold_t()));
//io::pgm::save(cmp, "output.pgm");
- //io::pgm::save(level::transform(labels, fold_t()), "output2.pgm");
+ //io::pgm::save(data::transform(labels, fold_t()), "output2.pgm");
}
}
Index: tests/core/image/dmorph/slice_image.cc
--- tests/core/image/dmorph/slice_image.cc (revision 3927)
+++ tests/core/image/dmorph/slice_image.cc (working copy)
@@ -35,7 +35,7 @@
#include <mln/core/image/dmorph/slice_image.hh>
#include <mln/debug/iota.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/core/image/fi_adaptor.cc
--- tests/core/image/fi_adaptor.cc (revision 3927)
+++ tests/core/image/fi_adaptor.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/value/rgb8.hh>
#include <mln/data/paste.hh>
-#include <mln/level/median.hh>
+#include <mln/data/median.hh>
#include <mln/display/show.hh>
#include <mln/display/save.hh>
@@ -73,7 +73,7 @@
image2d<int_u8> ima(adaptor.domain());
- level::median(adaptor, rect, ima);
+ data::median(adaptor, rect, ima);
data::paste(ima, adaptor);
Index: tests/core/image/mono_rle_image.cc
--- tests/core/image/mono_rle_image.cc (revision 3927)
+++ tests/core/image/mono_rle_image.cc (working copy)
@@ -37,9 +37,9 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/blobs.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <mln/core/image/mono_rle_encode.hh>
@@ -75,12 +75,12 @@
c4(), n);
mono_rle_image<point2d, int_u8> rle =
- mono_rle_encode(level::transform(labels, fold_t()), 2);
+ mono_rle_encode(data::transform(labels, fold_t()), 2);
std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
data::fill(cmp, literal::zero);
data::paste(rle, cmp);
- mln_assertion(cmp == level::transform(labels, only_two_t()));
+ mln_assertion(cmp == data::transform(labels, only_two_t()));
}
Index: tests/core/image/rle_image.cc
--- tests/core/image/rle_image.cc (revision 3927)
+++ tests/core/image/rle_image.cc (working copy)
@@ -37,9 +37,9 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/blobs.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <mln/core/image/rle_encode.hh>
@@ -69,12 +69,12 @@
c4(), n);
rle_image<point2d, int_u8> rle =
- rle_encode(level::transform(labels, fold_t()));
+ rle_encode(data::transform(labels, fold_t()));
std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
data::fill(cmp, literal::zero);
data::paste(rle, cmp);
- mln_assertion(cmp == level::transform(labels, fold_t()));
+ mln_assertion(cmp == data::transform(labels, fold_t()));
}
Index: tests/core/image/vmorph/cast_image.cc
--- tests/core/image/vmorph/cast_image.cc (revision 3927)
+++ tests/core/image/vmorph/cast_image.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/image/vmorph/cast_image.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/make/image2d.hh>
#include <mln/data/fill.hh>
Index: tests/core/image/mono_obased_rle_image.cc
--- tests/core/image/mono_obased_rle_image.cc (revision 3927)
+++ tests/core/image/mono_obased_rle_image.cc (working copy)
@@ -37,9 +37,9 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/blobs.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <mln/core/image/mono_obased_rle_encode.hh>
@@ -69,12 +69,12 @@
c4(), n);
mono_obased_rle_image<point2d, int_u8> rle =
- mono_obased_rle_encode(level::transform(labels, fold_t()));
+ mono_obased_rle_encode(data::transform(labels, fold_t()));
std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
data::fill(cmp, literal::zero);
data::paste(rle, cmp);
- mln_assertion(cmp == level::transform(labels, fold_t()));
+ mln_assertion(cmp == data::transform(labels, fold_t()));
}
Index: tests/draw/graph.cc
--- tests/draw/graph.cc (revision 3927)
+++ tests/draw/graph.cc (working copy)
@@ -42,7 +42,7 @@
#include <mln/core/site_set/p_vertices.hh>
#include <mln/core/site_set/p_vertices_psite.hh>
#include <mln/debug/draw_graph.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
/// Set of 2-D points.
Index: tests/draw/line.cc
--- tests/draw/line.cc (revision 3927)
+++ tests/draw/line.cc (working copy)
@@ -37,7 +37,7 @@
#include <mln/data/fill.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/draw/line.hh>
#include <mln/debug/println.hh>
Index: tests/opt/at.cc
--- tests/opt/at.cc (revision 3927)
+++ tests/opt/at.cc (working copy)
@@ -43,7 +43,7 @@
#include <mln/data/fill.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/opt/at.hh>
Index: tests/transformation/rotate.cc
--- tests/transformation/rotate.cc (revision 3927)
+++ tests/transformation/rotate.cc (working copy)
@@ -32,7 +32,7 @@
# include <mln/core/image/image2d.hh>
# include <mln/transformation/rotate.hh>
# include <mln/make/image.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
int main()
{
Index: tests/arith/minus.cc
--- tests/arith/minus.cc (revision 3927)
+++ tests/arith/minus.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/arith/minus.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
{
Index: tests/arith/diff_abs.cc
--- tests/arith/diff_abs.cc (revision 3927)
+++ tests/arith/diff_abs.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/arith/diff_abs.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
{
Index: tests/arith/times.cc
--- tests/arith/times.cc (revision 3927)
+++ tests/arith/times.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/arith/times.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
{
Index: tests/arith/plus.cc
--- tests/arith/plus.cc (revision 3927)
+++ tests/arith/plus.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/arith/plus.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
{
@@ -67,7 +67,7 @@
// #include <mln/arith/plus.hh>
// #include <mln/arith/times.hh>
-// #include <mln/level/compare.hh>
+// #include <mln/data/compare.hh>
// #include <mln/fun/v2v/cast.hh>
// #include <mln/debug/iota.hh>
Index: tests/arith/revert.cc
--- tests/arith/revert.cc (revision 3927)
+++ tests/arith/revert.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/debug/iota.hh>
#include <mln/arith/revert.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/debug/println.hh>
int main()
Index: tests/data/transform_full.cc
--- tests/data/transform_full.cc (revision 3920)
+++ tests/data/transform_full.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/transform_full.cc
+/// \file tests/data/transform_full.cc
///
-/// Tests on mln::level::transform
+/// Tests on mln::data::transform
#include <cmath>
@@ -49,7 +49,7 @@
#include <mln/value/int_s16.hh>
#include <mln/data/fill.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/debug/iota.hh>
@@ -78,7 +78,7 @@
mln_ch_value(I, mln_result_(mysqrt)) out;
{
- out = level::transform(ref, mysqrt());
+ out = data::transform(ref, mysqrt());
mln_piter(I) p (ref.domain ());
for_all(p)
mln_assertion ((mln_value(I))(ref(p) % 42) == out(p) );
@@ -148,7 +148,7 @@
{
using namespace mln;
- std::cerr << "Tests level::transform:" << std::endl;
+ std::cerr << "Tests data::transform:" << std::endl;
std::cerr << "on int:" << std::endl;
chk<int>();
std::cerr << "on unsigned:" << std::endl;
Index: tests/data/median.cc
--- tests/data/median.cc (revision 3920)
+++ tests/data/median.cc (working copy)
@@ -26,19 +26,19 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/median.cc
+/// \file tests/data/median.cc
///
-/// Test on mln::level::median.
+/// Test on mln::data::median.
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/win/rectangle2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/median.hh>
+#include <mln/data/median.hh>
#include "tests/data.hh"
@@ -52,15 +52,15 @@
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
{
win::rectangle2d rect(51, 51);
- image2d<int_u8> out = level::median(lena, rect);
+ image2d<int_u8> out = data::median(lena, rect);
io::pgm::save(out, "out_rect.pgm");
}
{
win::rectangle2d rect(1, 51);
win::hline2d line(51);
image2d<int_u8>
- ref = level::median(lena, rect),
- out = level::median(lena, line);
+ ref = data::median(lena, rect),
+ out = data::median(lena, line);
mln_assertion(out == ref);
io::pgm::save(out, "out_line.pgm");
}
Index: tests/data/compute_full.cc
--- tests/data/compute_full.cc (revision 3920)
+++ tests/data/compute_full.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/compute_full.cc
+/// \file tests/data/compute_full.cc
///
-/// Tests on mln::level::compute.
+/// Tests on mln::data::compute.
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
@@ -47,7 +47,7 @@
#include <mln/accu/max.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
-#include <mln/level/compute.hh>
+#include <mln/data/compute.hh>
@@ -116,8 +116,8 @@
accu::min<I> acu_min;
accu::max<I> acu_max;
- I min = level::compute(acu_min, ima);
- I max = level::compute(acu_max, ima);
+ I min = data::compute(acu_min, ima);
+ I max = data::compute(acu_max, ima);
mln_assertion(min == real_min);
mln_assertion(max == real_max);
}
@@ -128,8 +128,8 @@
accu::min<I> acu_min;
accu::max<I> acu_max;
- I min = level::compute(acu_min, sub_ima);
- I max = level::compute(acu_max, sub_ima);
+ I min = data::compute(acu_min, sub_ima);
+ I max = data::compute(acu_max, sub_ima);
mln_assertion(min == real_min2);
mln_assertion(max == real_max2);
}
@@ -141,8 +141,8 @@
accu::min<I> acu_min;
accu::max<I> acu_max;
- I min = level::compute(acu_min, if_ima);
- I max = level::compute(acu_max, if_ima);
+ I min = data::compute(acu_min, if_ima);
+ I max = data::compute(acu_max, if_ima);
mln_assertion(min == real_min2);
mln_assertion(max == real_max2);
}
@@ -176,8 +176,8 @@
accu::min<I> acu_min;
accu::max<I> acu_max;
- I min = level::compute(acu_min, ima);
- I max = level::compute(acu_max, ima);
+ I min = data::compute(acu_min, ima);
+ I max = data::compute(acu_max, ima);
mln_assertion(min == real_min);
mln_assertion(max == real_max);
@@ -206,8 +206,8 @@
accu::min<I> acu_min;
accu::max<I> acu_max;
- I min = level::compute(acu_min, ima);
- I max = level::compute(acu_max, ima);
+ I min = data::compute(acu_min, ima);
+ I max = data::compute(acu_max, ima);
mln_assertion(min == real_min);
mln_assertion(max == real_max);
@@ -231,7 +231,7 @@
unsigned cols_end = 256;
- std::cerr << "Tests level::compute:" << std::endl;
+ std::cerr << "Tests data::compute:" << std::endl;
(std::cerr << "in 1d ... ").flush ();
{
Index: tests/data/all_headers.cc
--- tests/data/all_headers.cc (revision 3920)
+++ tests/data/all_headers.cc (working copy)
@@ -25,12 +25,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/all_headers.cc
+/*! \file tests/data/all_headers.cc
*
- * \brief Tests on mln::level.
+ * \brief Tests on mln::data.
*/
-#include <mln/level/all.hh>
+#include <mln/data/all.hh>
int main()
{
Index: tests/data/abs.cc
--- tests/data/abs.cc (revision 3920)
+++ tests/data/abs.cc (working copy)
@@ -25,13 +25,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/abs.cc
+/*! \file tests/data/abs.cc
*
- * \brief Tests on mln::level::abs.
+ * \brief Tests on mln::data::abs.
*/
# include <mln/core/image/image2d.hh>
-# include <mln/level/abs.hh>
+# include <mln/data/abs.hh>
int main()
{
@@ -53,7 +53,7 @@
image2d<int> ima(make::image(vs));
image2d<int> out(ima.domain());
- level::abs(ima, out);
+ data::abs(ima, out);
box_fwd_piter_<point2d> p(ima.domain());
for_all (p)
mln_assertion (out(p) >= 0);
Index: tests/data/transform_inplace.cc
--- tests/data/transform_inplace.cc (revision 3920)
+++ tests/data/transform_inplace.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/transform_inplace.cc
+/// \file tests/data/transform_inplace.cc
///
-/// Tests on mln::level::transform_inplace.
+/// Tests on mln::data::transform_inplace.
#include <mln/core/image/image1d.hh>
@@ -46,8 +46,8 @@
#include <mln/debug/iota.hh>
-#include <mln/level/transform_inplace.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/transform_inplace.hh>
+#include <mln/data/compare.hh>
@@ -64,8 +64,8 @@
debug::iota(ref);
image2d<T> ima = duplicate(ref);
- level::transform_inplace(ima, fun::v2v::inc<T>());
- level::transform_inplace(ima, fun::v2v::dec<T>());
+ data::transform_inplace(ima, fun::v2v::inc<T>());
+ data::transform_inplace(ima, fun::v2v::dec<T>());
mln_assertion(ima == ref);
}
@@ -77,8 +77,8 @@
debug::iota(ref);
image1d<T> ima = duplicate(ref);
- level::transform_inplace(ima, fun::v2v::inc<T>());
- level::transform_inplace(ima, fun::v2v::dec<T>());
+ data::transform_inplace(ima, fun::v2v::inc<T>());
+ data::transform_inplace(ima, fun::v2v::dec<T>());
mln_assertion(ima == ref);
}
@@ -91,8 +91,8 @@
debug::iota(ref);
image3d<T> ima = duplicate(ref);
- level::transform_inplace(ima, fun::v2v::inc<T>());
- level::transform_inplace(ima, fun::v2v::dec<T>());
+ data::transform_inplace(ima, fun::v2v::inc<T>());
+ data::transform_inplace(ima, fun::v2v::dec<T>());
mln_assertion(ima == ref);
}
@@ -104,8 +104,8 @@
ref(5, make::box2d(size, size)),
ima(5, make::box2d(size, size));
- level::transform_inplace(ima, fun::v2v::inc<T>());
- level::transform_inplace(ima, fun::v2v::dec<T>());
+ data::transform_inplace(ima, fun::v2v::inc<T>());
+ data::transform_inplace(ima, fun::v2v::dec<T>());
mln_assertion(ima == ref);
}
@@ -123,8 +123,8 @@
I ima = duplicate(ref);
II ima_if = ima | fun::p2b::chess();
- level::transform_inplace(ima_if, fun::v2v::inc<T>());
- level::transform_inplace(ima_if, fun::v2v::dec<T>());
+ data::transform_inplace(ima_if, fun::v2v::inc<T>());
+ data::transform_inplace(ima_if, fun::v2v::dec<T>());
mln_assertion(ima_if == ref_if);
}
@@ -142,8 +142,8 @@
I ima = duplicate(ref);
II sub_ima(ima, make::box2d(4,4, 10,10));
- level::transform_inplace(sub_ima, fun::v2v::inc<int>());
- level::transform_inplace(sub_ima, fun::v2v::dec<int>());
+ data::transform_inplace(sub_ima, fun::v2v::inc<int>());
+ data::transform_inplace(sub_ima, fun::v2v::dec<int>());
mln_assertion(sub_ima == sub_ref);
}
@@ -159,8 +159,8 @@
I ima = duplicate(ref);
II extend_ima(ima, 5);
- level::transform_inplace(extend_ima, fun::v2v::inc<T>());
- level::transform_inplace(extend_ima, fun::v2v::dec<T>());
+ data::transform_inplace(extend_ima, fun::v2v::inc<T>());
+ data::transform_inplace(extend_ima, fun::v2v::dec<T>());
mln_assertion(extend_ima == ref);
Index: tests/data/apply_full.cc
--- tests/data/apply_full.cc (revision 3920)
+++ tests/data/apply_full.cc (working copy)
@@ -25,9 +25,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/apply_full.cc
+/*! \file tests/data/apply_full.cc
*
- * \brief Tests on mln::level::apply.
+ * \brief Tests on mln::data::apply.
*/
#include <mln/core/image/image1d.hh>
@@ -41,7 +41,7 @@
#include <mln/core/routine/duplicate.hh>
-#include <mln/level/apply.hh>
+#include <mln/data/apply.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
@@ -67,7 +67,7 @@
mln_piter(I) p (ref.domain ());
{
- level::apply(out, qrde());
+ data::apply(out, qrde());
for_all(p)
mln_assertion((mln_value(I))(ref(p) % 42) == out(p));
@@ -122,7 +122,7 @@
unsigned cols_end = 256;
- std::cerr << "Tests level::apply" << std::endl;
+ std::cerr << "Tests data::apply" << std::endl;
(std::cerr << "in 1d ... ").flush ();
{
Index: tests/data/median_fast.cc
--- tests/data/median_fast.cc (revision 3920)
+++ tests/data/median_fast.cc (working copy)
@@ -25,9 +25,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/median_fast.cc
+/*! \file tests/data/median_fast.cc
*
- * \brief Test on mln::level::fast_median.
+ * \brief Test on mln::data::fast_median.
*/
#include <mln/core/image/image2d.hh>
@@ -39,7 +39,7 @@
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
-#include <mln/level/fast_median.hh>
+#include <mln/data/fast_median.hh>
#include <mln/core/dpoints_pixter.hh>
#include <mln/core/pixel.hh>
@@ -100,7 +100,7 @@
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> out(lena.domain());
- level::fast_median(lena, rect, out);
+ data::fast_median(lena, rect, out);
io::pgm::save(out, "out.pgm");
}
Index: tests/data/compute.cc
--- tests/data/compute.cc (revision 3920)
+++ tests/data/compute.cc (working copy)
@@ -26,12 +26,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/compute.cc
+/// \file tests/data/compute.cc
///
-/// Tests on mln::level::compute.
+/// Tests on mln::data::compute.
#include <mln/core/image/image2d.hh>
-#include <mln/level/compute.hh>
+#include <mln/data/compute.hh>
#include <mln/debug/iota.hh>
#include <mln/accu/min.hh>
#include <mln/accu/max.hh>
@@ -46,10 +46,10 @@
debug::iota(ima);
accu::min<int> m;
- int min = level::compute(m, ima);
+ int min = data::compute(m, ima);
mln_assertion(min == 1);
accu::max<int> M;
- int max = level::compute(M, ima);
+ int max = data::compute(M, ima);
mln_assertion(max == 40000);
}
Index: tests/data/sort_psites.cc
--- tests/data/sort_psites.cc (revision 3920)
+++ tests/data/sort_psites.cc (working copy)
@@ -26,13 +26,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/sort_psites.cc
+/// \file tests/data/sort_psites.cc
///
-/// Tests on mln::level::sort_psites.
+/// Tests on mln::data::sort_psites.
#include <mln/core/image/image2d.hh>
#include <mln/make/image2d.hh>
-#include <mln/level/sort_psites.hh>
+#include <mln/data/sort_psites.hh>
#include <mln/core/site_set/p_array.hh>
@@ -44,8 +44,8 @@
2, 2, 2,
0, 1, 4 };
image2d<int> ima = make::image2d(vals);
- p_array<point2d> array_inc = level::sort_psites_increasing(ima);
- p_array<point2d> array_dec = level::sort_psites_decreasing(ima);
+ p_array<point2d> array_inc = data::sort_psites_increasing(ima);
+ p_array<point2d> array_dec = data::sort_psites_decreasing(ima);
{
p_array<point2d>::fwd_piter p1(array_inc);
Index: tests/data/convert.cc
--- tests/data/convert.cc (revision 3920)
+++ tests/data/convert.cc (working copy)
@@ -26,13 +26,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/convert.cc
+/// \file tests/data/convert.cc
///
-/// Tests on mln::level::convert
+/// Tests on mln::data::convert
#include <mln/core/image/image2d.hh>
-#include <mln/level/convert.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/convert.hh>
+#include <mln/data/compare.hh>
#include <mln/value/rgb8.hh>
#include <mln/literal/grays.hh>
@@ -49,7 +49,7 @@
image2d<bool> ima(1, 2);
opt::at(ima, 0, 0) = false;
opt::at(ima, 0, 1) = true;
- image2d<rgb8> out = level::convert(rgb8(), ima);
+ image2d<rgb8> out = data::convert(rgb8(), ima);
mln_assertion(opt::at(out, 0, 0) == literal::black);
mln_assertion(opt::at(out, 0, 1) == literal::white);
}
@@ -58,7 +58,7 @@
image2d<bool> ima(1, 2);
data::fill(ima, true);
opt::at(ima, 0, 0) = false;
- image2d<bool> out = level::convert(bool(), ima);
+ image2d<bool> out = data::convert(bool(), ima);
mln_assertion(out == ima);
mln_assertion(out.buffer() != ima.buffer());
}
Index: tests/data/update.cc
--- tests/data/update.cc (revision 3920)
+++ tests/data/update.cc (working copy)
@@ -25,14 +25,14 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/update.cc
+/*! \file tests/data/update.cc
*
- * \brief Tests on mln::level::update.
+ * \brief Tests on mln::data::update.
*/
#include <mln/core/image/image2d.hh>
-#include <mln/level/update.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/update.hh>
+#include <mln/data/compare.hh>
#include <mln/debug/iota.hh>
#include <mln/accu/min.hh>
#include <mln/accu/max.hh>
@@ -48,8 +48,8 @@
accu::max<int> M;
debug::iota(ima);
- level::update(m, ima);
- level::update(M, ima);
+ data::update(m, ima);
+ data::update(M, ima);
mln_assertion(m == 1);
mln_assertion(M == 40000);
Index: tests/data/fill_with_image.cc
--- tests/data/fill_with_image.cc (revision 3927)
+++ tests/data/fill_with_image.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/data/fill_with_value.hh>
#include <mln/data/fill_with_image.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
Index: tests/data/approx/median.cc
--- tests/data/approx/median.cc (revision 3927)
+++ tests/data/approx/median.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/approx/median.cc
+/// \file tests/data/approx/median.cc
///
-/// Test on mln::level::approx::median.
+/// Test on mln::data::approx::median.
#include <mln/core/image/image2d.hh>
@@ -36,7 +36,7 @@
#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/approx/median.hh>
+#include <mln/data/approx/median.hh>
#include "tests/data.hh"
@@ -51,12 +51,12 @@
{
win::octagon2d oct(49);
- image2d<int_u8> out = level::approx::median(lena, oct);
+ image2d<int_u8> out = data::approx::median(lena, oct);
io::pgm::save(out, "out_oct.pgm");
}
{
win::rectangle2d rec(51, 51);
- image2d<int_u8> out = level::approx::median(lena, rec);
+ image2d<int_u8> out = data::approx::median(lena, rec);
io::pgm::save(out, "out_rec.pgm");
}
}
Index: tests/data/abs_full.cc
--- tests/data/abs_full.cc (revision 3920)
+++ tests/data/abs_full.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/abs_full.cc
+/// \file tests/data/abs_full.cc
///
-/// Tests on mln::level::abs.
+/// Tests on mln::data::abs.
#include <mln/core/image/image1d.hh>
@@ -48,7 +48,7 @@
#include <mln/debug/iota.hh>
#include <mln/arith/times.hh>
-#include <mln/level/abs.hh>
+#include <mln/data/abs.hh>
@@ -103,7 +103,7 @@
const I& ref = exact(ref_);
I out (ref.domain ());
- level::abs(ref, out);
+ data::abs(ref, out);
mln_piter(I) p (ref.domain ());
for_all(p)
if (ref(p) > 0)
@@ -175,7 +175,7 @@
{
using namespace mln;
- std::cerr << "Tests level::abs:" << std::endl;
+ std::cerr << "Tests data::abs:" << std::endl;
std::cerr << "on int:" << std::endl;
chk<int>(4, 16, 64);
std::cerr << "on int_s8:" << std::endl;
Index: tests/data/paste_full.cc
--- tests/data/paste_full.cc (revision 3927)
+++ tests/data/paste_full.cc (working copy)
@@ -51,7 +51,7 @@
#include <mln/debug/iota.hh>
-#include <mln/level/saturate.hh>
+#include <mln/data/saturate.hh>
#include <mln/data/paste.hh>
@@ -111,7 +111,7 @@
J& output = exact(output_);
if (max_i > max_j)
- level::saturate_inplace(input, 0, (T)max_j);
+ data::saturate_inplace(input, 0, (T)max_j);
data::paste(input, output);
Index: tests/data/stretch_full.cc
--- tests/data/stretch_full.cc (revision 3920)
+++ tests/data/stretch_full.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/stretch_full.cc
+/// \file tests/data/stretch_full.cc
///
-/// Tests on mln::level::stretch.
+/// Tests on mln::data::stretch.
///
/// \todo Make it pass.
@@ -42,8 +42,8 @@
#include <mln/value/int_s16.hh>
#include <mln/debug/iota.hh>
-#include <mln/level/saturate.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/saturate.hh>
+#include <mln/data/stretch.hh>
@@ -55,7 +55,7 @@
{
I& input = exact(input_);
J& output = exact(output_);
- output = level::stretch(mln_value(J)(), input);
+ output = data::stretch(mln_value(J)(), input);
}
template <typename I, typename J>
@@ -149,7 +149,7 @@
unsigned rows = 4;
unsigned cols = 16;
- std::cerr << "Tests level::stretch:" << std::endl;
+ std::cerr << "Tests data::stretch:" << std::endl;
std::cerr << "on int:" << std::endl;
ch<int>(slis, rows, cols);
std::cerr << "on unsigned:" << std::endl;
Index: tests/data/compare_full.cc
--- tests/data/compare_full.cc (revision 3920)
+++ tests/data/compare_full.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/compare_full.cc
+/// \file tests/data/compare_full.cc
///
-/// Tests on mln::level::compare.
+/// Tests on mln::data::compare.
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
@@ -39,7 +39,7 @@
#include <mln/value/int_s8.hh>
#include <mln/value/int_s16.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/debug/iota.hh>
#include <mln/arith/plus.hh>
@@ -210,7 +210,7 @@
unsigned cols_start = 1;
unsigned cols_end = 32;
- std::cerr << "Tests level::compare" << std::endl;
+ std::cerr << "Tests data::compare" << std::endl;
(std::cerr << "in 1d ... ").flush ();
{
Index: tests/data/saturate_full.cc
--- tests/data/saturate_full.cc (revision 3920)
+++ tests/data/saturate_full.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/saturate_full.cc
+/// \file tests/data/saturate_full.cc
///
-/// Tests on mln::level::saturate.
+/// Tests on mln::data::saturate.
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
@@ -41,7 +41,7 @@
#include <mln/core/routine/duplicate.hh>
-#include <mln/level/saturate.hh>
+#include <mln/data/saturate.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
@@ -62,7 +62,7 @@
mln_piter(I) p (ref.domain ());
{
- level::saturate(ref, min, max, out);
+ data::saturate(ref, min, max, out);
for_all(p)
{
@@ -81,7 +81,7 @@
}
{
- level::saturate_inplace(ref, min, max);
+ data::saturate_inplace(ref, min, max);
for_all(p)
{
@@ -150,7 +150,7 @@
unsigned cols_end = 6;
- std::cerr << "Tests level::saturate" << std::endl;
+ std::cerr << "Tests data::saturate" << std::endl;
(std::cerr << "in 1d ... ").flush ();
{
Index: tests/data/transform.cc
--- tests/data/transform.cc (revision 3920)
+++ tests/data/transform.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/transform.cc
+/// \file tests/data/transform.cc
///
-/// Tests on mln::level::transform.
+/// Tests on mln::data::transform.
#include <cmath>
@@ -44,7 +44,7 @@
#include <mln/data/fill.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
#include <mln/core/var.hh>
@@ -79,7 +79,7 @@
image1d<unsigned short> out(size);
debug::iota(ima);
- out = level::transform(ima, mysqrt());
+ out = data::transform(ima, mysqrt());
box_fwd_piter_<point1d> p(out.domain());
for_all(p)
@@ -93,7 +93,7 @@
image2d<unsigned short> out(size, size);
debug::iota(ima);
- out = level::transform(ima, mysqrt());
+ out = data::transform(ima, mysqrt());
box_fwd_piter_<point2d> p(out.domain());
for_all(p)
@@ -105,7 +105,7 @@
image2d<unsigned short> ima(size, size);
data::fill_with_value(ima, 51);
- level::transform(ima, mysqrt());
+ data::transform(ima, mysqrt());
}
@@ -115,7 +115,7 @@
image3d<unsigned short> out(size, size, size);
debug::iota(ima);
- out = level::transform(ima, mysqrt());
+ out = data::transform(ima, mysqrt());
box_fwd_piter_<point3d> p(out.domain());
for_all(p)
@@ -129,7 +129,7 @@
image2d<unsigned short> out(8, 8);
data::fill(out, (short unsigned int)0);
- out = level::transform(ima, mysqrt());
+ out = data::transform(ima, mysqrt());
}
// flat image test
@@ -138,7 +138,7 @@
image2d<unsigned short> out(size, size);
data::fill_with_value(ima, 51);
- out = level::transform(ima, mysqrt());
+ out = data::transform(ima, mysqrt());
box2d::piter p(out.domain());
for_all(p)
@@ -155,7 +155,7 @@
data::fill_with_value(ima, 0);
debug::iota(ima);
- II out = level::transform(ima_if, mysqrt());
+ II out = data::transform(ima_if, mysqrt());
II::piter p(ima_if.domain());
for_all(p)
@@ -175,7 +175,7 @@
data::fill(in, (unsigned short)51);
data::fill(out, (unsigned short)42);
- out = level::transform(cast, mysqrt());
+ out = data::transform(cast, mysqrt());
II::piter p(cast.domain());
for_all(p)
@@ -192,7 +192,7 @@
II sub_ima(ima, make::box2d(4,4, 10,10));
data::fill(ima, 51);
- III out = level::transform(sub_ima, mysqrt());
+ III out = data::transform(sub_ima, mysqrt());
II::piter p(sub_ima.domain());
for_all(p)
@@ -209,7 +209,7 @@
II extend_ima(ima, 5);
data::fill(ima, 51);
- III out = level::transform(extend_ima, mysqrt());
+ III out = data::transform(extend_ima, mysqrt());
II::piter p(extend_ima.domain());
for_all(p)
Index: tests/data/replace.cc
--- tests/data/replace.cc (revision 3920)
+++ tests/data/replace.cc (working copy)
@@ -25,14 +25,14 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/replace.cc
+/*! \file tests/data/replace.cc
*
- * \brief Tests on mln::level::replace.
+ * \brief Tests on mln::data::replace.
*/
#include <mln/core/image/image2d.hh>
-#include <mln/level/replace.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/replace.hh>
+#include <mln/data/compare.hh>
int main()
@@ -49,7 +49,7 @@
image2d<int> rhs = make::image(vs);
- level::replace(rhs, 10, 11);
+ data::replace(rhs, 10, 11);
int vs_ref[3][3] = {
Index: tests/data/paste.cc
--- tests/data/paste.cc (revision 3927)
+++ tests/data/paste.cc (working copy)
@@ -42,7 +42,7 @@
#include <mln/data/fill.hh>
#include <mln/data/paste.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/fun/p2b/chess.hh>
#include <mln/fun/p2v/iota.hh>
Index: tests/data/stretch.cc
--- tests/data/stretch.cc (revision 3920)
+++ tests/data/stretch.cc (working copy)
@@ -26,12 +26,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/stretch.cc
+/// \file tests/data/stretch.cc
///
-/// Tests on mln::level::stretch.
+/// Tests on mln::data::stretch.
#include <mln/core/image/image2d.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include <mln/debug/iota.hh>
#include <mln/value/int_u8.hh>
@@ -47,7 +47,7 @@
{ 1000, 2000, 3000 }
};
image2d<int> ima = make::image(vs);
- image2d<int_u8> out = level::stretch(int_u8(), ima);
+ image2d<int_u8> out = data::stretch(int_u8(), ima);
int_u8 ws[3][3] = {
{ 0, 127, 255 },
Index: tests/data/naive/median.cc
--- tests/data/naive/median.cc (revision 3927)
+++ tests/data/naive/median.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/naive/median.cc
+/// \file tests/data/naive/median.cc
///
-/// Test on mln::level::naive::median.
+/// Test on mln::data::naive::median.
#include <mln/core/image/image2d.hh>
#include <mln/win/rectangle2d.hh>
@@ -37,7 +37,7 @@
#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/naive/median.hh>
+#include <mln/data/naive/median.hh>
#include "tests/data.hh"
@@ -55,6 +55,6 @@
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
image2d<int_u8> out(lena.domain());
- level::naive::median(lena, rec, out);
+ data::naive::median(lena, rec, out);
io::pgm::save(out, "out.pgm");
}
Index: tests/data/apply.cc
--- tests/data/apply.cc (revision 3920)
+++ tests/data/apply.cc (working copy)
@@ -25,13 +25,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/apply.cc
+/*! \file tests/data/apply.cc
*
- * \brief Tests on mln::level::apply.
+ * \brief Tests on mln::data::apply.
*/
#include <mln/core/image/image2d.hh>
-#include <mln/level/apply.hh>
+#include <mln/data/apply.hh>
#include <mln/debug/iota.hh>
#include <mln/fun/v2v/saturate.hh>
@@ -49,7 +49,7 @@
image2d<int> ref(make::image(vs));
debug::iota(ima);
- level::apply(ima, fun::v2v::saturate<int>(2, 6));
+ data::apply(ima, fun::v2v::saturate<int>(2, 6));
box_fwd_piter_<point2d> p(ima.domain());
for_all(p)
mln_assertion(ima(p) == ref(p));
Index: tests/data/Makefile.am
--- tests/data/Makefile.am (revision 3927)
+++ tests/data/Makefile.am (working copy)
@@ -2,20 +2,50 @@
include $(top_srcdir)/milena/tests/tests.mk
+SUBDIRS = approx naive
+
check_PROGRAMS = \
+ abs \
+ all_headers \
+ apply \
+ compare \
+ compute \
+ convert \
fill \
- fill_with_value \
fill_with_image \
+ fill_with_value \
+ median \
+ median_fast \
memcpy_ \
memset_ \
- paste
+ paste \
+ saturate \
+ sort_psites \
+ stretch \
+ transform \
+ transform_inplace \
+ update
+abs_SOURCES = abs.cc
+all_headers_SOURCES = all_headers.cc
+apply_SOURCES = apply.cc
+compare_SOURCES = compare.cc
+compute_SOURCES = compute.cc
+convert_SOURCES = convert.cc
fill_SOURCES = fill.cc
-fill_with_value_SOURCES = fill_with_value.cc
fill_with_image_SOURCES = fill_with_image.cc
+fill_with_value_SOURCES = fill_with_value.cc
+median_SOURCES = median.cc
+median_fast_SOURCES = median_fast.cc
memcpy__SOURCES = memcpy_.cc
memset__SOURCES = memset_.cc
paste_SOURCES = paste.cc
+saturate_SOURCES = saturate.cc
+sort_psites_SOURCES = sort_psites.cc
+stretch_SOURCES = stretch.cc
+transform_SOURCES = transform.cc
+transform_inplace_SOURCES = transform_inplace.cc
+update_SOURCES = update.cc
# Lengthy tests.
# FIXME: enable it when make full-check is enabled.
Index: tests/data/compare.cc
--- tests/data/compare.cc (revision 3920)
+++ tests/data/compare.cc (working copy)
@@ -26,12 +26,12 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/compare.cc
+/// \file tests/data/compare.cc
///
-/// Tests on mln::level::compare.
+/// Tests on mln::data::compare.
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/debug/iota.hh>
Index: tests/data/saturate.cc
--- tests/data/saturate.cc (revision 3920)
+++ tests/data/saturate.cc (working copy)
@@ -26,13 +26,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/level/saturate.cc
+/// \file tests/data/saturate.cc
///
-/// Tests on mln::level::saturate.
+/// Tests on mln::data::saturate.
#include <mln/core/image/image2d.hh>
-#include <mln/level/saturate.hh>
+#include <mln/data/saturate.hh>
#include <mln/debug/iota.hh>
@@ -49,7 +49,7 @@
image2d<int> ref = make::image(vs);
debug::iota(ima);
- level::saturate_inplace(ima, 2, 6);
+ data::saturate_inplace(ima, 2, 6);
box_fwd_piter_<point2d> p(ima.domain());
for_all(p)
mln_assertion(ima(p) == ref(p));
Index: tests/linear/convolve.cc
--- tests/linear/convolve.cc (revision 3927)
+++ tests/linear/convolve.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/math/round.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/core/alias/w_window2d_float.hh>
#include <mln/border/thickness.hh>
@@ -64,6 +64,6 @@
w_window2d_float w_win = make::w_window2d(ws);
image2d<float> tmp = linear::convolve(lena, w_win);
- io::pgm::save(level::transform(tmp, math::round<int_u8>()),
+ io::pgm::save(data::transform(tmp, math::round<int_u8>()),
"out.pgm");
}
Index: tests/linear/lap.cc
--- tests/linear/lap.cc (revision 3927)
+++ tests/linear/lap.cc (working copy)
@@ -37,7 +37,7 @@
#include <mln/border/thickness.hh>
#include <mln/linear/lap.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include "tests/data.hh"
@@ -52,6 +52,6 @@
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
- io::pgm::save(level::stretch(int_u8(), linear::lap_4(lena)),
+ io::pgm::save(data::stretch(int_u8(), linear::lap_4(lena)),
"out.pgm");
}
Index: tests/linear/log.cc
--- tests/linear/log.cc (revision 3927)
+++ tests/linear/log.cc (working copy)
@@ -40,7 +40,7 @@
#include <mln/linear/log.hh>
#include <mln/estim/min_max.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include "tests/data.hh"
@@ -62,7 +62,7 @@
mln_assertion(min == -929 && max == 1260);
}
- out = level::stretch(int_u8(), tmp);
+ out = data::stretch(int_u8(), tmp);
io::pgm::save(out, "out.pgm");
{
int_u8 min, max;
Index: tests/linear/convolve_directional.cc
--- tests/linear/convolve_directional.cc (revision 3927)
+++ tests/linear/convolve_directional.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/math/round.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/core/alias/w_window2d_float.hh>
#include <mln/border/thickness.hh>
@@ -59,6 +59,6 @@
float ws[] = { w, w, w, w, w, w, w, w, w };
image2d<float> tmp = linear::convolve_directional(lena, 1, ws);
- io::pgm::save(level::transform(tmp, math::round<int_u8>()),
+ io::pgm::save(data::transform(tmp, math::round<int_u8>()),
"out.pgm");
}
Index: tests/linear/convolve_2x1d.cc
--- tests/linear/convolve_2x1d.cc (revision 3927)
+++ tests/linear/convolve_2x1d.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/math/round.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/core/alias/w_window2d_float.hh>
#include <mln/border/thickness.hh>
@@ -62,6 +62,6 @@
float vws[] = { v, v, v };
image2d<float> tmp = linear::convolve_2x1d(lena, hws, vws);
- io::pgm::save(level::transform(tmp, math::round<int_u8>()),
+ io::pgm::save(data::transform(tmp, math::round<int_u8>()),
"out.pgm");
}
Index: tests/linear/sobel_2d.cc
--- tests/linear/sobel_2d.cc (revision 3927)
+++ tests/linear/sobel_2d.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/var.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
@@ -56,5 +56,5 @@
io::pgm::load(input, MLN_IMG_DIR "/tiny.pgm");
image2d<float> output = linear::sobel_2d_l1_norm(input);
- io::pgm::save(level::stretch(int_u8(), output), "out.pgm");
+ io::pgm::save(data::stretch(int_u8(), output), "out.pgm");
}
Index: tests/linear/gaussian.cc
--- tests/linear/gaussian.cc (revision 3927)
+++ tests/linear/gaussian.cc (working copy)
@@ -37,7 +37,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/data/paste.hh>
#include <mln/math/round.hh>
Index: tests/accu/transform_snake.cc
--- tests/accu/transform_snake.cc (revision 3927)
+++ tests/accu/transform_snake.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/accu/count.hh>
#include <mln/win/rectangle2d.hh>
#include <mln/pw/all.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/accu/image/to_result.cc
--- tests/accu/image/to_result.cc (revision 3927)
+++ tests/accu/image/to_result.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/accu/image/init.hh>
#include <mln/accu/image/to_result.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
Index: tests/accu/image/take_n_times.cc
--- tests/accu/image/take_n_times.cc (revision 3927)
+++ tests/accu/image/take_n_times.cc (working copy)
@@ -31,7 +31,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/data/fill.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
Index: tests/accu/image/init.cc
--- tests/accu/image/init.cc (revision 3927)
+++ tests/accu/image/init.cc (working copy)
@@ -30,7 +30,7 @@
/// Tests on mln::accu::image::init.
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
Index: tests/accu/image/take.cc
--- tests/accu/image/take.cc (revision 3927)
+++ tests/accu/image/take.cc (working copy)
@@ -31,7 +31,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/data/fill.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
Index: tests/accu/image/set_value.cc
--- tests/accu/image/set_value.cc (revision 3927)
+++ tests/accu/image/set_value.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/accu/count.hh>
#include <mln/accu/image/set_value.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
Index: tests/accu/image/untake.cc
--- tests/accu/image/untake.cc (revision 3927)
+++ tests/accu/image/untake.cc (working copy)
@@ -31,7 +31,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/data/fill.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
Index: tests/accu/image/take_as_init.cc
--- tests/accu/image/take_as_init.cc (revision 3927)
+++ tests/accu/image/take_as_init.cc (working copy)
@@ -30,7 +30,7 @@
/// Tests on mln::accu::image::take_as_init.
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
Index: tests/accu/transform_diagonal.cc
--- tests/accu/transform_diagonal.cc (revision 3927)
+++ tests/accu/transform_diagonal.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/accu/transform_diagonal.hh>
#include <mln/accu/count.hh>
#include <mln/pw/all.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/accu/transform.cc
--- tests/accu/transform.cc (revision 3927)
+++ tests/accu/transform.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/win/rectangle2d.hh>
#include <mln/pw/all.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/accu/transform_line.cc
--- tests/accu/transform_line.cc (revision 3927)
+++ tests/accu/transform_line.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/accu/transform_line.hh>
#include <mln/accu/count.hh>
#include <mln/pw/all.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/accu/nil.cc
--- tests/accu/nil.cc (revision 3927)
+++ tests/accu/nil.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/value/int_u8.hh>
#include <mln/accu/nil.hh>
-#include <mln/level/compute.hh>
+#include <mln/data/compute.hh>
int main()
@@ -43,7 +43,7 @@
image2d<value::int_u8> ima(3, 3);
accu::nil<value::int_u8> a;
- level::compute(a, ima);
+ data::compute(a, ima);
- level::compute(accu::meta::nil(), ima);
+ data::compute(accu::meta::nil(), ima);
}
Index: tests/accu/min.cc
--- tests/accu/min.cc (revision 3927)
+++ tests/accu/min.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/accu/v.hh>
#include <mln/accu/compute.hh>
-#include <mln/level/compute.hh>
+#include <mln/data/compute.hh>
int main()
@@ -47,8 +47,8 @@
using namespace mln;
image2d<int> ima(3, 3);
debug::iota(ima);
- mln_assertion(level::compute(accu::meta::min(), ima) == 1);
+ mln_assertion(data::compute(accu::meta::min(), ima) == 1);
accu::min<int> m;
- mln_assertion(level::compute(m, ima) == 1);
+ mln_assertion(data::compute(m, ima) == 1);
}
Index: tests/accu/max.cc
--- tests/accu/max.cc (revision 3927)
+++ tests/accu/max.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/accu/v.hh>
#include <mln/accu/compute.hh>
-#include <mln/level/compute.hh>
+#include <mln/data/compute.hh>
int main()
@@ -47,9 +47,9 @@
using namespace mln;
image2d<int> ima(3, 3);
debug::iota(ima);
- mln_assertion(level::compute(accu::meta::max(), ima) == 9);
+ mln_assertion(data::compute(accu::meta::max(), ima) == 9);
accu::max<int> M;
- mln_assertion(level::compute(M, ima) == 9);
+ mln_assertion(data::compute(M, ima) == 9);
// mln::trait::accumulator::print(M);
}
Index: tests/accu/line.cc
--- tests/accu/line.cc (revision 3927)
+++ tests/accu/line.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/accu/min_h.hh>
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/debug/iota.hh>
Index: tests/accu/transform_directional.cc
--- tests/accu/transform_directional.cc (revision 3927)
+++ tests/accu/transform_directional.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/accu/count.hh>
#include <mln/win/rectangle2d.hh>
#include <mln/pw/all.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/transform/distance_and_closest_point_geodesic.cc
--- tests/transform/distance_and_closest_point_geodesic.cc (revision 3927)
+++ tests/transform/distance_and_closest_point_geodesic.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/data/fill.hh>
#include <mln/debug/println.hh>
#include <mln/opt/at.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/transform/distance_and_closest_point_geodesic.hh>
Index: tests/make/image3d.cc
--- tests/make/image3d.cc (revision 3927)
+++ tests/make/image3d.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/make/image3d.hh>
#include <mln/debug/iota.hh>
#include <mln/core/routine/duplicate.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/convert/to_image.cc
--- tests/convert/to_image.cc (revision 3927)
+++ tests/convert/to_image.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/core/alias/window2d.hh>
#include <mln/core/site_set/p_if.hh>
#include <mln/fun/p2b/chess.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/convert/to_image.hh>
#include <mln/convert/to.hh>
Index: tests/geom/seed2tiling.cc
--- tests/geom/seed2tiling.cc (revision 3927)
+++ tests/geom/seed2tiling.cc (working copy)
@@ -34,7 +34,7 @@
# include <mln/core/image/image2d.hh>
# include <mln/core/alias/neighb2d.hh>
# include <mln/geom/seeds2tiling.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
int main()
{
Index: tests/geom/seed2tiling_roundness.cc
--- tests/geom/seed2tiling_roundness.cc (revision 3927)
+++ tests/geom/seed2tiling_roundness.cc (working copy)
@@ -35,7 +35,7 @@
# include <mln/core/alias/w_window2d_int.hh>
# include <mln/make/win_chamfer.hh>
# include <mln/geom/seeds2tiling_roundness.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
# include <mln/debug/println.hh>
int main()
Index: tests/fun/v2v/hsl_to_rgb.cc
--- tests/fun/v2v/hsl_to_rgb.cc (revision 3927)
+++ tests/fun/v2v/hsl_to_rgb.cc (working copy)
@@ -33,8 +33,8 @@
#include <mln/fun/v2v/hsl_to_rgb.hh>
-#include <mln/level/compare.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/compare.hh>
+#include <mln/data/transform.hh>
#include <mln/value/hsl.hh>
#include <mln/value/rgb8.hh>
@@ -57,7 +57,7 @@
image2d<rgb8> ref_ima = make::image(ref);
image2d<hsl_f> ima = make::image(dat);
- image2d<value::rgb8> ima_rgb = level::transform(ima,
+ image2d<value::rgb8> ima_rgb = data::transform(ima,
fun::v2v::f_hsl_to_rgb_3x8);
mln_assertion(ima_rgb == ref_ima);
Index: tests/fun/v2v/rgb_to_hsl.cc
--- tests/fun/v2v/rgb_to_hsl.cc (revision 3927)
+++ tests/fun/v2v/rgb_to_hsl.cc (working copy)
@@ -37,8 +37,8 @@
#include <mln/fun/v2v/rgb_to_hsl.hh>
-#include <mln/level/compare.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/compare.hh>
+#include <mln/data/transform.hh>
#include <mln/make/image.hh>
@@ -59,7 +59,7 @@
image2d<value::rgb8> ima = make::image(dat);
image2d<hsl_f> ref_ima = make::image(ref);
- image2d<hsl_f> ima_hsl = level::transform(ima,
+ image2d<hsl_f> ima_hsl = data::transform(ima,
fun::v2v::f_rgb_to_hsl_f);
mln_assertion(ima_hsl == ref_ima);
Index: tests/binarization/threshold.cc
--- tests/binarization/threshold.cc (revision 3927)
+++ tests/binarization/threshold.cc (working copy)
@@ -30,7 +30,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/binarization/threshold.hh>
-#include <mln/level/all.hh>
+#include <mln/data/all.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/ppm/load.hh>
Index: tests/morpho/artificial_line_graph_image_wst.cc
--- tests/morpho/artificial_line_graph_image_wst.cc (revision 3927)
+++ tests/morpho/artificial_line_graph_image_wst.cc (working copy)
@@ -62,7 +62,7 @@
#include <mln/morpho/line_gradient.hh>
#include <mln/morpho/closing/area_on_vertices.hh>
#include <mln/morpho/meyer_wst.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_u16.hh>
Index: tests/morpho/watershed/flooding.cc
--- tests/morpho/watershed/flooding.cc (revision 3927)
+++ tests/morpho/watershed/flooding.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/value/int_u16.hh>
#include <mln/morpho/watershed/flooding.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
@@ -76,7 +76,7 @@
t.start();
image2d<L> output = morpho::watershed::impl::generic::flooding(input, c4(), n_basins);
std::cout << "gen: " << t << std::endl;
- io::pgm::save(level::transform(output, f_16_to_8()),
+ io::pgm::save(data::transform(output, f_16_to_8()),
"tmp_ref.pgm");
}
{
@@ -84,7 +84,7 @@
t.start();
image2d<L> output = morpho::watershed::impl::flooding_fastest(input, c4(), n_basins);
std::cout << "fast: " << t << std::endl;
- io::pgm::save(level::transform(output, f_16_to_8()),
+ io::pgm::save(data::transform(output, f_16_to_8()),
"tmp_out.pgm");
}
}
Index: tests/morpho/watershed/superpose.cc
--- tests/morpho/watershed/superpose.cc (revision 3927)
+++ tests/morpho/watershed/superpose.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/value/int_u8.hh>
#include <mln/morpho/watershed/superpose.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
Index: tests/morpho/closing/area.cc
--- tests/morpho/closing/area.cc (revision 3927)
+++ tests/morpho/closing/area.cc (working copy)
@@ -37,8 +37,8 @@
#include <mln/io/pgm/load.hh>
#include <mln/accu/max.hh>
-#include <mln/level/compute.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compute.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/cst.hh>
#include <mln/pw/image.hh>
@@ -57,6 +57,6 @@
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
clo = morpho::closing::area(lena, c4(), lena.nrows() * lena.ncols());
- int_u8 m = level::compute(accu::max<int_u8>(), lena);
+ int_u8 m = data::compute(accu::max<int_u8>(), lena);
mln_assertion(clo == (pw::cst(m) | lena.domain()));
}
Index: tests/morpho/tree/compute_attribute_image.cc
--- tests/morpho/tree/compute_attribute_image.cc (revision 3927)
+++ tests/morpho/tree/compute_attribute_image.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/core/site_set/p_array.hh>
-#include <mln/level/sort_psites.hh>
+#include <mln/data/sort_psites.hh>
#include <mln/debug/println.hh>
#include <mln/core/var.hh>
@@ -58,7 +58,7 @@
debug::println(f);
typedef p_array<point2d> S;
- S s = level::sort_psites_increasing(f);
+ S s = data::sort_psites_increasing(f);
morpho::tree::data<I,S> t(f, s, c4());
debug::println(t.parent_image());
Index: tests/morpho/tree/filter/filter.cc
--- tests/morpho/tree/filter/filter.cc (revision 3927)
+++ tests/morpho/tree/filter/filter.cc (working copy)
@@ -45,7 +45,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/level/sort_psites.hh>
+#include <mln/data/sort_psites.hh>
#include <mln/morpho/tree/data.hh>
#include <mln/morpho/tree/compute_attribute_image.hh>
#include <mln/morpho/attribute/card.hh>
@@ -72,7 +72,7 @@
typedef p_array< mln_site_(I) > S;
typedef morpho::tree::data<I,S> tree_t;
- S sorted_sites = level::sort_psites_decreasing(input);
+ S sorted_sites = data::sort_psites_decreasing(input);
tree_t tree(input, sorted_sites, c4());
// Test with increasing attribute -> area closing.
Index: tests/morpho/tree/compute_parent.cc
--- tests/morpho/tree/compute_parent.cc (revision 3927)
+++ tests/morpho/tree/compute_parent.cc (working copy)
@@ -35,8 +35,8 @@
#include <mln/core/image/dmorph/image_if.hh>
#include <mln/core/site_set/p_array.hh>
-#include <mln/level/sort_psites.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/sort_psites.hh>
+#include <mln/data/compare.hh>
#include <mln/pw/value.hh>
#include <mln/debug/println.hh>
@@ -102,7 +102,7 @@
image2d<unsigned char> ima = make::image2d(vals);
typedef p_array<point2d> S;
- S s = level::sort_psites_increasing(ima);
+ S s = data::sort_psites_increasing(ima);
image2d<point2d> par = morpho::tree::compute_parent(ima, c4(), s);
mln_assertion(par == ref2());
}
Index: tests/morpho/tree/max.cc
--- tests/morpho/tree/max.cc (revision 3927)
+++ tests/morpho/tree/max.cc (working copy)
@@ -68,6 +68,6 @@
// std::cout << ". ";
// std::cout << std::endl;
- p_array<point2d> s = level::sort_psites_increasing(ima);
+ p_array<point2d> s = data::sort_psites_increasing(ima);
std::cout << morpho::tree::nodes(par, ima, s) << std::endl;
}
Index: tests/morpho/tree/data.cc
--- tests/morpho/tree/data.cc (revision 3927)
+++ tests/morpho/tree/data.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/core/alias/neighb2d.hh>
#include <mln/core/site_set/p_array.hh>
-#include <mln/level/sort_psites.hh>
+#include <mln/data/sort_psites.hh>
#include <mln/debug/println.hh>
#include <mln/morpho/tree/data.hh>
@@ -58,7 +58,7 @@
debug::println("ima = ", ima);
typedef p_array<point2d> S;
- S s = level::sort_psites_decreasing(ima);
+ S s = data::sort_psites_decreasing(ima);
typedef morpho::tree::data<I,S> tree_t;
tree_t t(ima, s, c4());
Index: tests/morpho/skeleton_constrained.cc
--- tests/morpho/skeleton_constrained.cc (revision 3927)
+++ tests/morpho/skeleton_constrained.cc (working copy)
@@ -52,7 +52,7 @@
#include <mln/arith/revert.hh>
#include <mln/transform/distance_geodesic.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
Index: tests/morpho/reconstruction/by_erosion/union_find.cc
--- tests/morpho/reconstruction/by_erosion/union_find.cc (revision 3927)
+++ tests/morpho/reconstruction/by_erosion/union_find.cc (working copy)
@@ -35,7 +35,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/morpho/reconstruction/by_erosion/union_find.hh>
Index: tests/morpho/reconstruction/by_dilation/union_find.cc
--- tests/morpho/reconstruction/by_dilation/union_find.cc (revision 3927)
+++ tests/morpho/reconstruction/by_dilation/union_find.cc (working copy)
@@ -35,7 +35,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/morpho/reconstruction/by_dilation/union_find.hh>
Index: tests/morpho/rank_filter.cc
--- tests/morpho/rank_filter.cc (revision 3927)
+++ tests/morpho/rank_filter.cc (working copy)
@@ -38,8 +38,8 @@
#include <mln/value/int_u8.hh>
#include <mln/data/fill.hh>
-#include <mln/level/compare.hh>
-#include <mln/level/median.hh>
+#include <mln/data/compare.hh>
+#include <mln/data/median.hh>
#include <mln/morpho/rank_filter.hh>
#include <mln/morpho/dilation.hh>
Index: tests/morpho/lena_line_graph_image_wst2.cc
--- tests/morpho/lena_line_graph_image_wst2.cc (revision 3927)
+++ tests/morpho/lena_line_graph_image_wst2.cc (working copy)
@@ -64,7 +64,7 @@
#include <mln/morpho/line_gradient.hh>
#include <mln/morpho/closing/area_on_vertices.hh>
#include <mln/morpho/meyer_wst.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_u16.hh>
Index: tests/io/pgm/pgm27.cc
--- tests/io/pgm/pgm27.cc (revision 3927)
+++ tests/io/pgm/pgm27.cc (working copy)
@@ -38,8 +38,8 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/level/transform.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/transform.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
@@ -79,14 +79,14 @@
image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
image2d<int_u27> out(lena.domain());
- out = level::transform(lena, to27bits());
+ out = data::transform(lena, to27bits());
io::pgm::save(out, "out27.pgm");
image2d<int_u27> lena2;
io::pgm::load(lena2, "out27.pgm");
image2d<int_u8> out2(lena.domain());
- out2 = level::transform(lena2, to8bits());
+ out2 = data::transform(lena2, to8bits());
io::pgm::save(out2, "out8.pgm");
assert(out2 == lena);
Index: tests/io/pgm/pgm19.cc
--- tests/io/pgm/pgm19.cc (revision 3927)
+++ tests/io/pgm/pgm19.cc (working copy)
@@ -37,8 +37,8 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/level/transform.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/transform.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
@@ -80,13 +80,13 @@
image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
image2d<int_u19> out(lena.domain());
- out = level::transform(lena, to19bits());
+ out = data::transform(lena, to19bits());
io::pgm::save(out, "out19.pgm");
image2d<int_u19> lena2 = io::pgm::load<int_u19>("out19.pgm");
image2d<int_u8> out2(lena.domain());
- out2 = level::transform(lena2, to8bits());
+ out2 = data::transform(lena2, to8bits());
io::pgm::save(out2, "out8.pgm");
assert(out2 == lena);
}
Index: tests/io/pgm/pgm.cc
--- tests/io/pgm/pgm.cc (revision 3927)
+++ tests/io/pgm/pgm.cc (working copy)
@@ -41,7 +41,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/literal/colors.hh>
Index: tests/io/pgm/pgm16.cc
--- tests/io/pgm/pgm16.cc (revision 3927)
+++ tests/io/pgm/pgm16.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include "tests/data.hh"
@@ -82,13 +82,13 @@
image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
image2d<int_u16> out(lena.domain());
- out = level::transform(lena, to16bits());
+ out = data::transform(lena, to16bits());
io::pgm::save(out, "out16.pgm");
image2d<int_u16> lena2 = io::pgm::load<int_u16>("out16.pgm");
image2d<int_u8> out2(lena.domain());
- out2 = level::transform(lena2, to8bits());
+ out2 = data::transform(lena2, to8bits());
io::pgm::save(out2, "out8.pgm");
}
Index: tests/io/fits/fits.cc
--- tests/io/fits/fits.cc (revision 3927)
+++ tests/io/fits/fits.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/debug/println.hh>
#include <mln/io/fits/load.hh>
Index: tests/io/dump/dump.cc
--- tests/io/dump/dump.cc (revision 3927)
+++ tests/io/dump/dump.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/io/dump/load.hh>
#include <mln/io/dump/save.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/rgb8.hh>
Index: tests/io/tiff/load.cc
--- tests/io/tiff/load.cc (revision 3927)
+++ tests/io/tiff/load.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/io/tiff/load.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/rgb8.hh>
Index: tests/io/tiff/tiff2pbm.cc
--- tests/io/tiff/tiff2pbm.cc (revision 3927)
+++ tests/io/tiff/tiff2pbm.cc (working copy)
@@ -1,7 +1,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/io/tiff/load.hh>
#include <mln/io/pbm/save.hh>
-// #include <mln/level/convert.hh>
+// #include <mln/data/convert.hh>
int main(int argc, char *argv[])
@@ -19,5 +19,5 @@
io::pbm::save(ima, argv[2]);
// io::ppm::save(ima, argv[2]);
-// io::pbm::save(level::convert(bool(), ima), argv[2]);
+// io::pbm::save(data::convert(bool(), ima), argv[2]);
}
Index: tests/io/dicom/dicom.cc
--- tests/io/dicom/dicom.cc (revision 3927)
+++ tests/io/dicom/dicom.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/io/dicom/load.hh>
#include <mln/io/dump/save.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/value/int_u12.hh>
Index: tests/io/magick/save.cc
--- tests/io/magick/save.cc (revision 3927)
+++ tests/io/magick/save.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/io/magick/save.hh>
#include <mln/io/ppm/load.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/magick/load.hh>
Index: tests/io/magick/load.cc
--- tests/io/magick/load.cc (revision 3927)
+++ tests/io/magick/load.cc (working copy)
@@ -31,7 +31,7 @@
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/magick/load.hh>
#include <mln/io/ppm/load.hh>
Index: tests/io/ppm/ppm.cc
--- tests/io/ppm/ppm.cc (revision 3927)
+++ tests/io/ppm/ppm.cc (working copy)
@@ -38,7 +38,7 @@
#include <mln/io/ppm/load.hh>
#include <mln/io/ppm/save.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/util/array.hh>
Index: tests/io/ppm/ppm23.cc
--- tests/io/ppm/ppm23.cc (revision 3927)
+++ tests/io/ppm/ppm23.cc (working copy)
@@ -38,7 +38,7 @@
#include <mln/io/ppm/load.hh>
#include <mln/io/ppm/save.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
Index: tests/io/ppm/ppm16.cc
--- tests/io/ppm/ppm16.cc (revision 3927)
+++ tests/io/ppm/ppm16.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/io/ppm/load.hh>
#include <mln/io/ppm/save.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
Index: tests/io/pbm/pbm.cc
--- tests/io/pbm/pbm.cc (revision 3927)
+++ tests/io/pbm/pbm.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/io/pbm/load.hh>
#include <mln/io/pbm/save.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
Index: tests/Makefile.am
--- tests/Makefile.am (revision 3927)
+++ tests/Makefile.am (working copy)
@@ -23,7 +23,6 @@
histo \
io \
labeling \
- level \
linear \
literal \
logical \
Index: tests/logical/not.cc
--- tests/logical/not.cc (revision 3927)
+++ tests/logical/not.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/logical/not.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/logical/or.cc
--- tests/logical/or.cc (revision 3927)
+++ tests/logical/or.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/logical/or.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/logical/and.cc
--- tests/logical/and.cc (revision 3927)
+++ tests/logical/and.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/logical/and.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/logical/and_not.cc
--- tests/logical/and_not.cc (revision 3927)
+++ tests/logical/and_not.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/logical/and_not.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/logical/xor.cc
--- tests/logical/xor.cc (revision 3927)
+++ tests/logical/xor.cc (working copy)
@@ -32,7 +32,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/logical/xor.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
int main()
Index: tests/canvas/chamfer.cc
--- tests/canvas/chamfer.cc (revision 3927)
+++ tests/canvas/chamfer.cc (working copy)
@@ -41,7 +41,7 @@
#include <mln/make/win_chamfer.hh>
#include <mln/geom/chamfer.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/opt/at.hh>
Index: tests/canvas/browsing/snake_generic_2d_vert.cc
--- tests/canvas/browsing/snake_generic_2d_vert.cc (revision 3927)
+++ tests/canvas/browsing/snake_generic_2d_vert.cc (working copy)
@@ -101,6 +101,6 @@
image2d<unsigned> ima2(3, 3);
std::cout << ima2.bbox() << std::endl;
- my_test(ima2, fun::p2v::iota, canvas::browsing::snake_generic);
+ my_test(ima2, fun::p2v::iota(), canvas::browsing::snake_generic);
debug::println(ima2);
}
Index: tests/canvas/browsing/snake_generic_2d_hori.cc
--- tests/canvas/browsing/snake_generic_2d_hori.cc (revision 3927)
+++ tests/canvas/browsing/snake_generic_2d_hori.cc (working copy)
@@ -101,6 +101,6 @@
image2d<unsigned> ima2(3, 3);
std::cout << ima2.bbox() << std::endl;
- my_test(ima2, fun::p2v::iota, canvas::browsing::snake_generic);
+ my_test(ima2, fun::p2v::iota(), canvas::browsing::snake_generic);
debug::println(ima2);
}
Index: tests/canvas/browsing/snake_generic_3d_vert.cc
--- tests/canvas/browsing/snake_generic_3d_vert.cc (revision 3927)
+++ tests/canvas/browsing/snake_generic_3d_vert.cc (working copy)
@@ -109,6 +109,6 @@
ima(point3d(0,0,0)) = 42;
std::cout << ima.bbox() << std::endl;
- my_test(ima, fun::p2v::iota, canvas::browsing::snake_generic);
+ my_test(ima, fun::p2v::iota(), canvas::browsing::snake_generic);
debug::println(ima);
}
Index: tests/canvas/browsing/diagonal2d.cc
--- tests/canvas/browsing/diagonal2d.cc (revision 3927)
+++ tests/canvas/browsing/diagonal2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,16 +26,16 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/canvas/browsing/diagonal2d.cc
- *
- * \brief Tests on mln::canvas::browsing::diagonal2d.
- */
+/// \file tests/canvas/browsing/diagonal2d.cc
+///
+/// \brief Tests on mln::canvas::browsing::diagonal2d.
#include <mln/core/image/image2d.hh>
#include <mln/canvas/browsing/diagonal2d.hh>
#include <mln/fun/p2v/iota.hh>
#include <mln/debug/println.hh>
+
template <typename I_, typename F>
struct assign_browsing_functor
{
@@ -92,6 +93,6 @@
image2d<unsigned> ima2(10, 10);
std::cout << ima2.bbox() << std::endl;
- my_test(ima2, fun::p2v::iota, canvas::browsing::diagonal2d);
+ my_test(ima2, fun::p2v::iota(), canvas::browsing::diagonal2d);
debug::println(ima2);
}
Index: tests/canvas/browsing/snake_generic_3d_hori.cc
--- tests/canvas/browsing/snake_generic_3d_hori.cc (revision 3927)
+++ tests/canvas/browsing/snake_generic_3d_hori.cc (working copy)
@@ -109,6 +109,6 @@
ima(point3d(0,0,0)) = 42;
std::cout << ima.bbox() << std::endl;
- my_test(ima, fun::p2v::iota, canvas::browsing::snake_generic);
+ my_test(ima, fun::p2v::iota(), canvas::browsing::snake_generic);
debug::println(ima);
}
Index: tests/canvas/browsing/backdiagonal2d.cc
--- tests/canvas/browsing/backdiagonal2d.cc (revision 3927)
+++ tests/canvas/browsing/backdiagonal2d.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/canvas/browsing/backdiagonal2d.cc
- *
- * \brief Tests on mln::canvas::browsing::backdiagonal2d.
- */
+/// \file tests/canvas/browsing/backdiagonal2d.cc
+///
+/// \brief Tests on mln::canvas::browsing::backdiagonal2d.
#include <mln/core/image/image2d.hh>
#include <mln/canvas/browsing/backdiagonal2d.hh>
@@ -92,6 +92,6 @@
image2d<unsigned> ima2(10, 10);
std::cout << ima2.bbox() << std::endl;
- my_test(ima2, fun::p2v::iota, canvas::browsing::backdiagonal2d);
+ my_test(ima2, fun::p2v::iota(), canvas::browsing::backdiagonal2d);
debug::println(ima2);
}
Index: tests/labeling/mean_values.cc
--- tests/labeling/mean_values.cc (revision 3927)
+++ tests/labeling/mean_values.cc (working copy)
@@ -31,7 +31,7 @@
#include <mln/core/image/image2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/labeling/mean_values.hh>
Index: tests/labeling/n_max.cc
--- tests/labeling/n_max.cc (revision 3927)
+++ tests/labeling/n_max.cc (working copy)
@@ -39,7 +39,7 @@
#include <mln/labeling/n_max.hh>
#include <mln/fun/v2b/threshold.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/accu/count.hh>
@@ -55,7 +55,7 @@
image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/tiny.pgm");
- image2d<bool> threshold = level::transform(lena, fun::v2b::threshold<int_u8>(100));
+ image2d<bool> threshold = data::transform(lena, fun::v2b::threshold<int_u8>(100));
label_8 nlabels;
image2d<label_8> labels = labeling::flat_zones(threshold, c4(), nlabels);
accu::count<int_u8> a_;
Index: tests/labeling/flat_zones.cc
--- tests/labeling/flat_zones.cc (revision 3927)
+++ tests/labeling/flat_zones.cc (working copy)
@@ -40,7 +40,7 @@
#include <mln/labeling/blobs.hh>
#include <mln/pw/all.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include "tests/data.hh"
Index: tests/labeling/wrap.cc
--- tests/labeling/wrap.cc (revision 3927)
+++ tests/labeling/wrap.cc (working copy)
@@ -36,7 +36,7 @@
#include <mln/value/int_u16.hh>
#include <mln/make/image2d.hh>
#include <mln/labeling/wrap.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/debug/println.hh>
Index: tests/labeling/foreground.cc
--- tests/labeling/foreground.cc (revision 3927)
+++ tests/labeling/foreground.cc (working copy)
@@ -34,7 +34,7 @@
#include <mln/core/var.hh>
#include <mln/io/pbm/load.hh>
#include <mln/core/alias/neighb2d.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/labeling/foreground.hh>
#include "tests/data.hh"
@@ -56,11 +56,11 @@
mln_assertion(n == 33);
{
- // Note that labeling::foreground actually is labeling::level
+ // Note that labeling::foreground actually is labeling::value
// which calls canvas::labeling_video and its generic dispatch
// leads to canvas::impl::generic::labeling.
- labeling::impl::level_functor<I> f(pic, true);
+ labeling::impl::value_functor<I> f(pic, true);
unsigned n_;
ref = canvas::impl::generic::labeling(pic, nbh, n_,
Index: tests/labeling/value.cc
--- tests/labeling/value.cc (revision 3920)
+++ tests/labeling/value.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/labeling/level.cc
+/// \file tests/labeling/value.cc
///
-/// Test on mln::labeling::level.
+/// Test on mln::labeling::value.
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
@@ -37,7 +37,7 @@
#include <mln/accu/count.hh>
#include <mln/accu/compute.hh>
-#include <mln/labeling/level.hh>
+#include <mln/labeling/value.hh>
#include <mln/data/paste.hh>
#include <mln/pw/all.hh>
#include <mln/core/image/dmorph/image_if.hh>
@@ -58,7 +58,7 @@
unsigned n, npixels = 0;
for (unsigned l = 0; l <= 255; ++l)
{
- image2d<unsigned> labels = labeling::level(lena, l, c4(), n);
+ image2d<unsigned> labels = labeling::value(lena, l, c4(), n);
unsigned npix =
accu::compute(accu::meta::count(),
labels | (pw::value(labels) != pw::cst(0u)));
Index: tests/labeling/pack.cc
--- tests/labeling/pack.cc (revision 3927)
+++ tests/labeling/pack.cc (working copy)
@@ -33,7 +33,7 @@
#include <mln/core/image/image2d.hh>
#include <mln/labeling/pack.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/value/label_16.hh>
#include <mln/debug/println.hh>
Index: tests/labeling/Makefile.am
--- tests/labeling/Makefile.am (revision 3927)
+++ tests/labeling/Makefile.am (working copy)
@@ -10,13 +10,13 @@
fill_holes \
flat_zones \
foreground \
- level \
mean_values \
n_max \
pack \
regional_maxima \
regional_minima \
relabel \
+ value \
wrap
background_SOURCES = background.cc
@@ -26,13 +26,13 @@
fill_holes_SOURCES = fill_holes.cc
flat_zones_SOURCES = flat_zones.cc
foreground_SOURCES = foreground.cc
-level_SOURCES = level.cc
mean_values_SOURCES = mean_values.cc
n_max_SOURCES = n_max.cc
pack_SOURCES = pack.cc
regional_maxima_SOURCES = regional_maxima.cc
regional_minima_SOURCES = regional_minima.cc
relabel_SOURCES = relabel.cc
+value_SOURCES = value.cc
wrap_SOURCES = wrap.cc
TESTS = $(check_PROGRAMS)
Index: tests/labeling/colorize.cc
--- tests/labeling/colorize.cc (revision 3927)
+++ tests/labeling/colorize.cc (working copy)
@@ -33,7 +33,7 @@
# include <mln/value/rgb8.hh>
# include <mln/value/int_u8.hh>
# include <mln/labeling/colorize.hh>
-# include <mln/level/compare.hh>
+# include <mln/data/compare.hh>
int main()
Index: tests/util/tree_to_image.cc
--- tests/util/tree_to_image.cc (revision 3927)
+++ tests/util/tree_to_image.cc (working copy)
@@ -37,9 +37,9 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/site_set/p_set.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include <mln/data/fill.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <vector>
#include <mln/util/tree_to_image.hh>
Index: tests/util/tree_fast_to_image.cc
--- tests/util/tree_fast_to_image.cc (revision 3927)
+++ tests/util/tree_fast_to_image.cc (working copy)
@@ -35,9 +35,9 @@
#include <mln/core/image/image2d.hh>
#include <mln/core/site_set/p_set.hh>
#include <mln/value/int_u8.hh>
-#include <mln/level/stretch.hh>
+#include <mln/data/stretch.hh>
#include <mln/data/fill.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/io/pgm/save.hh>
#include <vector>
#include <mln/util/tree_fast_to_image.hh>
Index: apps/statues/mesh-max-curv.cc
--- apps/statues/mesh-max-curv.cc (revision 3927)
+++ apps/statues/mesh-max-curv.cc (working copy)
@@ -96,7 +96,7 @@
OFF file format. */
std::vector<float> normalized_face_m(face_m.size(), 0.0f);
std::pair<float, float> min_max(acc);
- // FIXME: Taken from mln/level/stretch.hh (this should be factored).
+ // FIXME: Taken from mln/data/stretch.hh (this should be factored).
float min = min_max.first;
float max = min_max.second;
// Don't normalize actually if the curvature is constant (i.e.,
Index: apps/statues/mesh-complex-max-curv.cc
--- apps/statues/mesh-complex-max-curv.cc (revision 3927)
+++ apps/statues/mesh-complex-max-curv.cc (working copy)
@@ -46,7 +46,7 @@
#include <mln/math/sqr.hh>
#include <mln/accu/min_max.hh>
#include <mln/fun/v2v/linear.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/literal/white.hh>
@@ -140,7 +140,7 @@
ima_t output(max_curv.domain());
mln::data::fill(output, mln::literal::zero);
std::pair<float, float> min_max(acc);
- // FIXME: Taken from mln/level/stretch.hh (this should be factored).
+ // FIXME: Taken from mln/data/stretch.hh (this should be factored).
float min = min_max.first;
float max = min_max.second;
std::cout << min << std::endl;
@@ -154,7 +154,7 @@
float a = (M - m) / (max - min);
float b = (m * max - M * min) / (max - min);
mln::fun::v2v::linear<float, float, float> f(a, b);
- output = mln::level::transform(max_curv, f);
+ output = mln::data::transform(max_curv, f);
}
// Output.
Index: doc/benchmark/canvas.cc
--- doc/benchmark/canvas.cc (revision 3927)
+++ doc/benchmark/canvas.cc (working copy)
@@ -27,7 +27,7 @@
/// \file doc/benchmark/canvas.cc
///
-/// Test on mln::labeling::level.
+/// Test on mln::labeling::value.
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
@@ -253,7 +253,7 @@
level(const Image<I>& input, const mln_value(I)& val, const Neighborhood<N>& nbh,
L& nlabels)
{
- trace::entering("labeling::level");
+ trace::entering("labeling::value");
typedef level_functor<I,N,L> F;
F f(exact(input), val, exact(nbh));
@@ -261,7 +261,7 @@
nlabels = run.nlabels;
- trace::exiting("labeling::level");
+ trace::exiting("labeling::value");
return run.output;
}
@@ -285,7 +285,7 @@
t.start();
unsigned n;
for (unsigned l = 0; l <= 255; ++l)
- old_labeling::level(lena, l, c4(), n);
+ old_labeling::value(lena, l, c4(), n);
std::cout << "canvas as class: " << t.read() << std::endl;
}
@@ -294,7 +294,7 @@
t.start();
unsigned n;
for (unsigned l = 0; l <= 255; ++l)
- labeling::impl::generic::level(lena, l, c4(), n);
+ labeling::impl::generic::data(lena, l, c4(), n);
std::cout << "canvas as proc.: " << t.read() << std::endl;
}
Index: doc/benchmark/median/median_bench.cc
--- doc/benchmark/median/median_bench.cc (revision 3927)
+++ doc/benchmark/median/median_bench.cc (working copy)
@@ -38,9 +38,9 @@
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
-#include <mln/level/approx/median.hh>
-#include <mln/level/fast_median.hh>
-#include <mln/level/median.hh>
+#include <mln/data/approx/median.hh>
+#include <mln/data/fast_median.hh>
+#include <mln/data/median.hh>
#include <mln/core/dpoints_pixter.hh>
#include <mln/core/pixel.hh>
@@ -88,17 +88,17 @@
timer chrono;
chrono.start();
- level::fast_median(input, win, output);
+ data::fast_median(input, win, output);
chrono.stop();
std::cout << "Fast median : " << chrono << std::endl;
chrono.start();
- level::median(input, win, output);
+ data::median(input, win, output);
chrono.stop();
std::cout << "Median : " << chrono << std::endl;
chrono.start();
- level::approx::median(input, exact(win), output);
+ data::approx::median(input, exact(win), output);
chrono.stop();
std::cout << "Approx median : " << chrono << std::endl;
Index: doc/examples/trash/tuto_one.cc
--- doc/examples/trash/tuto_one.cc (revision 3927)
+++ doc/examples/trash/tuto_one.cc (working copy)
@@ -11,7 +11,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/make/double_neighb2d.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
# include <mln/literal/black.hh>
# include <mln/debug/println.hh>
@@ -79,7 +79,7 @@
debug::println(labeling::regional_minima(clo, nbh, l));
debug::println(wst);
- io::ppm::save(level::transform(wst, colorize(l)), filename);
+ io::ppm::save(data::transform(wst, colorize(l)), filename);
}
Index: doc/examples/trash/labeling_algo.cc
--- doc/examples/trash/labeling_algo.cc (revision 3927)
+++ doc/examples/trash/labeling_algo.cc (working copy)
@@ -34,7 +34,7 @@
# include <mln/core/alias/neighb2d.hh>
# include <mln/value/int_u8.hh>
# include <mln/data/fill.hh>
-# include <mln/level/stretch.hh>
+# include <mln/data/stretch.hh>
# include <mln/border/fill.hh>
# include <mln/io/pbm/load.hh>
# include <mln/io/pgm/save.hh>
@@ -68,7 +68,7 @@
image2d<int_u8> inte2(inte.domain());
- level::stretch(inte, inte2);
+ data::stretch(inte, inte2);
io::pgm::save(inte2, "inte.pgm");
Index: doc/examples/trash/tuto_bis.cc
--- doc/examples/trash/tuto_bis.cc (revision 3927)
+++ doc/examples/trash/tuto_bis.cc (working copy)
@@ -20,7 +20,7 @@
# include <mln/data/paste.hh>
# include <mln/data/fill.hh>
-# include <mln/level/transform.hh>
+# include <mln/data/transform.hh>
# include <mln/extension/fill.hh>
# include <mln/morpho/meyer_wst.hh>
@@ -263,7 +263,7 @@
for (unsigned i = 1; i <= nbasins; ++i)
std::cout << "mean value of basin #" << i << " is " << m(i) << std::endl;
-// data::fill(cell, level::transform(lab, m));
+// data::fill(cell, data::transform(lab, m));
// debug::println(cell);
// // 2 2 2
// //
Index: doc/examples/trash/graph.cc
--- doc/examples/trash/graph.cc (revision 3927)
+++ doc/examples/trash/graph.cc (working copy)
@@ -100,7 +100,7 @@
p_vertices<G, fv2p_t> pv(g, fv2p);
#ifndef NOUT
- image2d<rgb8> gima = level::convert(rgb8(), ima);
+ image2d<rgb8> gima = data::convert(rgb8(), ima);
debug::draw_graph(gima,
pv,
pw::cst(literal::cyan),
@@ -123,7 +123,7 @@
pvlg_t pvlg(lg, convert::to<i2e_t>(lines));
#ifndef NOUT
- image2d<rgb8> lgima = level::convert(rgb8(), ima);
+ image2d<rgb8> lgima = data::convert(rgb8(), ima);
debug::draw_graph(lgima,
pvlg,
pw::cst(literal::cyan),
@@ -154,7 +154,7 @@
#ifndef NOUT
- image2d<rgb8> lgima2 = level::convert(rgb8(), ima);
+ image2d<rgb8> lgima2 = data::convert(rgb8(), ima);
debug::draw_graph(lgima2, pvlg, pw::cst(literal::cyan), ecolor);
io::ppm::save(lgima2, "05-line-graph-cleanup.ppm");
#endif
Index: doc/examples/accu-right-instanciation.cc
--- doc/examples/accu-right-instanciation.cc (revision 3927)
+++ doc/examples/accu-right-instanciation.cc (working copy)
@@ -2,7 +2,7 @@
#include <mln/value/int_u8.hh>
-#include <mln/level/compute.hh>
+#include <mln/data/compute.hh>
#include <mln/accu/max.hh>
@@ -13,6 +13,6 @@
image2d<value::int_u8> ima(2, 3);
// \{
- level::compute(accu::meta::max(), ima);
+ data::compute(accu::meta::max(), ima);
// \}
}
Index: doc/examples/extend.cc
--- doc/examples/extend.cc (revision 3927)
+++ doc/examples/extend.cc (working copy)
@@ -3,7 +3,7 @@
#include <mln/core/routine/extend.hh>
#include <mln/core/var.hh>
-#include <mln/level/transform.hh>
+#include <mln/data/transform.hh>
#include <mln/fun/p2b/big_chess.hh>
@@ -97,7 +97,7 @@
initialize(mask, lena);
data::fill(mask, true);
data::fill((mask | ima_roi.domain()).rw(), false);
- mln_VAR(ima_ext, level::transform(lena | (pw::value(mask) != false), saturate_rgb8()));
+ mln_VAR(ima_ext, data::transform(lena | (pw::value(mask) != false), saturate_rgb8()));
data::paste(ima_ext, lena);
data::paste(ima_roi, lena);
doc::ppmsave(lena, "extend");
Index: doc/examples/tuto3/first_routine.cc
--- doc/examples/tuto3/first_routine.cc (revision 3927)
+++ doc/examples/tuto3/first_routine.cc (working copy)
@@ -10,7 +10,7 @@
#include <mln/labeling/compute.hh>
#include <mln/labeling/blobs.hh>
-#include <mln/level/compare.hh>
+#include <mln/data/compare.hh>
#include <mln/util/array.hh>
1
0
* demat.hh,
* src/photo.cc,
* src/photo_basic.cc,
* src/table.cc: removed.
---
scribo/ChangeLog | 11 +-
scribo/demat.hh | 1601 ---------------------------------------------
scribo/src/photo.cc | 64 --
scribo/src/photo_basic.cc | 107 ---
scribo/src/table.cc | 66 --
5 files changed, 10 insertions(+), 1839 deletions(-)
delete mode 100644 scribo/demat.hh
delete mode 100644 scribo/src/photo.cc
delete mode 100644 scribo/src/photo_basic.cc
delete mode 100644 scribo/src/table.cc
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 2117f69..b48929a 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,4 +1,13 @@
-2009-05-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+2009-05-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Remove unused files in Scribo.
+
+ * demat.hh,
+ * src/photo.cc,
+ * src/photo_basic.cc,
+ * src/table.cc: removed.
+
+2009-05-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Make a sample extracting text in a photo.
diff --git a/scribo/demat.hh b/scribo/demat.hh
deleted file mode 100644
index e8c0e7b..0000000
--- a/scribo/demat.hh
+++ /dev/null
@@ -1,1601 +0,0 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library 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 this library; see the file COPYING. If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02111-1307, USA.
-//
-// As a special exception, you may use this file as part of a free
-// software library 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 DEMAT_HH_
-# define DEMAT_HH_
-
-# define for_all_ncomponents(C, NCOMP) \
- for (unsigned C = 1; C <= NCOMP; ++C)
-
-# define for_all_components(C, S) \
- for (unsigned C = 1; C < S.nelements(); ++C)
-
-# define for_all_elements(E, S) \
- for (unsigned E = 0; E < S.nelements(); ++E)
-
-# include <libgen.h>
-# include <sstream>
-# include <queue>
-
-# include <mln/essential/1d.hh>
-# include <mln/essential/2d.hh>
-# include <mln/morpho/elementary/dilation.hh>
-# include <mln/labeling/background.hh>
-# include <mln/transform/influence_zone_geodesic.hh>
-# include <mln/debug/draw_graph.hh>
-# include <mln/make/graph.hh>
-# include <mln/make/region_adjacency_graph.hh>
-# include <mln/util/graph.hh>
-# include <mln/util/line_graph.hh>
-# include <mln/io/txt/save.hh>
-
-# include <mln/canvas/browsing/depth_first_search.hh>
-# include <mln/transform/distance_and_influence_zone_geodesic.hh>
-# include <mln/fun/l2l/wrap.hh>
-# include <mln/fun/meta/all.hh>
-
-# include <tesseract/baseapi.h>
-
-namespace scribo
-{
-
- namespace internal
- {
-
- using namespace mln;
- using value::label_16;
- using value::label_8;
- using value::rgb8;
- using value::int_u8;
-
-
- struct settings_t
- {
- settings_t()
- {
- ero_line_width = 51;
- rank_filter = 6;
- bbox_enlarge = 1 + ero_line_width / 2 - rank_filter;
- bbox_distance = 20;
- min_comp_size = 5;
- max_comp_size = 1000;
- max_dist_lines = 10;
- max_txt_box_height = 100;
- max_cos = 0.994;
- repair_max_dist = 51;
- }
-
- unsigned bbox_enlarge;
- unsigned ero_line_width;
- unsigned bbox_distance;
- unsigned min_comp_size;
- unsigned max_comp_size;
- unsigned max_dist_lines;
- unsigned repair_max_dist;
- int max_txt_box_height;
- unsigned rank_filter;
- bool treat_tables;
- float max_cos;
- };
-
-
-
- settings_t settings;
- char *input_file = 0;
-
-
-
- /// Returns a formated output file name.
- std::string output_file(const char *name)
- {
- static int file_id = 1;
-
- std::ostringstream os;
- os << "./"
- << input_file
- << "_";
-
- if (file_id < 10)
- os << "0";
-
- os << file_id++
- << "_"
- << name;
- return os.str();
- }
-
-
- /// Returns the edge central sites of a box
- ///
- /// \param[in] b the bbbox
- /// \param[in] dim the dimension used to compute the site.
- /*!
- **
- ** If dim == 0, returns the left and right central sites.
- **
- ** |-------|
- ** X X
- ** |-------|
- **
- ** If dim == 1, returns the top and bottom central sites.
- **
- ** |---X---|
- ** | |
- ** |---X---|
- **
- */
- util::couple<point2d, point2d>
- central_sites(const box2d& b, unsigned dim)
- {
- unsigned n = b.pmax()[dim] - b.pmin()[dim];
-
- point2d p1 = b.center();
- p1[dim] -= n / 2;
- point2d p2 = b.center();
- p2[dim] += n / 2;
-
- return make::couple(p1, p2);
- }
-
-
-
- /// Draw a list of bboxes and their center in a RGB8 image.
- void draw_component_boxes(image2d<rgb8>& output, const util::array<box2d>& boxes)
- {
- for_all_components(i, boxes)
- if (boxes[i].is_valid())
- {
- output(boxes[i].center()) = literal::red;
- draw::box(output, boxes[i], literal::red);
- }
- }
-
-
-
- /// Colorize and save a labeled image.
- template <typename V>
- void save_lbl_image(const image2d<V>& lbl, unsigned nlabels,
- const char *filename)
- {
- image2d<rgb8> output = labeling::colorize(rgb8(), lbl, nlabels);
- io::ppm::save(output, output_file(filename));
- }
-
-
-
-
-
-
-
- //-*****************************************
- /// Functions related to Text Recognition.
- //-*****************************************
- /// \{
-
- /// Passes the text bboxes to Tesseract and store the result in an image of
- /// char.
- /// \param[in] in image from where the text bboxes are extracted.
- /// \param[in] lbl labeled image.
- /// \param[in] tboxes array of text bboxes.
- ///
- /// FIXME: For each text bbox, we create a new image. We may like to avoid that.
- void
- text_recognition(const image2d<bool>& in, const image2d<label_16>& lbl,
- const util::array<box2d>& tboxes)
- {
- /// Use txt bboxes here with Tesseract
- std::cout << "Text recognition..." << std::endl;
-
- TessBaseAPI::InitWithLanguage(NULL, NULL, "fra", NULL, false, 0, NULL);
- image2d<char> txt(in.domain());
- data::fill(txt, ' ');
-
- for_all_components(i, tboxes)
- {
- if (tboxes[i].is_valid())
- {
- image2d<bool> b(tboxes[i], 0);
- data::fill(b, false);
- data::fill((b | (pw::value(lbl) == pw::cst(i))).rw(), true);
-
- char* s = TessBaseAPI::TesseractRect(
- (unsigned char*) b.buffer(),
- sizeof (bool), // Pixel size.
- b.ncols() * sizeof (bool), // Row_offset
- 0, // Left
- 0, // Top
- b.ncols(), // n cols
- b.nrows()); // n rows
-
-
-
- point2d p = tboxes[i].center();
- p.col() -= (tboxes[i].pmax().col() - tboxes[i].pmin().col()) / 2;
- if (s != 0)
- debug::put_word(txt, p, s);
- free(s);
- }
- }
- io::txt::save(txt, "out.txt");
- }
-
- /// \}
- //--------------------------------------------------
- /// End of functions related to Text Recognition.
- //--------------------------------------------------
-
-
-
-
-
- //-*********************************************
- /// Functions related to the table extraction
- //-*********************************************
- /// \{
-
- /// Align table lines bboxes according to a given dimension.
- ///
- /// \return A list of the resulting aligned cols. Each integer is actually
- /// a col number.
- /*
- **
- ** 0 1 3 4 5 6
- ** ------------ -------
- ** 0 |- - - - - | | {0,1} |
- ** 1 | - - | | {0,1} |
- ** 2 | | | {1} |
- ** 3 | | | |
- ** 4 | | | {2} |
- ** 5 |- - | | {2} |
- ** 6 | | | {2} |
- **
- ** \p hboxes contains all the table lines bboxes. Each bbox is
- ** associated with an id, its location in the array.
- **
- ** For each bbox, its id is marked in a vector. The location is defined,
- ** according to the given parameter \p dim, either by the row or the col
- ** value of the pmin site.
- **
- ** Ids are then propagated in the vector according a small delta value.
- ** if bbox ids are at the same location in the vector, their related bboxes
- ** are likely to be on the same line.
- **
- ** Finally, iterate over the vector until all bboxes have been treated.
- ** For each iteration, the set with a specific number of elements is found
- ** and all bboxes referenced in this set are aligned on the same row or col.
- **
- */
- template <typename P>
- util::array<int>
- align_lines(unsigned nsites,
- int min_coord,
- int max_coord,
- util::array<box<P> >& line_boxes,
- unsigned dim)
- {
- trace::entering("scribo::internal::align_lines");
-
- mln_precondition(nsites > 0);
-
- std::cout << "extracting table lines..." << std::endl;
- util::array< util::set<unsigned> > lines;
- lines.resize(nsites);
-
- // Map components with actual lines.
- for_all_components(i, line_boxes)
- {
- int minline = line_boxes[i].pmin()[dim] - 5;
- minline = (minline < min_coord ? min_coord : minline);
- int maxline = line_boxes[i].pmax()[dim] + 5;
- maxline = (maxline > max_coord ? max_coord : maxline);
-
- for (int line = minline;
- line <= maxline; ++line)
- lines[line].insert(i);
- }
-
- // Init box2line
- util::array<int> box2line;
- box2line.resize(line_boxes.nelements());
- for_all_elements(i, box2line)
- box2line[i] = -1;
-
- // Find the line with the highest element count.
- unsigned max_nelts = 0;
- for_all_elements(i, lines)
- if (max_nelts < lines[i].nelements())
- max_nelts = lines[i].nelements();
-
- // Aligning lines
- // FIXME: not optimal... Make it faster!
- // We may do too much iterations (while loop) and some of them may
- // be done for nothing...
- util::array<int> newlines;
- while (max_nelts > 0)
- {
- for_all_elements(i, lines)
- if (lines[i].nelements() == max_nelts)
- {
- accu::mean<unsigned> mean;
- for_all_elements(j, lines[i])
- if (box2line[lines[i][j]] == -1)
- mean.take(line_boxes[lines[i][j]].center()[dim]);
-
- if (mean.is_valid())
- {
- for_all_elements(j, lines[i])
- if (box2line[lines[i][j]] == -1)
- {
- line_boxes[lines[i][j]].pmin()[dim] = mean.to_result();
- line_boxes[lines[i][j]].pmax()[dim] = mean.to_result();
- box2line[lines[i][j]] = mean.to_result();
- }
- newlines.append(mean.to_result());
- }
- }
- --max_nelts;
- }
-
- trace::exiting("scribo::internal::align_lines");
- return newlines;
- }
-
-
- /// Align line bboxes verticaly.
- ///
- /// \param[in] input Image from which the line bboxes are
- /// extracted from.
- /// \param[in, out] lines_bboxes vertical lines bounding boxes.
- ///
- /// \return A list of the resulting aligned cols. Each integer is actually
- /// a col number.
- template <typename I>
- util::array<int>
- align_lines_verticaly(const Image<I>& input,
- util::array<box<mln_site(I)> >& lines_bboxes)
- {
- trace::entering("scribo::internal::align_lines_horizontaly");
-
- mln_precondition(exact(input).is_valid());
- util::array<int> res = align_lines(geom::ncols(input), geom::min_col(input),
- geom::max_col(input), lines_bboxes, 1);
-
- trace::exiting("scribo::internal::align_lines_horizontaly");
- return res;
-
- }
-
- /// Align line bboxes horizontaly.
- ///
- /// \param[in] input Image from which the line bboxes are
- /// extracted from.
- /// \param[in, out] lines_bboxes horizontal lines bounding boxes.
- ///
- /// \return A list of the resulting aligned rows. Each integer is actually
- /// a row number.
- template <typename I>
- util::array<int>
- align_lines_horizontaly(const Image<I>& input,
- util::array<box<mln_site(I)> >& lines_bboxes)
- {
- trace::entering("scribo::internal::align_lines_horizontaly");
-
- mln_precondition(exact(input).is_valid());
- util::array<int> res = align_lines(geom::nrows(input), geom::min_row(input),
- geom::max_row(input), lines_bboxes, 0);
-
- trace::exiting("scribo::internal::align_lines_horizontaly");
- return res;
- }
-
-
- /// Connect vertical and horizontal lines if they are close to each other.
- ///
- /// ------ ------
- /// ---> |
- /// | |
- /// | |
- ///
- template <typename P>
- void
- connect_lines(const util::array<int>& aligned_lines,
- util::array< box<P> >& boxes,
- unsigned dim,
- unsigned dim_size)
- {
- trace::entering("scribo::internal::connect_lines");
-
- image1d<int> l(dim_size);
- data::fill(l, -1);
-
- for_all_elements(i, aligned_lines)
- opt::at(l, aligned_lines[i]) = i;
-
- for (unsigned i = 0; i < settings.max_dist_lines; ++i)
- l = morpho::elementary::dilation(l, c2());
-
- for_all_components(i, boxes)
- {
- util::couple<point2d, point2d> cp = central_sites(boxes[i], dim);
- if (opt::at(l, cp.first()[dim]) != -1)
- boxes[i].pmin()[dim] = aligned_lines[opt::at(l, cp.first()[dim])];
- if (opt::at(l, cp.second()[dim]) != -1)
- boxes[i].pmax()[dim] = aligned_lines[opt::at(l, cp.second()[dim])];
- }
-
- trace::exiting("scribo::internal::connect_lines");
- }
-
-
- /// Connect vertical lines with the new aligned rows.
- template <typename I>
- void
- connect_vertical_lines(const util::array<int>& aligned_rows,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > tblboxes,
- const Image<I>& input)
- {
- trace::entering("scribo::internal::connect_vertical_lines");
- mln_precondition(exact(input).is_valid());
-
- connect_lines(aligned_rows, tblboxes.first(), 0, exact(input).nrows());
-
- trace::exiting("scribo::internal::connect_vertical_lines");
- }
-
-
- /// Connect horizontal lines with the new aligned columns.
- template <typename I>
- void
- connect_horizontal_lines(const util::array<int>& aligned_cols,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > tblboxes,
- const Image<I>& input)
- {
- trace::entering("scribo::internal::connect_horizontal_lines");
- mln_precondition(exact(input).is_valid());
-
- connect_lines(aligned_cols, tblboxes.second(), 1, exact(input).ncols());
-
- trace::exiting("scribo::internal::connect_horizontal_lines");
- }
-
-
- /// Repair lines with small discontinuities.
- /// FIXME: buggy. Sometimes few lines move or shrink!
- template <unsigned axis, typename I>
- void
- repair_lines(const Image<I>& input_,
- util::array<box<mln_site(I)> >& tblboxes)
- {
- std::cout << "repairing lines" << std::endl;
-
- const I& input = exact(input_);
- typedef mln_site(I) P;
- typedef win::line<mln_grid(P), axis, mln_coord(P)> line_t;
-
- // Initialization
- image2d<unsigned> l(input.domain());
- data::fill(l, 0u);
- for_all_components(i, tblboxes)
- {
- util::couple<point2d, point2d> cp = central_sites(tblboxes[i], axis);
- l(cp.first()) = i;
- l(cp.second()) = i;
- }
-
- // Repair
- extension_val<image2d<unsigned> > l_ext(l, 0u);
-
- util::array<box<P> > result;
- std::vector<bool> to_keep(tblboxes.nelements(), true);
-
- mln_VAR(tbb_ima, extend(l | pw::value(l) != 0u, l));
- line_t vl(settings.repair_max_dist); //FIXME: use a half window, just the bottom of the vertical line.
- mln_piter(tbb_ima_t) p(tbb_ima.domain());
- mln_qiter(line_t) q(vl, p);
- for_all(p)
- for_all(q)
- if (l_ext(q) != 0u && l_ext(q) != l_ext(p))
- {
- to_keep[l_ext(q)] = false;
-
- std::cout << "Merging " << tblboxes[l_ext(p)] << " with " << tblboxes[l_ext(q)] << std::endl;
- tblboxes[l_ext(p)].pmax() = tblboxes[l_ext(q)].pmax();
-
- util::couple<P,P> cp = central_sites(tblboxes[l_ext(q)], axis);
- l_ext(cp.first()) = l_ext(p);
- l_ext(cp.second()) = l_ext(p);
- }
-
-
- // Remove merged boxes.
- for_all_elements(i, tblboxes)
- if (to_keep[i])
- result.append(tblboxes[i]);
-
- std::cout << tblboxes[0] << " - " << result[0] << std::endl;
- std::cout << "previous box count = " << tblboxes.nelements() << " - " << " now = " << result.nelements() << std::endl;
- tblboxes = result;
- }
-
-
- template <typename I>
- void
- repair_vertical_lines(const Image<I>& input,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tblboxes)
- {
- repair_lines<0>(input, tblboxes.first());
- }
-
-
- template <typename I>
- void
- repair_horizontal_lines(const Image<I>& input,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >& tblboxes)
- {
- repair_lines<1>(input, tblboxes.second());
- }
-
-
-// void
-// connect_lines2(const util::array<int>& aligned_lines,
-// util::array<box2d>& boxes,
-// unsigned dim,
-// unsigned dim_size)
-// {
-// image1d<int> l(dim_size);
-// data::fill(l, -1);
-//
-// for_all_components(i, boxes)
-// {
-// opt::at(l, boxes[i].pmin()[dim]) = i;
-// opt::at(l, boxes[i].pmax()[dim]) = i;
-// }
-//
-// for (unsigned i = 0; i < settings.max_dist_lines; ++i)
-// l = morpho::elementary::dilation(l, c2());
-//
-// for_all_components(i, boxes)
-// {
-// util::couple<point2d, point2d> cp = central_sites(boxes[i], dim);
-//
-// win::segment1d seg(11);
-// {
-// mln_qiter_(win::segment1d) q(seg, point1d(cp.first()[dim]));
-// for_all(q)
-// if (opt::at(l, q[0]) != -1)
-// {
-// boxes[i].pmin()[dim] = boxes[opt::at(l, q[0])].pmin()[dim];
-// break;
-// }
-// }
-// {
-// mln_qiter_(win::segment1d) q(seg, point1d(cp.second()[dim]));
-// for_all(q)
-// if (opt::at(l, q[0]) != -1)
-// {
-// boxes[i].pmax()[dim] = boxes[opt::at(l, q[0])].pmax()[dim];
-// break;
-// }
-// }
-// }
-// }
-
-
- /// Save lines bounding boxes in an image filled with \p bg_color.
- /// Bounding boxes are displayed with \p bbox_color.
- template <typename I>
- void
- save_table(const Image<I>& input,
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > > tblboxes,
- const std::string& filename,
- const value::rgb8& bg_color = literal::black,
- const value::rgb8& bbox_color = literal::red)
- {
- trace::entering("scribo::internal::save_table");
- mln_precondition(exact(input).is_valid());
-
- image2d<rgb8> out2(exact(input).domain());
- data::fill(out2, bg_color);
- for_all_components(i, tblboxes.first())
- {
- util::couple<mln_site(I), mln_site(I)> cp = central_sites(tblboxes.first()[i], 0);
- out2(cp.first()) = literal::green;
- out2(cp.second()) = literal::green;
- draw::box(out2, tblboxes.first()[i], bbox_color);
- }
- for_all_components(i, tblboxes.second())
- {
- util::couple<mln_site(I), mln_site(I)> cp = central_sites(tblboxes.second()[i], 1);
- out2(cp.first()) = literal::green;
- out2(cp.second()) = literal::green;
- draw::box(out2, tblboxes.second()[i], bbox_color);
- }
- io::ppm::save(out2, output_file(filename.c_str()));
-
- trace::exiting("scribo::internal::save_table");
- }
-
- /// Align line bboxes vertically and horizontally. Then, try to join
- /// vertical and horizontal lines in order to rebuild the table.
- template <typename I>
- mln_ch_value(I,bool)
- rebuild_table(const Image<I>& in_,
- util::couple<util::array<box2d>,
- util::array<box2d> >& tblboxes)
- {
- const I& in = exact(in_);
-
- mlc_equal(mln_value(I), bool)::check();
- mln_precondition(in.is_valid());
-
- std::cout << "Rebuild table" << std::endl;
-
- util::array<int> rows = align_lines_horizontaly(in, tblboxes.second());
- util::array<int> cols = align_lines_verticaly(in, tblboxes.first());
-
-# ifndef NOUT
- save_table(in, tblboxes, "after-alignment.ppm");
-# endif
-
-// repair_vertical_lines(in, tblboxes);
-// repair_horizontal_lines(in, tblboxes);
-
- // Connect vertical lines with horizontal lines.
- connect_vertical_lines(rows, tblboxes, in);
- connect_horizontal_lines(cols, tblboxes, in);
-
- image2d<bool> res;
- initialize(res, in);
- data::fill(res, false);
- for_all_components(i, tblboxes.first())
- draw::box(res, tblboxes.first()[i], true);
- for_all_components(i, tblboxes.second())
- draw::box(res, tblboxes.second()[i], true);
-
-# ifndef NOUT
- save_table(in, tblboxes, "table.ppm");
-# endif
-
- return res;
- }
-
-
-
- void draw_line(image2d<rgb8>& ima,
- unsigned dim,
- const box2d& box,
- const rgb8& v)
- {
- util::couple<point2d, point2d> cp = central_sites(box, dim);
-
- draw::line(ima, cp.first(), cp.second(), v);
- }
-
-
-
- void draw_row(image2d<rgb8>& ima,
- unsigned line,
- const rgb8& v)
- {
- draw::line(ima, point2d(line, 0), point2d(line, ima.ncols()), v);
- }
-
-
-
- void draw_col(image2d<rgb8>& ima,
- unsigned line,
- const rgb8& v)
- {
- draw::line(ima, point2d(0, line), point2d(ima.nrows(), line), v);
- }
-
- /// \}
- //-****************************************************
- /// End of functions related to the table extraction
- //-****************************************************
-
-
-
-
-
- //-*****************************************
- /// Functions related to the table removal
- //-*****************************************
- /// \{
-
-
-
- /// Extract the components bboxes.
- util::array<box2d>
- component_boxes(const image2d<bool>& filter)
- {
- std::cout << "component boxes" << std::endl;
- label_16 nlabels = 0;
- image2d<label_16> lbl = labeling::blobs(filter, c8(), nlabels);
-
- return labeling::compute(accu::meta::bbox(), lbl, nlabels);
- }
-
-
-
- /// Remove table bboxes from an image.
- void erase_table_boxes(image2d<bool>& output,
- util::array<box2d>& boxes,
- unsigned dim)
- {
- for_all_components(i, boxes)
- {
- boxes[i].enlarge(dim, settings.bbox_enlarge);
- boxes[i].crop_wrt(output.domain());
- data::paste((pw::cst(false) | boxes[i] |
- (pw::value(output) == true)), output);
- }
- }
-
-
-
- /// Find table bboxes and remove them from the image.
- /// Use rank filter.
- ///
- /// \return pair of array of bounding boxes. The first array holds the
- /// vertical lines bboxes and the second one the horizontal lines
- /// bboxes.
- template <typename I, typename HW, typename VW>
- util::couple<util::array<box<mln_site(I)> >,
- util::array<box<mln_site(I)> > >
- extract_table_lines_with_rank(const Image<I>& in,
- const Window<HW>& vwin,
- const Window<VW>& hwin,
- unsigned rank_k)
- {
- typedef accu::bbox<mln_psite(I)> A;
- typedef util::array<mln_result(A)> boxes_t;
-
- // Vertical lines
- std::cout << "Removing vertical lines" << std::endl;
- mln_ch_value(I,bool) vfilter = morpho::rank_filter(in, vwin, rank_k);
-
-#ifndef NOUT
- io::pbm::save(vfilter, output_file("vertical-erosion.pbm"));
-#endif
-
- boxes_t vboxes = component_boxes(vfilter);
-
- // Horizontal lines.
- std::cout << "Removing horizontal lines" << std::endl;
- mln_ch_value(I,bool) hfilter = morpho::rank_filter(in, hwin, rank_k);
-
-#ifndef NOUT
- io::pbm::save(hfilter, output_file("horizontal-erosion.pbm"));
-#endif
-
- boxes_t hboxes = component_boxes(hfilter);
-
- return make::couple(vboxes, hboxes);
- }
-
-
- /// Erase table line bboxes from an image.
- ///
- /// \param[in] line_bboxes vertical and horizontal line bounding
- /// boxes.
- ///
- /// \param[in, out] in input image in which the lines are
- /// erased.
- template <typename I>
- void
- erase_table(util::couple<util::array<box2d>,
- util::array<box2d> >& line_bboxes,
- Image<I>& in_)
- {
- trace::entering("scribo::internal::erase_table");
- I& in = exact(in_);
- mln_precondition(in.is_valid());
-
- erase_table_boxes(in, line_bboxes.first(), 0);
- erase_table_boxes(in, line_bboxes.second(), 1);
-
-#ifndef NOUT
- mln_ch_value(I,rgb8) tmp = level::convert(rgb8(), in);
- draw_component_boxes(tmp, line_bboxes.first());
- draw_component_boxes(tmp, line_bboxes.second());
- io::ppm::save(tmp, output_file("vertical-and-horizontal-erosion.ppm"));
- io::pbm::save(in, output_file("table_removed.pbm"));
-#endif
-
- trace::exiting("scribo::internal::erase_table");
- }
-
-
- /// \}
- //--------------------------------------------------
- /// End of functions related to the table removal.
- //--------------------------------------------------
-
-
-
-
-
- //-***************************************
- /// Function related to text extraction
- //-***************************************
- /// \{
-
- template <typename R>
- struct remove_small_comps
- : Function_l2b< remove_small_comps<R> >
- {
- remove_small_comps(const util::array<R>& nsitecomp)
- : nsitecomp_(nsitecomp)
- {
- }
-
- /// Return false if the components is smaller than a given size.
- bool operator()(const label_16& l) const
- {
- return nsitecomp_[l] >= settings.min_comp_size;
- }
-
- const util::array<R>& nsitecomp_;
- };
-
-
-
- template <typename R>
- struct remove_smallandlarge_comps
- : Function_l2b< remove_smallandlarge_comps<R> >
- {
- remove_smallandlarge_comps(const util::array<R>& nsitecomp)
- : nsitecomp_(nsitecomp)
- {
- }
-
- /// Return false if the components is smaller than a given size.
- bool operator()(const label_16& l) const
- {
- return nsitecomp_[l].first >= settings.min_comp_size
- && nsitecomp_[l].first < settings.max_comp_size
- && math::abs(nsitecomp_[l].second.pmax().row()
- - nsitecomp_[l].second.pmin().row())
- <= settings.max_txt_box_height;
- }
-
- const util::array<R>& nsitecomp_;
- };
-
-
-
- void
- cleanup_components(image2d<label_16>& lbl,
- label_16& nlabels)
- {
- std::cout << "Cleanup components..." << std::endl;
-
- typedef accu::count<mln_psite_(image2d<label_16>)> accu_count_t;
- typedef accu::bbox<mln_psite_(image2d<label_16>)> accu_bbox_t;
- typedef accu::pair<accu_count_t, accu_bbox_t> accu_pair_t;
- typedef mln_result_(accu_pair_t) accu_pair_res_t;
- typedef mln_result_(accu_count_t) accu_count_res_t;
-
- if (settings.treat_tables)
- {
- // Remove components which are too small
- typedef util::array<accu_count_res_t> nsitecomp_t;
- nsitecomp_t nsitecomp = labeling::compute(accu_count_t(), lbl, nlabels);
- remove_small_comps<accu_count_res_t> fl2b(nsitecomp);
- labeling::relabel_inplace(lbl, nlabels, fl2b);
- } else
- {
- // Remove components which have too much or not enough sites and which are
- // too heigh.
- typedef util::array<accu_pair_res_t> nsitecomp_t;
- nsitecomp_t nsitecomp = labeling::compute(accu_pair_t(), lbl, nlabels);
- remove_smallandlarge_comps<accu_pair_res_t> fl2b(nsitecomp);
- labeling::relabel_inplace(lbl, nlabels, fl2b);
- }
- }
-
-
- /// Functor to be passed to depth_first_search.
- /// Map each component vertex with its representative vertex id.
- struct make_relabel_fun_t
- {
- template <typename G>
- void init(const Graph<G>& g)
- {
- l2l.resize(exact(g).v_nmax(), mln_max(label_16));
- ncomp = 0;
- }
-
- void final()
- {}
-
- void next()
- { ++ncomp; }
-
- void update_treated(unsigned id)
- { l2l(id) = ncomp; }
-
- void update_queued(unsigned id)
- { update_treated(id); }
-
- bool to_be_treated(unsigned id)
- { return l2l(id) == mln_max(label_16); }
-
- bool to_be_queued(unsigned id)
- { return to_be_treated(id); }
-
- unsigned ncomp;
- fun::l2l::relabel<label_16> l2l;
- };
-
-
-
- /// Functor to be passed to depth_first_search.
- /// Computes the number of vertices per graph component.
- struct comp_size_t
- {
- template <typename G>
- void init(const Graph<G>& g)
- {
- treated.resize(exact(g).v_nmax(), mln_max(label_16));
- }
-
- void final()
- {}
-
- void next()
- {
- unsigned compsize = comp_vertices.nelements();
- std::cout << "compsize = " << compsize << std::endl;
- for (unsigned i = 0; i < comp_vertices.nelements(); ++i)
- treated[comp_vertices[i]] = compsize;
- comp_vertices.clear();
- }
-
- void update_treated(unsigned id)
- { comp_vertices.insert(id); }
-
- void update_queued(unsigned id)
- {
- std::cout << "update_queued_before " << comp_vertices << std::endl;
- update_treated(id);
- std::cout << "update_queued_after " << comp_vertices << std::endl;
- }
-
- bool to_be_treated(unsigned id)
- { return treated[id] == mln_max(label_16); }
-
- bool to_be_queued(unsigned id)
- { return comp_vertices.has(id); }
-
- util::set<unsigned> comp_vertices;
- util::array<unsigned> treated;
- };
-
- unsigned
- find_root(util::array<unsigned>& parent, unsigned x)
- {
- if (parent[x] == x)
- return x;
- else
- return parent[x] = find_root(parent, parent[x]);
- }
-
- /// Merge bboxes according to their left neighbor.
- util::array<box2d>
- group_bboxes_with_single_link(util::array<unsigned>& link_array,
- image2d<label_16>& lbl,
- util::array<box2d>& cboxes, label_16& nlabels)
- {
- for (unsigned i = 0; i < link_array.nelements(); ++i)
- link_array[i] = find_root(link_array, i);
-
- util::array< accu::bbox<point2d> > tboxes;
- tboxes.resize(nlabels.next());
- for_all_ncomponents(i, nlabels)
- tboxes[link_array[i]].take(cboxes[i]);
-
- //Update labels
- labeling::relabel_inplace(lbl, nlabels,
- convert::to<fun::l2l::relabel<label_16> >(link_array));
-
-#ifndef NOUT
- save_lbl_image(lbl, nlabels, "lbl-grouped-boxes.pgm");
-#endif
-
- util::array<box2d> result;
- convert::from_to(tboxes, result);
-
- nlabels = result.nelements();
-
- return result;
- }
-
-
- /// Merge bboxes according to their neighbors.
- util::array<box2d>
- group_bboxes_with_graph(const util::graph& g, image2d<label_16>& lbl,
- util::array<box2d>& cboxes, label_16& nlabels)
- {
- // Build relabel function.
- make_relabel_fun_t f;
- canvas::browsing::depth_first_search(g, f);
-
- util::array< accu::bbox<point2d> > tboxes;
- tboxes.resize(nlabels.next());
- for_all_ncomponents(i, nlabels)
- tboxes[f.l2l(i)].take(cboxes[i]);
-
- //Update labels
- labeling::relabel_inplace(lbl, nlabels, f.l2l);
-
-#ifndef NOUT
- save_lbl_image(lbl, nlabels, "lbl-grouped-boxes.pgm");
-#endif
-
- util::array<box2d> result(1);
- for_all_ncomponents(i, nlabels)
- if (tboxes[i].is_valid())
- result.append(tboxes[i].to_result());
-
- mln_assertion(result.nelements() == f.ncomp);
- nlabels = result.nelements();
-
-
-#ifndef NOUT
- image2d<label_16> lbl2 = duplicate(lbl);
- comp_size_t comp_size;
- canvas::browsing::depth_first_search(g, comp_size);
-
- std::cout << g << std::endl;
- for_all_ncomponents(i, nlabels)
- if (tboxes[i].is_valid())
- if (comp_size.treated[i] < 3)
- data::fill((lbl2 | (tboxes[i].to_result() | (pw::value(lbl2) == i))).rw(), 0u);
- save_lbl_image(lbl2, nlabels, "lbl-grouped-boxes-cleaned.ppm");
-#endif
-
- return result;
- }
-
-
-
- /// Add an edge if a valid neighbor is found
- void update_link(util::graph& g, image2d<label_16>& lbl,
- const point2d& p, const point2d& c,
- unsigned i, int dmax)
- {
- if (lbl.domain().has(p) && lbl(p) != 0u && lbl(p) != i
- && (math::abs(p.col() - c.col())) < dmax)
- g.add_edge(lbl(p), i);
- }
-
- /// Update the lookup table \p link_array if a neighbor is found on the right of
- /// the current bbox.
- void update_link_array(util::array<unsigned>& link_array, image2d<label_16>& lbl,
- const point2d& p, const point2d& c,
- unsigned i, int dmax)
- {
- if (lbl.domain().has(p) && lbl(p) != 0u && lbl(p) != i
- && (math::abs(p.col() - c.col())) < dmax && link_array[lbl(p)] == lbl(p))
- link_array[lbl(p)] = i;
- }
-
-
-
- void init_link_array(util::array<unsigned>& link_array)
- {
- for (unsigned i = 0; i < link_array.nelements(); ++i)
- link_array[i] = i;
- }
-
- /// Map each character bbox to its left bbox neighbor if possible.
- /// Iterate to the right but link boxes to the left.
- ///
- /// \return an util::array. Map a bbox to its left neighbor.
- util::array<unsigned>
- link_character_bboxes_with_single_link(image2d<label_16>& lbl,
- const util::array<box2d>& cboxes,
- unsigned ncomp)
- {
- util::array<unsigned> left_link(ncomp + 1);
- init_link_array(left_link);
-
- for_all_ncomponents(i, ncomp)
- {
- unsigned midcol = (cboxes[i].pmax().col() - cboxes[i].pmin().col()) / 2;
- int dmax = midcol + settings.bbox_distance;
- point2d c = cboxes[i].center();
-
- ///
- /// Find a neighbor on the right
- ///
-
- /// First site on the right of the central site
- point2d p = c + right;
-
- // FIXME: Lemmings with a condition on the distance => write a special version?
- while (lbl.domain().has(p) && (lbl(p) == 0u || lbl(p) == i)
- && math::abs(p.col() - c.col()) < dmax)
- ++p.col();
-
- update_link_array(left_link, lbl, p, c, i, dmax);
-
- }
-
- return left_link;
- }
-
-
- /// Map each character bbox to its left bbox neighbor if possible.
- /// Iterate to the right but link boxes to the left.
- ///
- /// \return a pair of util::array. The first one map a bbox to its left
- /// neighbor and the second one map a bbox to its right neighbor.
- util::couple<util::array<unsigned>, util::array<unsigned> >
- link_character_bboxes_with_double_link(image2d<label_16>& lbl,
- const util::array<box2d>& cboxes,
- unsigned ncomp)
- {
- util::array<unsigned> left_link(ncomp + 1), right_link(ncomp + 1);
- init_link_array(left_link);
- init_link_array(right_link);
-
- for_all_ncomponents(i, ncomp)
- {
- unsigned midcol = (cboxes[i].pmax().col() - cboxes[i].pmin().col()) / 2;
- int dmax = midcol + settings.bbox_distance;
- point2d c = cboxes[i].center();
-
- ///
- /// Find a neighbor on the right
- ///
-
- /// First site on the right of the central site
- point2d p = c + right;
-
- // FIXME: Lemmings with a condition on the distance => write a special version?
- while (lbl.domain().has(p) && (lbl(p) == 0u || lbl(p) == i)
- && math::abs(p.col() - c.col()) < dmax)
- ++p.col();
-
- update_link_array(left_link, lbl, p, c, i, dmax);
-
-
- ///
- /// Find a neighbor on the left
- ///
-
- /// First site on the left of the central site
- p = c + left;
-
- // FIXME: Lemmings with a condition on the distance => write a special version?
- while (lbl.domain().has(p) && (lbl(p) == 0u || lbl(p) == i)
- && math::abs(p.col() - c.col()) < dmax)
- --p.col();
-
- update_link_array(right_link, lbl, p, c, i, dmax);
- }
-
- return make::couple(left_link, right_link);
- }
-
-
- /// Map each character bbox to its left neighbors.
- util::graph
- link_character_bboxes_with_left_graph(image2d<label_16>& lbl,
- const util::array<box2d>& cboxes,
- unsigned ncomp)
- {
- util::graph g(ncomp + 1);
-
- for_all_ncomponents(i, ncomp)
- {
- unsigned midcol = (cboxes[i].pmax().col() - cboxes[i].pmin().col()) / 2;
- int dmax = midcol + settings.bbox_distance;
- point2d c = cboxes[i].center();
- /// First site on the right of the central site
- point2d p = c + right;
-
- // FIXME: Lemmings with a condition on the distance => write a special version?
- while (lbl.domain().has(p) && (lbl(p) == 0u || lbl(p) == i)
- && math::abs(p.col() - c.col()) < dmax)
- ++p.col();
-
- update_link(g, lbl, p, c, i, dmax);
- }
-
- return g;
- }
-
-
- /// Map each character bbox to its left and right neighbors.
- util::graph
- link_character_bboxes_with_left_and_right_graph(image2d<label_16>& lbl,
- const util::array<box2d>& cboxes,
- unsigned ncomp)
- {
- util::graph g(ncomp + 1);
-
- for_all_ncomponents(i, ncomp)
- {
- unsigned midcol = (cboxes[i].pmax().col() - cboxes[i].pmin().col()) / 2;
- int dmax = midcol + settings.bbox_distance;
- point2d c = cboxes[i].center();
-
- //
- // Find neighbors on the right
- //
-
- /// First site on the right of the central site
- point2d p = c + right;
-
- // FIXME: Lemmings with a condition on the distance => write a special version?
- while (lbl.domain().has(p) && (lbl(p) == 0u || lbl(p) == i)
- && math::abs(p.col() - c.col()) < dmax)
- ++p.col();
-
- update_link(g, lbl, p, c, i, dmax);
-
- //
- // Find neighbors on the left
- //
-
- /// First site on the right of the central site
- p = c + left;
-
- // FIXME: Lemmings with a condition on the distance => write a special version?
- while (lbl.domain().has(p) && (lbl(p) == 0u || lbl(p) == i)
- && math::abs(p.col() - c.col()) < dmax)
- --p.col();
-
- update_link(g, lbl, p, c, i, dmax);
-
- }
-
- return g;
- }
-
-
-
- util::array<box2d>
- extract_text(image2d<bool>& in,
- image2d<label_16>& lbl,
- label_16& nlabels)
- {
- std::cout << "extract text" << std::endl;
-
- typedef label_16 V;
- typedef image2d<V> I;
- typedef util::array<box2d> boxes_t;
-
- boxes_t cboxes = labeling::compute(accu::meta::bbox(), lbl, nlabels);
-
- image2d<label_16> lbl_bbox;
- initialize(lbl_bbox, lbl);
- data::fill(lbl_bbox, 0u);
-
- for_all_components(i, cboxes)
- draw::box(lbl_bbox, cboxes[i], i);
-
-#ifndef NOUT
- image2d<rgb8> tmp = level::convert(rgb8(), in);
- draw_component_boxes(tmp, cboxes);
- io::ppm::save(tmp, output_file("character-bboxes.ppm"));
-#endif
-
- //Link character bboxes to their left neighboor if possible.
- util::graph g = link_character_bboxes_with_left_graph(lbl_bbox, cboxes, nlabels);
-
- //Merge character bboxes through a graph.
- util::array<box2d> tboxes = group_bboxes_with_graph(g, lbl, cboxes, nlabels);
-
- return tboxes;
- }
-
-
-
-
- /// Function mapping value to sites of a line graph image.
- template <typename S>
- struct lg_vertex_values : public mln::Function_p2v< lg_vertex_values<S> >
- {
- /// Result is composed of a L2 distance between the two vertices of
- /// the edge, and the angle between the edge and the origin axis.
- typedef util::couple<unsigned,float> result;
-
- // Compute the angle between P and (0,1)
- util::couple<unsigned,float> operator()(const mln_psite(S)& p) const
- {
- unsigned distance = norm::l2_distance(p.to_site().begin().to_vec(),
- p.to_site().end().to_vec());
-
- /// Compute angle between the edge and the axis.
- mln::algebra::vec<2,float> v, pv;
- v[0] = 1;
- v[1] = 0;
- pv = p.to_site().to_vec().normalize();
-
- float pi = 3.14;
- float pi_div2 = pi / 2;
- float angle = v * pv;
- // Be sure the angle is between 0 and pi/2
-
- // up left part of the circle.
- if (angle > pi_div2 && angle < pi)
- angle = pi - angle;
- // down left part of the circle.
- else if (angle < 0 && angle < -pi_div2)
- angle += pi;
-
- // down right part of the circle.
- if (angle < 0)
- angle *= -1;
-
- return make::couple(distance, angle);
- }
-
- };
-
-
-
- void maptext_to_cells(const image2d<bool>& in, const image2d<bool>& table, const util::array<box2d>& tboxes)
- {
- std::cout << "map text to cells" << std::endl;
- label_16 nlabels;
- image2d<label_16> tblelbl = labeling::background(table, c8(), nlabels);
- image2d<rgb8> color = labeling::colorize(rgb8(), tblelbl, nlabels);
-# ifndef NOUT
- io::ppm::save(color, output_file("cells-labels.ppm"));
-
- image2d<rgb8> dbg = level::convert(rgb8(), logical::not_(table));
-
- for_all_elements(i, tboxes)
- if (tboxes[i].is_valid())
- data::paste(pw::cst(color(tboxes[i].center())) | (tboxes[i] | pw::value(in) == true),
- dbg);
- io::ppm::save(dbg, output_file("text2cell.ppm"));
-# endif
- }
-
-
- void merge_aligned_text_boxes(const image2d<bool>& in, util::array<box2d>& tboxes,
- image2d<label_16>& lbl, label_16& nlabels)
- {
- std::cout << "Merging aligned text boxes" << std::endl;
-
- io::ppm::save(labeling::colorize(rgb8(), lbl, nlabels),
- output_file("tboxes-lbl.ppm"));
-
- typedef util::couple<image2d<unsigned>, image2d<label_16> > cpl_t;
- cpl_t diz =
- transform::distance_and_influence_zone_geodesic(lbl, c8(),
- settings.bbox_distance);
-
-#ifndef NOUT
- io::pgm::save(level::transform(diz.first(), fun::l2l::wrap<label_8>()),
- output_file("tboxes-dmap.pgm"));
- io::ppm::save(labeling::colorize(rgb8(), diz.second(), nlabels),
- output_file("tboxes-iz.ppm"));
-#endif
-
- typedef util::graph G;
- G g = make::graph(diz.second() | (pw::value(diz.second()) != pw::cst(0u)),
- c8(), nlabels);
-
- // Compute the component centers and use them as vertex sites.
- //FIXME: Add fun::vertex2p
- typedef fun::i2v::array<point2d> fv2p_t;
- fv2p_t fv2p(nlabels.next());
-
- for_all_components(i, tboxes)
- fv2p(i) = tboxes[i].center();
-
- typedef util::line_graph<G> LG;
- LG lg(g);
-
- // Find lines (sites) associated to edges in g.
- typedef fun::i2v::array<p_line2d> i2e_t;
- util::array<p_line2d> lines;
- mln_edge_iter_(G) e(g);
- for_all(e)
- lines.append(p_line2d(fv2p(e.v1()), fv2p(e.v2())));
-
- // Map lines to vertices in lg.
- typedef p_vertices<LG, i2e_t> pvlg_t;
- pvlg_t pvlg(lg, convert::to<i2e_t>(lines));
-
- // Construct an image from a p_edges and a function mapping
- // lines to angles.
- typedef lg_vertex_values<pvlg_t> lgv2v_t;
- lgv2v_t lgv2v;
-
- mln_VAR(lg_ima, lgv2v | pvlg);
-
-// unsigned dmax = level::compute(accu::max<unsigned>(),
-// thru(meta::first<mln_value_(lg_ima_t)>(),
-// lg_ima));
-//
-// mln_VAR(angle_ima, level::stretch(int_u8(),
-// thru(meta::second<mln_value_(lg_ima_t)>(),
-// lg_ima)));
-//
-// image2d<unsigned> stats(make::box2d(dmax, 255));
-// data::fill(stats, 0u);
-//
-// mln_piter_(lg_ima_t) p(lg_ima.domain());
-// for_all(p)
-// ++stats(point2d(lg_ima(p).first(), angle_ima(p)));
-
-#ifndef NOUT
-// io::pgm::save(stats, "stats.pgm");
- {
- fun::i2v::array<value::rgb8> ecolor(pvlg.nsites(), literal::olive);
- mln_piter_(lg_ima_t) p(lg_ima.domain());
- for_all (p)
- {
- mln_value_(lg_ima_t) v = lg_ima(p);
- if ((v.second() > settings.max_cos) || (v.second() < - settings.max_cos))
- ecolor(p) = literal::cyan;
- }
-
- image2d<rgb8> output = level::convert(rgb8(), in);
- internal::draw_component_boxes(output, tboxes);
- debug::draw_graph(output, pvlg, pw::cst(literal::cyan), ecolor);
- io::ppm::save(output, internal::output_file("aligned-bboxes-merged.ppm"));
- }
-#endif
-
-
-
- }
-
- /// \}
- //-----------------------------------------------
- /// End of functions related to text extraction
- //-----------------------------------------------
-
-
-
-
- } // end of namespace scribo::internal
-
-
-
-
-
- // Facade
-
- void demat_table(char *argv[])
- {
- using namespace mln;
- using value::rgb8;
- using value::label_16;
-
- internal::settings.treat_tables = true;
- internal::input_file = basename(argv[1]);
-
- //Load image
- image2d<bool> in;
- io::pbm::load(in, argv[1]);
- logical::not_inplace(in);
-
-#ifndef NOUT
- image2d<bool> in_bak = duplicate(in);
-#endif
-
- internal::settings.max_comp_size = in.ncols() * in.nrows() * 0.05;
-
- // tblboxes.first() = vertical lines.
- // tblboxes.second() = horizontal lines.
- typedef util::couple<util::array<box2d>,util::array<box2d> > tblboxes_t;
-
- win::vline2d vline(internal::settings.ero_line_width);
- win::hline2d hline(internal::settings.ero_line_width);
- tblboxes_t tblboxes =
- internal::extract_table_lines_with_rank(in, vline, hline,
- internal::settings.rank_filter);
-
- internal::erase_table(tblboxes, in);
-
- image2d<bool> table = internal::rebuild_table(in, tblboxes);
-
- /// relabel since the table has been removed.
- label_16 nlabels;
- image2d<label_16> lbl = labeling::blobs(in, c8(), nlabels);
- internal::cleanup_components(lbl, nlabels);
-
-#ifndef NOUT
- internal::save_lbl_image(lbl, nlabels, "lbl-small-comps-removed.pgm");
-#endif
-
- util::array<box2d> tboxes = internal::extract_text(in, lbl, nlabels);
-
- internal::merge_aligned_text_boxes(in, tboxes, lbl, nlabels);
-
- internal::maptext_to_cells(in, table, tboxes);
-
-#ifndef NOUT
- std::cout << "Saving output" << std::endl;
- image2d<rgb8> output = level::convert(rgb8(), in_bak);
- internal::draw_component_boxes(output, tboxes);
- io::ppm::save(output, internal::output_file("out.ppm"));
-#endif
-
-// internal::text_recognition(in, lbl, tboxes);
- }
-
-
- void demat_photo(char *argv[])
- {
- using namespace mln;
- using value::rgb8;
- using value::label_16;
-
- internal::settings.treat_tables = false;
- internal::input_file = basename(argv[1]);
-
- //Load image
- image2d<bool> in;
- io::pbm::load(in, argv[1]);
- logical::not_inplace(in);
-
-#ifndef NOUT
- image2d<bool> in_bak = duplicate(in);
-#endif
-
- internal::settings.max_comp_size = in.ncols() * in.nrows() * 0.05;
-
- //Label and remove small components.
- label_16 nlabels;
- image2d<label_16> lbl = labeling::blobs(in, c8(), nlabels);
-
- internal::cleanup_components(lbl, nlabels);
-
- util::array<box2d> tboxes = internal::extract_text(in, lbl, nlabels);
- internal::merge_aligned_text_boxes(in, tboxes, lbl, nlabels);
-
-#ifndef NOUT
- std::cout << "Saving output" << std::endl;
- image2d<rgb8> output = level::convert(rgb8(), in_bak);
- internal::draw_component_boxes(output, tboxes);
- io::ppm::save(output, internal::output_file("out.ppm"));
-#endif
-
- internal::text_recognition(in, lbl, tboxes);
- }
-
-} // end of namespace scribo
-
-# endif // ! DEMAT_HH
diff --git a/scribo/src/photo.cc b/scribo/src/photo.cc
deleted file mode 100644
index a173750..0000000
--- a/scribo/src/photo.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library 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 this library; see the file COPYING. If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02111-1307, USA.
-//
-// As a special exception, you may use this file as part of a free
-// software library 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.
-
-
-#include "demat.hh"
-
-int main(int argc, char*argv[])
-{
- using namespace mln;
- using value::int_u8;
-
- if (argc < 2)
- {
- std::cout << argv[0] << " <in.pbm> <out.pgm> <l> <bbox_larger> <bbox_distance> <min_comp_nsites>" << std::endl
- << std::endl << std::endl
- << std::endl
- << "=========="
- << std::endl << std::endl
- << "<in.pbm> B/W inverted input image."
- << std::endl << std::endl
-/* << "<out.ppm> RGB8 output image."
- << std::endl << std::endl
- << "<bbox_distance> Maximum distance between character bounding boxes. Used for bbox grouping."
- << std::endl << std::endl
- << "<min_comp_nsites> Minimum site count of a character/text component."
- << std::endl
- << " If a component have a site count lesser than this value, it is erased."
- << std::endl << std::endl
- << std::endl*/
- << "=========="
- << std::endl << std::endl
- << "HINT: compile with -DNOUT to avoid debug images."
- << std::endl << std::endl;
- return 1;
- }
-
- scribo::demat_photo(argv);
-
- return 0;
-}
diff --git a/scribo/src/photo_basic.cc b/scribo/src/photo_basic.cc
deleted file mode 100644
index 9b2767a..0000000
--- a/scribo/src/photo_basic.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library 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 this library; see the file COPYING. If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02111-1307, USA.
-//
-// As a special exception, you may use this file as part of a free
-// software library 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.
-
-#include <iostream>
-
-#include <mln/essential/2d.hh>
-#include <mln/labeling/colorize.hh>
-
-#include <scribo/text/extract_bboxes.hh>
-#include <scribo/text/grouping/group_with_single_left_link.hh>
-#include <scribo/text/grouping/group_with_single_right_link.hh>
-#include <scribo/text/grouping/group_from_double_link.hh>
-#include <scribo/filter/small_components.hh>
-#include <scribo/filter/large_components.hh>
-#include <scribo/filter/thin_bboxes.hh>
-#include <scribo/filter/thick_bboxes.hh>
-#include <scribo/util/text.hh>
-
-#include <scribo/make/debug_filename.hh>
-#include <scribo/debug/save_textbboxes_image.hh>
-#include <scribo/debug/save_linked_textbboxes_image.hh>
-
-int usage(const char *name)
-{
- std::cout << "Usage: " << name << " <input.pbm> " << std::endl;
- return 1;
-}
-
-int main(int argc, char* argv[])
-{
- using namespace scribo;
- using namespace mln;
-
- scribo::make::internal::debug_filename_prefix = "photo_basic";
-
- image2d<bool> input;
- io::pbm::load(input, argv[1]);
- logical::not_inplace(input);
-
- typedef scribo::util::text<image2d<value::label_16> > text_t;
- value::label_16 nbboxes;
- text_t textbboxes = text::extract_bboxes(input, c8(), nbboxes);
-
- text_t filtered_textbboxes
- = scribo::filter::small_components(textbboxes, 6);
-
- filtered_textbboxes
- = scribo::filter::thin_bboxes(filtered_textbboxes, 3);
-
- filtered_textbboxes
- = scribo::filter::thick_bboxes(filtered_textbboxes,
- math::min(input.ncols(), input.nrows()) / 6);
-
-
- mln::util::array<unsigned> left_link
- = text::grouping::group_with_single_left_link(filtered_textbboxes, 30);
- mln::util::array<unsigned> right_link
- = text::grouping::group_with_single_right_link(filtered_textbboxes, 30);
-
- std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl;
- scribo::debug::save_linked_textbboxes_image(input,
- filtered_textbboxes, left_link, right_link,
- literal::red, literal::cyan, literal::yellow,
- literal::green,
- scribo::make::debug_filename("links.ppm"));
-
- scribo::debug::save_textbboxes_image(input, filtered_textbboxes.bboxes(),
- literal::red,
- scribo::make::debug_filename("test_graph_filtered_text.ppm"));
- text_t grouped_textbboxes
- = text::grouping::group_from_double_link(filtered_textbboxes, left_link, right_link);
-
- std::cout << "AFTER - nbboxes = " << grouped_textbboxes.nbboxes().next() << std::endl;
-
-
- scribo::debug::save_textbboxes_image(input, grouped_textbboxes.bboxes(),
- literal::red,
- scribo::make::debug_filename("test_graph_grouped_text.ppm"));
-
- io::ppm::save(mln::labeling::colorize(value::rgb8(), grouped_textbboxes.label_image(), grouped_textbboxes.nbboxes()),
- scribo::make::debug_filename("grouped_text_comps.ppm"));
-}
-
diff --git a/scribo/src/table.cc b/scribo/src/table.cc
deleted file mode 100644
index 3a12c57..0000000
--- a/scribo/src/table.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library 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 this library; see the file COPYING. If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02111-1307, USA.
-//
-// As a special exception, you may use this file as part of a free
-// software library 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.
-
-
-#include <demat.hh>
-
-int main(int argc, char*argv[])
-{
- using namespace mln;
- using value::int_u8;
-
- if (argc < 2)
- {
- std::cout << argv[0] << " <in.pbm> <out.pgm> <l> <bbox_larger> <bbox_distance> <min_comp_nsites>" << std::endl
- << std::endl << std::endl
- << std::endl
- << "=========="
- << std::endl << std::endl
- << "<in.pbm> B/W inverted input image."
- << std::endl << std::endl
-/* << "<out.ppm> RGB8 output image."
- << std::endl << std::endl
- << "<l> Line length"
- << std::endl << std::endl
- << "<bbox_distance> Maximum distance between character bounding boxes. Used for bbox grouping."
- << std::endl << std::endl
- << "<min_comp_nsites> Minimum site count of a character/text component."
- << std::endl
- << " If a component have a site count lesser than this value, it is erased."
- << std::endl << std::endl
- << std::endl*/
- << "=========="
- << std::endl << std::endl
- << "HINT: compile with -DNOUT to avoid debug images."
- << std::endl << std::endl;
- return 1;
- }
-
- scribo::demat_table(argv);
-
- return 0;
-}
--
1.5.6.5
1
0
* src/Makefile.am: add new files.
* src/text_in_photo.cc: new sample.
* text/grouping/group_with_single_left_link.hh,
* text/grouping/group_with_single_right_link.hh,
* text/grouping/internal/find_left_link.hh: make them compile and use
the new object_image type.
---
scribo/ChangeLog | 13 ++
scribo/src/Makefile.am | 2 +
scribo/src/text_in_photo.cc | 121 ++++++++++++++++++++
.../text/grouping/group_with_single_left_link.hh | 36 ++++--
.../text/grouping/group_with_single_right_link.hh | 39 ++++---
scribo/text/grouping/internal/find_left_link.hh | 2 +-
6 files changed, 184 insertions(+), 29 deletions(-)
create mode 100644 scribo/src/text_in_photo.cc
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 4e49716..2117f69 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,18 @@
2009-05-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Make a sample extracting text in a photo.
+
+ * src/Makefile.am: add new files.
+
+ * src/text_in_photo.cc: new sample.
+
+ * text/grouping/group_with_single_left_link.hh,
+ * text/grouping/group_with_single_right_link.hh,
+ * text/grouping/internal/find_left_link.hh: make them compile and use
+ the new object_image type.
+
+2009-05-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Small fixes in Scribo.
* preprocessing/all.hh,
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 7d02f86..af837ff 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -24,6 +24,7 @@ bin_PROGRAMS = \
superpose \
table_rebuild_opening \
table_rebuild_rank \
+ text_in_photo \
thin_bboxes
dmap_SOURCES = dmap.cc
@@ -39,5 +40,6 @@ recognition_SOURCES = recognition.cc
superpose_SOURCES = superpose.cc
table_rebuild_opening_SOURCES = table_rebuild_opening.cc
table_rebuild_rank_SOURCES = table_rebuild_rank.cc
+text_in_photo_SOURCES = text_in_photo.cc
thin_bboxes_SOURCES = thin_bboxes.cc
diff --git a/scribo/src/text_in_photo.cc b/scribo/src/text_in_photo.cc
new file mode 100644
index 0000000..94fe84e
--- /dev/null
+++ b/scribo/src/text_in_photo.cc
@@ -0,0 +1,121 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library 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 this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library 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.
+
+#include <iostream>
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+
+#include <mln/labeling/colorize.hh>
+
+#include <mln/io/pbm/all.hh>
+#include <mln/io/ppm/save.hh>
+
+#include <scribo/extract/primitive/objects.hh>
+#include <scribo/text/grouping/group_with_single_left_link.hh>
+#include <scribo/text/grouping/group_with_single_right_link.hh>
+#include <scribo/text/grouping/group_from_double_link.hh>
+#include <scribo/filter/small_objects.hh>
+#include <scribo/filter/thin_objects.hh>
+#include <scribo/filter/thick_objects.hh>
+
+#include <scribo/make/debug_filename.hh>
+#include <scribo/debug/save_textbboxes_image.hh>
+#include <scribo/debug/save_linked_textbboxes_image.hh>
+
+#include <scribo/debug/usage.hh>
+
+const char *args_desc[][2] =
+{
+ { "input.pbm", "A binary image. 'True' for objects, 'False'\
+for the background." },
+ {0, 0}
+};
+
+
+int main(int argc, char* argv[])
+{
+ using namespace scribo;
+ using namespace mln;
+
+ scribo::make::internal::debug_filename_prefix = "photo";
+
+ if (argc != 3)
+ return usage(argv, "Find text in a binarized photo.", "input.pbm output.ppm",
+ args_desc, "A color image where the text is highlighted.");
+
+ trace::entering("main");
+
+ image2d<bool> input;
+ io::pbm::load(input, argv[1]);
+
+ typedef image2d<value::label_16> L;
+ value::label_16 nobjects;
+ object_image(L) objects = scribo::extract::primitive::objects(input, c8(), nobjects);
+
+ object_image(L) filtered_objects
+ = scribo::filter::small_objects(objects, 6);
+
+ filtered_objects
+ = scribo::filter::thin_objects(filtered_objects, 3);
+
+ filtered_objects
+ = scribo::filter::thick_objects(filtered_objects,
+ math::min(input.ncols(), input.nrows()) / 6);
+
+
+ mln::util::array<unsigned> left_link
+ = text::grouping::group_with_single_left_link(objects, 30);
+ mln::util::array<unsigned> right_link
+ = text::grouping::group_with_single_right_link(objects, 30);
+
+ std::cout << "BEFORE - nobjects = " << nobjects << std::endl;
+// scribo::debug::save_linked_textbboxes_image(input,
+// filtered_textbboxes, left_link, right_link,
+// literal::red, literal::cyan, literal::yellow,
+// literal::green,
+// scribo::make::debug_filename("links.ppm"));
+//
+// scribo::debug::save_textbboxes_image(input, filtered_textbboxes.bboxes(),
+// literal::red,
+// scribo::make::debug_filename("test_graph_filtered_text.ppm"));
+ object_image(L) grouped_objects
+ = text::grouping::group_from_double_link(filtered_objects, left_link, right_link);
+
+ std::cout << "AFTER - nobjects = " << grouped_objects.nlabels() << std::endl;
+
+
+// scribo::debug::save_textbboxes_image(input, grouped_textbboxes.bboxes(),
+// literal::red,
+// scribo::make::debug_filename("test_graph_grouped_text.ppm"));
+//
+ io::ppm::save(mln::labeling::colorize(value::rgb8(), grouped_objects, grouped_objects.nlabels()),
+ argv[2]);
+ trace::exiting("main");
+}
+
diff --git a/scribo/text/grouping/group_with_single_left_link.hh b/scribo/text/grouping/group_with_single_left_link.hh
index 7375c93..d0f96e6 100644
--- a/scribo/text/grouping/group_with_single_left_link.hh
+++ b/scribo/text/grouping/group_with_single_left_link.hh
@@ -32,21 +32,25 @@
/// \file scribo/text/grouping/group_with_single_left_link.hh
///
-/// Link text bounding boxes with their left neighbor.
+/// Link text objects with their left neighbor.
///
/// Merge code with text::grouping::group_with_single_right_link.hh
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
+# include <mln/accu/center.hh>
+
+# include <mln/labeling/compute.hh>
+
# include <mln/math/abs.hh>
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/text/grouping/internal/init_link_array.hh>
# include <scribo/text/grouping/internal/find_left_link.hh>
-# include <scribo/util/text.hh>
//FIXME: not generic.
# include <mln/core/alias/dpoint2d.hh>
@@ -60,15 +64,19 @@ namespace scribo
namespace grouping
{
- /// Map each character bounding box to its left bounding box neighbor
+ /// Map each text object to its left bounding box neighbor
/// if possible.
/// Iterate to the right but link boxes to the left.
///
+ /// \param[in] objects An object image.
+ /// \param[in] The maximum distance allowed to seach a neighbor object.
+ ///
/// \return an mln::util::array. Map a bounding box to its left neighbor.
+ //
template <typename L>
inline
mln::util::array<unsigned>
- group_with_single_left_link(const scribo::util::text<L>& text,
+ group_with_single_left_link(const object_image(L)& objects,
unsigned neighb_max_distance);
# ifndef MLN_INCLUDE_ONLY
@@ -76,25 +84,29 @@ namespace scribo
template <typename L>
inline
mln::util::array<unsigned>
- group_with_single_left_link(const scribo::util::text<L>& text,
+ group_with_single_left_link(const object_image(L)& objects,
unsigned neighb_max_distance)
{
trace::entering("scribo::text::grouping::group_with_single_left_link");
- mln_precondition(text.is_valid());
+ mln_precondition(objects.is_valid());
- mln::util::array<unsigned> left_link(text.nbboxes().next());
+ mln::util::array<unsigned> left_link(objects.nlabels().next());
internal::init_link_array(left_link);
- for_all_ncomponents(i, text.nbboxes())
+ mln::util::array<mln_result(accu::center<mln_psite(L)>)>
+ mass_centers = labeling::compute(accu::meta::center(),
+ objects, objects.nlabels());
+
+ for_all_ncomponents(i, objects.nlabels())
{
- unsigned midcol = (text.bbox(i).pmax().col()
- - text.bbox(i).pmin().col()) / 2;
+ unsigned midcol = (objects.bbox(i).pmax().col()
+ - objects.bbox(i).pmin().col()) / 2;
int dmax = midcol + neighb_max_distance;
- mln_site(L) c = text.mass_center(i);
+ mln_site(L) c = mass_centers(i);
/// Find a neighbor on the left
- internal::find_left_link(text, left_link, i, dmax, c);
+ internal::find_left_link(objects, left_link, i, dmax, c);
}
trace::exiting("scribo::text::grouping::group_with_single_left_link");
diff --git a/scribo/text/grouping/group_with_single_right_link.hh b/scribo/text/grouping/group_with_single_right_link.hh
index 0ad091f..8a11a5e 100644
--- a/scribo/text/grouping/group_with_single_right_link.hh
+++ b/scribo/text/grouping/group_with_single_right_link.hh
@@ -32,23 +32,25 @@
/// \file scribo/text/grouping/group_with_single_right_link.hh
///
-/// Link text bounding boxes with their right neighbor.
+/// Link text objects with their right neighbor.
///
/// \todo Merge code with text::grouping::group_with_single_right_link.hh
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
+# include <mln/accu/center.hh>
+
+# include <mln/labeling/compute.hh>
+
# include <mln/math/abs.hh>
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/text/grouping/internal/init_link_array.hh>
-# include <scribo/text/grouping/internal/update_link_array.hh>
-# include <scribo/text/grouping/internal/find_root.hh>
# include <scribo/text/grouping/internal/find_right_link.hh>
-# include <scribo/util/text.hh>
//FIXME: not generic.
# include <mln/core/alias/dpoint2d.hh>
@@ -62,15 +64,18 @@ namespace scribo
namespace grouping
{
- /// Map each character bounding box to its right bounding box neighbor
+ /// Map each text object to its right bounding box neighbor
/// if possible.
/// Iterate to the right but link boxes to the right.
///
+ /// \param[in] objects An object image.
+ /// \param[in] The maximum distance allowed to seach a neighbor object.
+ ///
/// \return an mln::util::array. Map a bounding box to its right neighbor.
template <typename L>
inline
mln::util::array<unsigned>
- group_with_single_right_link(const scribo::util::text<L>& text,
+ group_with_single_right_link(const object_image(L)& objects,
unsigned neighb_max_distance);
# ifndef MLN_INCLUDE_ONLY
@@ -78,27 +83,29 @@ namespace scribo
template <typename L>
inline
mln::util::array<unsigned>
- group_with_single_right_link(const scribo::util::text<L>& text,
+ group_with_single_right_link(const object_image(L)& objects,
unsigned neighb_max_distance)
{
trace::entering("scribo::text::grouping::group_with_single_right_link");
- mln_precondition(text.is_valid());
+ mln_precondition(objects.is_valid());
- mln::util::array<unsigned> right_link(text.nbboxes().next());
+ mln::util::array<unsigned> right_link(objects.nlabels().next());
internal::init_link_array(right_link);
- for_all_ncomponents(i, text.nbboxes())
+ mln::util::array<mln_result(accu::center<mln_psite(L)>)>
+ mass_centers = labeling::compute(accu::meta::center(),
+ objects, objects.nlabels());
+
+ for_all_ncomponents(i, objects.nlabels())
{
- unsigned midcol = (text.bbox(i).pmax().col()
- - text.bbox(i).pmin().col()) / 2;
+ unsigned midcol = (objects.bbox(i).pmax().col()
+ - objects.bbox(i).pmin().col()) / 2;
int dmax = midcol + neighb_max_distance;
- mln_site(L) c = text.mass_center(i);
+ mln_site(L) c = mass_centers(i);
- ///
/// Find a neighbor on the right
- ///
- internal::find_right_link(text, right_link, i, dmax, c);
+ internal::find_right_link(objects, right_link, i, dmax, c);
}
trace::exiting("scribo::text::grouping::group_with_single_right_link");
diff --git a/scribo/text/grouping/internal/find_left_link.hh b/scribo/text/grouping/internal/find_left_link.hh
index f598115..e3a6b4b 100644
--- a/scribo/text/grouping/internal/find_left_link.hh
+++ b/scribo/text/grouping/internal/find_left_link.hh
@@ -39,7 +39,7 @@
# include <mln/util/array.hh>
-# include <scribo/util/text.hh>
+# include <scribo/core/object_image.hh>
# include <scribo/text/grouping/internal/update_link_array.hh>
//FIXME: not generic.
--
1.5.6.5
1
0