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
October 2008
- 14 participants
- 373 discussions
---
milena/ChangeLog | 20 +++
.../tutorial/samples/accu-right-instanciation.tex | 1 +
.../tutorial/samples/accu-wrong-instanciation.tex | 1 +
milena/doc/tutorial/samples/estim-sites.tex | 1 +
.../tutorial/samples/ima2d-decl-2-blobs-output.tex | 7 +
milena/doc/tutorial/samples/ima2d-decl-2-blobs.tex | 2 +
milena/doc/tutorial/samples/ima2d-decl-2.tex | 12 +-
.../doc/tutorial/samples/labeling-compute-call.tex | 3 +
.../samples/labeling-compute-result-output.tex | 3 +
.../tutorial/samples/labeling-compute-result.tex | 2 +
milena/doc/tutorial/tutorial.tex | 148 ++++++++++++++++----
11 files changed, 166 insertions(+), 34 deletions(-)
create mode 100644 milena/doc/tutorial/samples/accu-right-instanciation.tex
create mode 100644 milena/doc/tutorial/samples/accu-wrong-instanciation.tex
create mode 100644 milena/doc/tutorial/samples/estim-sites.tex
create mode 100644 milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex
create mode 100644 milena/doc/tutorial/samples/ima2d-decl-2-blobs.tex
create mode 100644 milena/doc/tutorial/samples/labeling-compute-call.tex
create mode 100644 milena/doc/tutorial/samples/labeling-compute-result-output.tex
create mode 100644 milena/doc/tutorial/samples/labeling-compute-result.tex
diff --git a/milena/ChangeLog b/milena/ChangeLog
index a4dd0ec..aad3140 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,23 @@
+2008-10-20 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update tutorial.
+
+ * doc/samples/accu-right-instanciation.tex,
+ * doc/samples/accu-wrong-instanciation.tex,
+ * doc/samples/estim-sites.tex,
+ * doc/samples/ima2d-decl-2-blobs-output.tex,
+ * doc/samples/ima2d-decl-2-blobs.tex,
+ * doc/samples/ima2d-decl-2.tex,
+ * doc/samples/labeling-compute-call.tex,
+ * doc/samples/labeling-compute-result-output.tex,
+ * doc/samples/labeling-compute-result.tex:
+ New sample code included in the doc.
+
+ * doc/tutorial.tex:
+ Write section about:
+ - accumulators and *::compute.
+ - blobs
+
2008-10-20 Nicolas Ballas <ballas(a)lrde.epita.fr>
Update dispatch of the fill_with image and paste routines.
diff --git a/milena/doc/tutorial/samples/accu-right-instanciation.tex b/milena/doc/tutorial/samples/accu-right-instanciation.tex
new file mode 100644
index 0000000..446893a
--- /dev/null
+++ b/milena/doc/tutorial/samples/accu-right-instanciation.tex
@@ -0,0 +1 @@
+level::compute(accu::meta::bbox(), ima);
diff --git a/milena/doc/tutorial/samples/accu-wrong-instanciation.tex b/milena/doc/tutorial/samples/accu-wrong-instanciation.tex
new file mode 100644
index 0000000..25e943d
--- /dev/null
+++ b/milena/doc/tutorial/samples/accu-wrong-instanciation.tex
@@ -0,0 +1 @@
+level::compute(accu::meta::bbox, ima);
diff --git a/milena/doc/tutorial/samples/estim-sites.tex b/milena/doc/tutorial/samples/estim-sites.tex
new file mode 100644
index 0000000..b6d7914
--- /dev/null
+++ b/milena/doc/tutorial/samples/estim-sites.tex
@@ -0,0 +1 @@
+unsigned nsites = estim::nsites(ima);
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex b/milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex
new file mode 100644
index 0000000..0e08731
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima2d-decl-2-blobs-output.tex
@@ -0,0 +1,7 @@
+0 1 1 0 0
+0 1 1 0 0
+0 0 0 0 0
+2 2 0 3 0
+2 0 3 3 3
+2 0 0 0 0
+
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2-blobs.tex b/milena/doc/tutorial/samples/ima2d-decl-2-blobs.tex
new file mode 100644
index 0000000..6699982
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima2d-decl-2-blobs.tex
@@ -0,0 +1,2 @@
+int_u8 nlabels;
+image2d<int_u8> lbl = labeling::blobs(ima, c4(), nlabels);
diff --git a/milena/doc/tutorial/samples/ima2d-decl-2.tex b/milena/doc/tutorial/samples/ima2d-decl-2.tex
index e7a0953..478a627 100644
--- a/milena/doc/tutorial/samples/ima2d-decl-2.tex
+++ b/milena/doc/tutorial/samples/ima2d-decl-2.tex
@@ -1,9 +1,9 @@
bool vals[6][5] = {
-{0, 1, 1, 0, 0},
-{0, 1, 1, 0, 0},
-{0, 0, 0, 0, 0},
-{1, 1, 0, 1, 0},
-{1, 0, 1, 1, 1},
-{1, 0, 0, 0, 0}
+ {0, 1, 1, 0, 0},
+ {0, 1, 1, 0, 0},
+ {0, 0, 0, 0, 0},
+ {1, 1, 0, 1, 0},
+ {1, 0, 1, 1, 1},
+ {1, 0, 0, 0, 0}
};
image2d<bool> ima = make::image2d(vals);
diff --git a/milena/doc/tutorial/samples/labeling-compute-call.tex b/milena/doc/tutorial/samples/labeling-compute-call.tex
new file mode 100644
index 0000000..bbe6eff
--- /dev/null
+++ b/milena/doc/tutorial/samples/labeling-compute-call.tex
@@ -0,0 +1,3 @@
+util::array<box2d> boxes = labeling::compute(accu::meta::bbox(),
+ lbl,
+ nlabels);
diff --git a/milena/doc/tutorial/samples/labeling-compute-result-output.tex b/milena/doc/tutorial/samples/labeling-compute-result-output.tex
new file mode 100644
index 0000000..d7fbc06
--- /dev/null
+++ b/milena/doc/tutorial/samples/labeling-compute-result-output.tex
@@ -0,0 +1,3 @@
+[(1,2)...(2,3)]
+[(4,1)...(6,2)]
+[(4,3)...(5,5)]
diff --git a/milena/doc/tutorial/samples/labeling-compute-result.tex b/milena/doc/tutorial/samples/labeling-compute-result.tex
new file mode 100644
index 0000000..5f92904
--- /dev/null
+++ b/milena/doc/tutorial/samples/labeling-compute-result.tex
@@ -0,0 +1,2 @@
+for (unsigned i = 1; i <= nlabels; ++i)
+ std::cout << boxes[i] << std::endl;
diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex
index 2e7ddfe..d91f56f 100644
--- a/milena/doc/tutorial/tutorial.tex
+++ b/milena/doc/tutorial/tutorial.tex
@@ -82,7 +82,9 @@ showstringspaces=false,linewidth=14cm}
- \backslash subpage iterators
- \backslash subpage imamemmgmt
- \backslash subpage basicops
-- \backslash subpage graphes
+- \backslash subpage graphandima
+- \backslash subpage arithmops
+- \backslash subpage mathtools
\backslash htmlonly
\end{htmlonly}
@@ -976,7 +978,22 @@ For instance, the algorithm level::paste tests that the set of sites of imgb
%====================================
\doxysection{blobs}{Blobs}
-//FIXME: write it!
+
+Labeling::blobs() is used to label an image. It returns a new image with the
+component id as value for each site. The background has 0 as id therefore the
+component ids start from 1.
+
+Consider the following image:
+\doxycode{ima2d-decl-2}
+
+Then label this image thanks to labeling::blobs:
+\doxycode{ima2d-decl-2-blobs}
+Output:
+\doxycode{ima2d-decl-2-blobs-output}
+
+Note that this routine returns the number of components in its third parameter.
+This parameter \textbf{must} be of the same type as the returned image value.
+
%**************************
\doxysection{compute}{Compute}
@@ -992,55 +1009,116 @@ image. \\
level::compute() & compute an accumulator on the values of an image. \\
\end{tabular}
+\subsection{Accumulators}
An accumulator is a special object accumulating data while iterating all over
the image values or sites. Hereby follows a list of accumulators available in
Olena.
%----------------
-\subsection*{Accumulators on sites}
+\subsubsection*{Accumulators on sites}
\begin{tabular}{l|p{8cm}}
-Name | Description \\
+Name & Description \\
\hline
-bbox & \\
-count\_adjacent\_vertices & \\
-count & \\
+bbox & Bounding boxes\\
+count\_adjacent\_vertices & Count adjacent vertices\\
+count & Count the number of sites\\
height & \\
volume & \\
\end{tabular}
%----------------
-\subsection*{Accumulators on values}
+\subsubsection*{Accumulators on values}
\begin{tabular}{l|p{8cm}}
-Name | Description \\
+Name & Description \\
\hline
-histo & \\
-max & \\
-max\_h & \\
-mean & \\
-median\_alt & \\
-median\_h & \\
-min & \\
-min\_h & \\
-min\_max & \\
+histo & Histogram \\
+max & Max value \\
+max\_h & Max value (Hexa)\\
+mean & Mean value\\
+median\_alt & Median\\
+median\_h & Median (Hexa)\\
+min & Min value\\
+min\_h & Min value (Hexa)\\
+min\_max & Min and Max value\\
rank\_bool & \\
rank & \\
rank\_high\_quant & \\
-sum & \\
+sum & Sum the values\\
\end{tabular}
%----------------
-\subsection*{Accumulators on values}
+\subsubsection*{Special accumulators}
\begin{tabular}{l|p{8cm}}
-Name | Description \\
+Name & Description \\
\hline
-pair & \\
-p & \\
-tuple & \\
-v & \\
+pair & Pair of accumulators\\
+tuple & $n$-uplets of accumulators\\
\end{tabular}
-//FIXME: write it!
+Each accumulator can be used in *::compute().
+It exists two versions of each accumulator.
+\begin{itemize}
+ \item mln::accu::*, this version require the site or value type as parameter.
+ For instance, for the bbox accumulator, the type would be
+ accu::bbox<mln\_psite(I)>, where I is the type of the image on which it will be
+ computed.
+ \item mln::accu::meta::*, this is usually the easiest version to use. The type
+ of site or value do not need to be specified and will be deduced at compile
+ time. For the bbox accumulator, the accumulator type would be
+ accu::meta::bbox.
+\end{itemize}
+
+Note that when an accumulator is passed to *::compute, it must be instanciated.
+You cannot write:
+\doxycode{accu-wrong-instanciation}
+Instead, you must write:
+\doxycode{accu-right-instanciation}
+\subsection{Example with labeling::compute()}
+
+In this example we will try to retrieve the bounding box of each component in an
+image.
+
+Consider the following image:
+\doxycode{ima2d-decl-2}
+
+Then label this image thanks to labeling::blobs:
+\doxycode{ima2d-decl-2-blobs}
+Output:
+\doxycode{ima2d-decl-2-blobs-output}
+
+Then, use labeling::compute() with the bbox accumulator:
+\doxycode{labeling-compute-call}
+
+Labeling::compute() hold an accumulator for each component, which means it
+returns an array of accumulator results.
+In this case, it returns an array of box2d.
+
+\textbf{Important note:} since labeling::blobs() labels the component from 1 and
+set the background to 0, we will want to iterate from 1 to nlabels included.
+\doxycode{labeling-compute-result}
+Output:
+\doxycode{labeling-compute-result-output}
+
+\subsection{Routines based on accumulators and *::compute()}
+
+In order to make the code cleaner, small routines are available for the
+most used accumulators.
+
+Currently there are the following routines:\\
+
+\begin{tabular}{l|p{8cm}}
+Name & Description \\
+\hline
+nsites & Return the number of sites of an image or a site set.\\
+mean & Return the mean of the values of an image.\\
+min\_max & Return the min and max values of the values of an image.\\
+sum & Return the sum of the values of an image.
+\end{tabular}
+
+These routines can be found in mln/estim.
+For example, with estim::nsites() simply write:
+\doxycode{estim-sites}
%====================================
\doxysection{partima}{Working with parts of an image}
@@ -1140,9 +1218,9 @@ site set.
%====================================
\newpage
\clearpage
-\doxychapter{graphes}{Graphes and images}
+\doxychapter{graphandima}{Graphes and images}
-//FIXME: REWRITE
+FIXME: REWRITE
%**************************
\doxysection{graphdesc}{Description}
@@ -1301,4 +1379,18 @@ for_all(E)
//FIXME talk about p\_vertices and p\_edges.
+%====================================
+\newpage
+\clearpage
+\doxychapter{arithmops}{Arithmetical operators}
+
+FIXME write it
+
+%====================================
+\newpage
+\clearpage
+\doxychapter{mathtools}{Mathematical tools}
+
+FIXME write it
+
\end{document}
--
1.5.6.5
1
0
cleanup-2008 2613: Update dispatch of the fill_with image and paste routines.
by Nicolas Ballas 20 Oct '08
by Nicolas Ballas 20 Oct '08
20 Oct '08
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Update dispatch of the fill_with image and paste routines.
* tests/level/fill_with_image.cc: New test.
* tests/level/paste.cc: Update.
* tests/level/Makefile.am: Add the new test.
* mln/trait/image/props.hh: Fix documentation.
* mln/trait/images.hh: Fix properties delegation.
* mln/core/image/image_if.hh,
* mln/core/image/flat_image.hh,
* mln/core/image/sub_image.hh,
* mln/pw/image.hh,
* mln/core/image/complex_image.hh: Update image properties.
* mln/core/image/status.txt: Update.
* mln/level/fill_with_image.hh,
* mln/level/fill_with_image.spe.hh: Specialize fill_with_value routine.
* mln/level/fill_with_value.hh: Update documentation.
* mln/level/fill_with_value.spe.hh: Fix a bug in the dispatch.
* mln/level/transform.hh: Update.
* mln/level/paste.hh,
* mln/level/paste.spe.hh: Specialize paste routine.
* mln/morpho/gradient.hh: Delete trailing whitespaces.
mln/core/image/complex_image.hh | 6 +-
mln/core/image/image_if.hh | 3 +
mln/core/image/status.txt | 4 -
mln/core/image/sub_image.hh | 3 +
mln/level/fill_with_image.hh | 7 +-
mln/level/fill_with_image.spe.hh | 94 ++++++++++++++++++++++++++++++-
mln/level/fill_with_value.hh | 3 -
mln/level/fill_with_value.spe.hh | 7 +-
mln/level/paste.hh | 56 ++++++++++--------
mln/level/paste.spe.hh | 116 ++++++++++++++++++++++++++++++---------
mln/level/transform.hh | 1
mln/pw/image.hh | 4 +
mln/trait/image/props.hh | 4 -
mln/trait/images.hh | 4 +
tests/level/Makefile.am | 2
tests/level/fill_with_image.cc | 91 ++++++++++++++++++++++++++++++
tests/level/paste.cc | 16 +++--
17 files changed, 349 insertions(+), 72 deletions(-)
Index: tests/level/fill_with_image.cc
--- tests/level/fill_with_image.cc (revision 0)
+++ tests/level/fill_with_image.cc (revision 0)
@@ -0,0 +1,91 @@
+// Copyright (C) 2007, 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.
+
+/*! \file tests/level/fill_with_value.cc
+ *
+ * \brief Tests on mln::level::fill_with_value
+ */
+
+#include <mln/level/fill_with_value.hh>
+#include <mln/level/fill_with_image.hh>
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/flat_image.hh>
+#include <mln/core/image/sub_image.hh>
+
+#include <mln/core/image/image_if.hh>
+#include <mln/level/compare.hh>
+
+#include <mln/debug/iota.hh>
+#include <mln/debug/println.hh>
+#include <mln/fun/p2b/chess.hh>
+
+
+int main()
+{
+ using namespace mln;
+ const unsigned size = 100;
+
+ {
+ image2d<unsigned int> ima(size, size);
+ image2d<unsigned int> ima2(size, size);
+ debug::iota(ima2);
+
+ level::fill_with_image(ima, ima2);
+ mln_assertion(ima == ima2);
+ }
+
+ {
+ box2d b(point2d(1,2), point2d(2,4));
+ image2d<int> ima(b, 2);
+
+ box2d b2(point2d(-1,-2), point2d(3,6));
+ image2d<int> ima2(b2, 0);
+ debug::iota(ima2);
+
+ level::fill_with_image(ima, ima2);
+ assert(ima == (ima2 | b));
+ }
+
+ {
+ typedef image2d<unsigned char> I;
+ typedef image_if<I, fun::p2b::chess_t> II;
+
+ I ima(size, size);
+ I ima2(size, size);
+ level::fill_with_value(ima, 51);
+ level::fill_with_value(ima2, 42);
+
+ II ima_if = ima | fun::p2b::chess;
+ level::fill_with_image(ima_if, ima2);
+
+ II::piter p(ima_if.domain());
+ for_all(p)
+ mln_assertion(ima_if(p) == 42);
+
+ }
+}
Index: tests/level/paste.cc
--- tests/level/paste.cc (revision 2612)
+++ tests/level/paste.cc (working copy)
@@ -56,11 +56,13 @@
image2d<int> ima2(b2, 0);
debug::iota(ima2);
- level::paste(ima, ima2); // Fast version.
- assert(ima == (ima2 | b));
+ image2d<int> ima3(b, 2);
- level::impl::generic::paste(ima, ima2); // Not so fast version...
+ level::paste(ima, ima2); // Not so fast version...
assert(ima == (ima2 | b));
+
+ level::paste(ima, ima3); // Fast version...
+ assert(ima == ima3);
}
// tests in three dimension
@@ -73,10 +75,12 @@
image3d<int> ima2(b2, 2);
debug::iota(ima2);
- level::paste(ima, ima2); // Fast version.
- assert(ima == (ima2 | b));
+ image3d<int> ima3(b, 2);
- level::impl::generic::paste(ima, ima2); // Not so fast version...
+ level::paste(ima, ima2); // Not so fast version...
assert(ima == (ima2 | b));
+
+ level::paste(ima, ima3); // Fast version...
+ assert(ima == ima3);
}
}
Index: tests/level/Makefile.am
--- tests/level/Makefile.am (revision 2612)
+++ tests/level/Makefile.am (working copy)
@@ -13,6 +13,7 @@
compute \
fill \
fill_with_value \
+ fill_with_image \
median \
median_ \
median_dir \
@@ -36,6 +37,7 @@
compute_SOURCES = compute.cc
fill_SOURCES = fill.cc
fill_with_value_SOURCES = fill_with_value.cc
+fill_with_image_SOURCES = fill_with_image.cc
median_SOURCES = median.cc
median__SOURCES = median_.cc
median_dir_SOURCES = median_dir.cc
Index: mln/trait/image/props.hh
--- mln/trait/image/props.hh (revision 2612)
+++ mln/trait/image/props.hh (working copy)
@@ -122,7 +122,7 @@
// |
// +-- with_grid
// |
-// +-- no_aligned
+// +-- not_aligned
// |
// +-- irrelevant
@@ -363,7 +363,7 @@
// |
// +-- with_grid
// |
-// +-- no_aligned
+// +-- not_aligned
// |
// +-- irrelevant
struct value_alignement
Index: mln/trait/images.hh
--- mln/trait/images.hh (revision 2612)
+++ mln/trait/images.hh (working copy)
@@ -190,12 +190,16 @@
typedef mln_internal_trait_image_speed_from(D) speed; // un-fastest
// value => delegation
+ typedef typename image_<D>::vw_io vw_io;
+ typedef typename image_<D>::vw_set vw_set;
+ typedef typename image_<D>::value_alignement value_alignement;
typedef typename image_<D>::value_access value_access;
typedef typename image_<D>::value_storage value_storage;
typedef typename image_<D>::value_browsing value_browsing;
typedef mln_internal_trait_image_value_io_from(D) value_io; // un-write when D is const
// site => delegation
+ typedef typename image_<D>::pw_io pw_io;
typedef typename image_<D>::localization localization;
typedef typename image_<D>::dimension dimension;
Index: mln/core/image/image_if.hh
--- mln/core/image/image_if.hh (revision 2612)
+++ mln/core/image/image_if.hh (working copy)
@@ -79,6 +79,9 @@
typedef trait::image::ext_value::irrelevant ext_value;
typedef trait::image::ext_io::irrelevant ext_io;
+ typedef trait::image::vw_io::none vw_io;
+ typedef trait::image::vw_set::none vw_set;
+ typedef trait::image::value_alignement::not_aligned value_alignement;
typedef trait::image::value_storage::disrupted value_storage;
};
Index: mln/core/image/status.txt
--- mln/core/image/status.txt (revision 2612)
+++ mln/core/image/status.txt (working copy)
@@ -17,8 +17,8 @@
ok image2d
ok pw::image
-KO image1d
-KO image3d
+ok image1d
+ok image3d
** run-based
Index: mln/core/image/flat_image.hh
Index: mln/core/image/sub_image.hh
--- mln/core/image/sub_image.hh (revision 2612)
+++ mln/core/image/sub_image.hh (working copy)
@@ -86,6 +86,9 @@
typedef trait::image::ext_value::irrelevant ext_value;
typedef trait::image::ext_io::irrelevant ext_io;
+ typedef trait::image::vw_io::none vw_io;
+ typedef trait::image::vw_set::none vw_set;
+ typedef trait::image::value_alignement::not_aligned value_alignement;
typedef trait::image::value_storage::disrupted value_storage;
// HOT FIXME: except if S is a Box
};
Index: mln/core/image/complex_image.hh
--- mln/core/image/complex_image.hh (revision 2612)
+++ mln/core/image/complex_image.hh (working copy)
@@ -86,11 +86,15 @@
// Value.
typedef trait::image::value_access::direct value_access;
// FIXME: Is that right?
- typedef trait::image::value_storage::one_block value_storage;
+ typedef trait::image::vw_io::read_write vw_io;
+ typedef trait::image::vw_set::multi vw_set;
+ typedef trait::image::value_storage::disrupted value_storage;
typedef trait::image::value_browsing::site_wise_only value_browsing;
+ typedef trait::image::value_alignement::irrelevant value_alignement;
typedef trait::image::value_io::read_write value_io;
// Site / domain.
+ typedef trait::image::pw_io::read_write pw_io;
typedef trait::image::localization::space localization;
/* FIXME: Depends on G. We could use
`trait::image::space_from_point<mln_site(G)>::ret' in most
Index: mln/level/fill_with_image.hh
--- mln/level/fill_with_image.hh (revision 2612)
+++ mln/level/fill_with_image.hh (working copy)
@@ -79,8 +79,8 @@
(void)ima;
(void)data;
- mlc_is(mln_trait_image_value_io(I),
- mln::trait::image::value_io::read_write)::check();
+ mlc_is(mln_trait_image_pw_io(I),
+ mln::trait::image::pw_io::read_write)::check();
mlc_converts_to(mln_value(J), mln_value(I))::check();
mln_precondition(exact(ima).has_data());
mln_precondition(exact(data).has_data());
@@ -125,8 +125,7 @@
{
trace::entering("level::fill_with_image");
- internal::fill_with_image_tests(ima, data);
- internal::fill_with_image_dispatch(ima, data);
+ internal::fill_with_image_(ima, data);
trace::exiting("level::fill_with_image");
}
Index: mln/level/paste.spe.hh
--- mln/level/paste.spe.hh (revision 2612)
+++ mln/level/paste.spe.hh (working copy)
@@ -51,15 +51,26 @@
namespace level
{
+ namespace internal
+ {
+
+
+ template <typename I, typename J>
+ inline
+ void paste_tests(const Image<I>& input, Image<J>& output);
+ }
+
namespace impl
{
namespace generic
{
template <typename I, typename J>
- void paste(const Image<I>& data, Image<J>& destination);
+ void paste_(const Image<I>& input, Image<J>& output);
}
+
+
// template <typename I, typename J>
// inline
// void paste_lines_(const I& data, J& destination)
@@ -83,42 +94,97 @@
// }
-// // Disjunction.
+ template <typename I, typename J>
+ void paste_fast(const Image<I>& input_, Image<J>& output_)
+ {
+ trace::entering("level::impl::paste_fast");
-// // Remember: raw < linear < stored, computed.
+ const I& input = exact(input_);
+ J& output = exact(output_);
-// template <typename I, typename J>
-// inline
-// void paste_(trait::image::value_storage::any, const I& data,
-// trait::image::value_storage::any, J& destination)
-// {
-// generic::paste_(data, destination);
-// }
+ level::internal::paste_tests(input, output);
-// template <typename I, typename J>
-// inline
-// void paste_(trait::image::value_storage::one_block, const I& data,
-// trait::image::value_storage::one_block, J& destination)
-// {
-// if (sizeof(mln_value(I)) == sizeof(mln_value(J)))
-// paste_lines_(data, destination);
-// else
-// generic::paste_(data, destination);
-// }
+ mln_pixter(const I) pi(input);
+ mln_pixter(J) po(output);
+ po.start();
+ for_all(pi)
+ {
+ po.val() = pi.val();
+ }
+ trace::entering("level::impl::paste_fast");
+ }
+
+ } // end of namespace impl.
- } // end of namespace mln::level::impl
+ // Dispatch.
namespace internal
{
+
+ template <typename I, typename J>
+ inline
+ void paste_(trait::image::value_storage::any,
+ trait::image::value_storage::any,
+ const Image<I>& input,
+ Image<J>& output)
+ {
+ impl::generic::paste_(input, output);
+ }
+
+ template <typename I, typename J>
+ inline
+ void paste_(trait::image::value_storage::one_block,
+ trait::image::value_storage::one_block,
+ const Image<I>& input_,
+ Image<J>& output_)
+ {
+ const I& input = exact(input_);
+ J& output = exact(output_);
+
+ /// Check basic properties
+ if (mlc_is(mln_trait_image_value_access(J),
+ trait::image::value_access::direct)::value &&
+ mlc_is(mln_trait_image_value_access(I),
+ trait::image::value_access::direct)::value &&
+ mlc_is(mln_trait_image_value_alignement(I),
+ trait::image::value_alignement::with_grid)::value &&
+ mlc_is(mln_trait_image_value_alignement(J),
+ trait::image::value_alignement::with_grid)::value)
+ {
+ /// Check ext_domain
+ if (
+ ((mlc_is(mln_trait_image_ext_domain(I),
+ trait::image::ext_domain::fixed)::value ||
+ mlc_is(mln_trait_image_ext_domain(I),
+ trait::image::ext_domain::extendable)::value) &&
+ (mlc_is(mln_trait_image_ext_domain(J),
+ trait::image::ext_domain::fixed)::value ||
+ mlc_is(mln_trait_image_ext_domain(J),
+ trait::image::ext_domain::extendable)::value) &&
+ input.border() == output.border()) ||
+ (mlc_is(mln_trait_image_ext_domain(I),
+ trait::image::ext_domain::none)::value &&
+ mlc_is(mln_trait_image_ext_domain(J),
+ trait::image::ext_domain::none)::value))
+ {
+ /// Check domain
+ if (input.domain() == output.domain())
+ impl::paste_fast(input, output);
+ }
+ }
+ impl::generic::paste_(input, output);
+ }
+
+
template <typename I, typename J>
inline
- void paste_dispatch(const Image<I>& data, Image<J>& destination)
+ void paste_(const Image<I>& input, Image<J>& output)
{
- impl::generic::paste(data, destination);
-// impl::paste_(mln_trait_image_value_storage(I)(), data,
-// mln_trait_image_value_storage(J)(), destination);
+ paste_(mln_trait_image_value_storage(I)(),
+ mln_trait_image_value_storage(J)(),
+ input, output);
}
} // end of namespace mln::level::internal
Index: mln/level/fill_with_value.spe.hh
--- mln/level/fill_with_value.spe.hh (revision 2612)
+++ mln/level/fill_with_value.spe.hh (working copy)
@@ -78,6 +78,7 @@
{
trace::entering("level::impl::fill_with_value_one_block");
+
I& ima = exact(ima_);
internal::fill_with_value_tests(ima, val);
mln_precondition(((mlc_is(mln_trait_image_pw_io(I),
@@ -178,14 +179,16 @@
trait::image::vw_io::read_write,
Image<I>& ima, const V& val)
{
- impl::fill_with_value_cell_wise(ima, val);
+ // FIXME
+ //impl::fill_with_value_cell_wise(ima, val);
+ impl::generic::fill_with_value(ima, val);
}
template <typename I, typename V>
void fill_with_value_dispatch(trait::image::value_storage::disrupted,
- trait::image::vw_io::read,
+ trait::image::vw_io::any,
Image<I>& ima, const V& val)
{
impl::generic::fill_with_value(ima, val);
Index: mln/level/fill_with_image.spe.hh
--- mln/level/fill_with_image.spe.hh (revision 2612)
+++ mln/level/fill_with_image.spe.hh (working copy)
@@ -49,6 +49,17 @@
namespace level
{
+ namespace internal
+ {
+
+ template <typename I, typename J>
+ inline
+ void fill_with_image_tests(Image<I>& ima, const Image<J>& data);
+
+ } // end of namespace mln::level::internal
+
+
+
namespace impl
{
@@ -58,20 +69,99 @@
void fill_with_image(Image<I>& ima, const Image<J>& data);
}
- // FIXME: Add specializations here...
+ template <typename I, typename J>
+ void fill_with_image_fast(Image<I>& ima_, const Image<J>& data_)
+ {
+ trace::entering("level::impl::fill_with_image_fast");
+
+ I& ima = exact(ima_);
+ const J& data = exact(data_);
+
+ level::internal::fill_with_image_tests(ima, data);
+
+ mln_pixter(I) pi(ima);
+ mln_pixter(const J) d(data);
+ d.start();
+ for_all(pi)
+ {
+ pi.val() = d.val();
+ }
+ trace::entering("level::impl::fill_with_image_fast");
+ }
} // end of namespace mln::level::impl
+
+
+ // Namespace dispatch
namespace internal
{
template <typename I, typename J>
inline
- void fill_with_image_dispatch(Image<I>& ima, const Image<J>& data)
+ void fill_with_image_(trait::image::value_storage::any,
+ trait::image::value_storage::any,
+ Image<I>& ima,
+ const Image<J>& data)
{
impl::generic::fill_with_image(ima, data);
}
+ template <typename I, typename J>
+ inline
+ void fill_with_image_(trait::image::value_storage::one_block,
+ trait::image::value_storage::one_block,
+ Image<I>& ima_,
+ const Image<J>& data_)
+ {
+ I& ima = exact(ima_);
+ const J& data = exact(data_);
+
+ /// Check basic properties
+ if (mlc_is(mln_trait_image_value_access(J),
+ trait::image::value_access::direct)::value &&
+ mlc_is(mln_trait_image_value_access(I),
+ trait::image::value_access::direct)::value &&
+ mlc_is(mln_trait_image_value_alignement(I),
+ trait::image::value_alignement::with_grid)::value &&
+ mlc_is(mln_trait_image_value_alignement(J),
+ trait::image::value_alignement::with_grid)::value)
+ {
+ /// Check ext_domain
+ if (
+ ((mlc_is(mln_trait_image_ext_domain(I),
+ trait::image::ext_domain::fixed)::value ||
+ mlc_is(mln_trait_image_ext_domain(I),
+ trait::image::ext_domain::extendable)::value) &&
+ (mlc_is(mln_trait_image_ext_domain(J),
+ trait::image::ext_domain::fixed)::value ||
+ mlc_is(mln_trait_image_ext_domain(J),
+ trait::image::ext_domain::extendable)::value) &&
+ data.border() == data.border()) ||
+ (mlc_is(mln_trait_image_ext_domain(I),
+ trait::image::ext_domain::none)::value &&
+ mlc_is(mln_trait_image_ext_domain(J),
+ trait::image::ext_domain::none)::value))
+ {
+ /// Check domain
+ if (data.domain() == data.domain())
+ impl::fill_with_image_fast(ima, data);
+ }
+ }
+ impl::generic::fill_with_image(ima, data);
+ }
+
+
+
+ template <typename I, typename J>
+ inline
+ void fill_with_image_(Image<I>& ima, const Image<J>& data)
+ {
+ fill_with_image_(mln_trait_image_value_storage(I)(),
+ mln_trait_image_value_storage(J)(),
+ ima, data);
+ }
+
} // end of namespace mln::level::internal
} // end of namespace mln::level
Index: mln/level/transform.hh
--- mln/level/transform.hh (revision 2612)
+++ mln/level/transform.hh (working copy)
@@ -128,6 +128,7 @@
O& output = exact(output_);
level::internal::transform_tests(input, f, output);
+
mlc_is(mln_trait_image_pw_io(O),
trait::image::pw_io::read_write)::check();
Index: mln/level/paste.hh
--- mln/level/paste.hh (revision 2612)
+++ mln/level/paste.hh (working copy)
@@ -49,25 +49,25 @@
namespace level
{
- /// \brief Paste the contents of image \p data into the image \p
- /// destination.
+ /// \brief Paste the contents of image \p input into the image \p
+ /// output.
///
- /// \param[in] data The input image providing pixels values.
- /// \param[in,out] destination The image in which values are
+ /// \param[in] input The input image providing pixels values.
+ /// \param[in,out] output The image in which values are
/// assigned.
///
/// This routine runs: \n
- /// for all p of \p data, \p destination(p) = \p data(p).
+ /// for all p of \p input, \p output(p) = \p input(p).
///
- /// \warning The definition domain of \p data has to be included in
- /// the one of \p destination; so using mln::safe_image does not
- /// make pasting outside the destination domain work.
+ /// \warning The definition domain of \p input has to be included in
+ /// the one of \p output; so using mln::safe_image does not
+ /// make pasting outside the output domain work.
///
- /// \pre \p data.domain <= \p destination.domain
+ /// \pre \p input.domain <= \p output.domain
///
/// \{
template <typename I, typename J>
- void paste(const Image<I>& data, Image<J>& destination);
+ void paste(const Image<I>& input, Image<J>& output);
/// \}
@@ -79,14 +79,17 @@
template <typename I, typename J>
inline
- void paste_tests(const Image<I>& data, Image<J>& destination)
+ void paste_tests(const Image<I>& input, Image<J>& output)
{
- mlc_is(mln_trait_image_value_io(J), trait::image::value_io::read_write)::check();
+ mlc_is(mln_trait_image_pw_io(J), trait::image::pw_io::read_write)::
+ check();
mlc_converts_to(mln_value(I), mln_value(J))::check();
- mln_precondition(exact(data).has_data());
- mln_precondition(exact(data).domain() <= exact(destination).domain());
- (void)data;
- (void)destination;
+
+ mln_precondition(exact(input).has_data());
+ mln_precondition(exact(input).domain() <= exact(output).domain());
+
+ (void)input;
+ (void)output;
}
} // end of namespace mln::level::internal
@@ -99,17 +102,19 @@
template <typename I, typename J>
inline
- void paste(const Image<I>& data_, Image<J>& destination_)
+ void paste_(const Image<I>& input_, Image<J>& output_)
{
trace::entering("level::impl::generic::paste");
- level::internal::paste_tests(data_, destination_);
- const I& data = exact(data_);
- J& destination = exact(destination_);
+ level::internal::paste_tests(input_, output_);
+
+ const I& input = exact(input_);
+ J& output = exact(output_);
- mln_piter(I) p(data.domain());
+
+ mln_piter(I) p(input.domain());
for_all(p)
- destination(p) = data(p);
+ output(p) = input(p);
trace::exiting("level::impl::generic::paste");
}
@@ -123,12 +128,13 @@
template <typename I, typename J>
inline
- void paste(const Image<I>& data, Image<J>& destination)
+ void paste(const Image<I>& input, Image<J>& output)
{
trace::entering("level::paste");
- internal::paste_tests(data, destination);
- internal::paste_dispatch(data, destination);
+
+ internal::paste_tests(input, output);
+ internal::paste_(input, output);
trace::exiting("level::paste");
}
Index: mln/level/fill_with_value.hh
--- mln/level/fill_with_value.hh (revision 2612)
+++ mln/level/fill_with_value.hh (working copy)
@@ -33,9 +33,6 @@
* \brief Fill an image with a value, that is, set all pixel values to
* the given value.
*
- * \todo Overload for fastest images.
- * \todo Handle all value_storage properties (piecewise, etc.)
- * \todo Make memset_ work and use it when appropriate.
* \todo Move specializations in a extra file.
* \toto Activate fill_with_value_cell_wise.
* \todo Optimize when \p ima is large and sizeof(mln_value(I)) > 1.
Index: mln/pw/image.hh
--- mln/pw/image.hh (revision 2612)
+++ mln/pw/image.hh (working copy)
@@ -89,12 +89,16 @@
typedef trait::image::size::regular size;
// value
+ typedef trait::image::vw_io::none vw_io;
+ typedef trait::image::vw_set::none vw_set;
typedef trait::image::value_access::computed value_access;
typedef trait::image::value_storage::disrupted value_storage;
typedef trait::image::value_browsing::site_wise_only value_browsing;
+ typedef trait::image::value_alignement::irrelevant value_alignement;
typedef trait::image::value_io::read_only value_io;
// site / domain
+ typedef trait::image::pw_io::read pw_io;
typedef /* FIXME: depends on S */ undef localization;
typedef /* FIXME: depends on S */ undef dimension;
Index: mln/morpho/gradient.hh
1
0
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
Registration Fix.
* mln/convert/to_image.hh: Fix missing ;.
* mln/convert/to_p_array.hh: Fix use of mln_point.
* mln/fun/x2v/all.hh: Fix wrong comment.
* mln/fun/x2x/rotation.hh: Add constructor with quaternion.
* mln/fun/x2p/closest_point.hh: Fix warning.
* mln/algebra/quat.hh (quad::rotate): Add method.
* mln/registration/get_rot.hh: New. Get rotation needed btw 2 p_arrays.
* mln/registration/registration.hh: Add inclusion.
* mln/registration/icp.hh: Minor fix.
* mln/registration/get_rtransf.hh: Split code.
* mln/registration/internal/rms.hh: Add specific rms computation.
algebra/quat.hh | 11 +++
convert/to_image.hh | 4 -
convert/to_p_array.hh | 4 -
fun/x2p/closest_point.hh | 2
fun/x2v/all.hh | 2
fun/x2x/rotation.hh | 32 +++++++++-
registration/get_rot.hh | 128
+++++++++++++++++++++++++++++++++++++++++++
registration/get_rtransf.hh | 46 +--------------
registration/icp.hh | 7 +-
registration/internal/rms.hh | 78 ++++++++++++++++++++++++++
registration/registration.hh | 6 +-
11 files changed, 262 insertions(+), 58 deletions(-)
Index: mln/convert/to_image.hh
--- mln/convert/to_image.hh (revision 2611)
+++ mln/convert/to_image.hh (working copy)
@@ -124,9 +124,9 @@
template <typename W>
mln_image_from(W, mln_weight(W)) to_image(const
Weighted_Window<W>& w_win);
- /// Convert an histo \p h into an image1d<std::size_t>.
+ /// Convert an histo \p h into an image1d<T>.
template <typename T>
- image1d<T> to_image(const histo::data<T>& h)
+ image1d<T> to_image(const histo::data<T>& h);
Index: mln/convert/to_p_array.hh
--- mln/convert/to_p_array.hh (revision 2611)
+++ mln/convert/to_p_array.hh (working copy)
@@ -92,12 +92,12 @@
template <typename I>
inline
- p_array<mln_point(I)>
+ p_array<mln_psite(I)>
to_p_array(const Image<I>& img_)
{
const I& img = exact(img_);
- p_array<mln_point(I)> a;
+ p_array<mln_psite(I)> a;
mln_piter(I) p(img.domain());
for_all(p)
Index: mln/fun/x2v/all.hh
--- mln/fun/x2v/all.hh (revision 2611)
+++ mln/fun/x2v/all.hh (working copy)
@@ -44,7 +44,7 @@
namespace x2v
{
- /// Internal namespace of functions form vector to vector.
+ /// Internal namespace of functions form vector to value.
namespace internal
{
}
Index: mln/fun/x2x/rotation.hh
--- mln/fun/x2x/rotation.hh (revision 2611)
+++ mln/fun/x2x/rotation.hh (working copy)
@@ -37,6 +37,7 @@
# include <mln/fun/internal/x2x_linear_impl.hh>
# include <mln/algebra/vec.hh>
# include <mln/algebra/mat.hh>
+# include <mln/algebra/quat.hh>
# include <cmath>
namespace mln
@@ -106,14 +107,13 @@
const float sin_a = sin(alpha_);
m_(0,0) = cos_a; m_(0,1) = -sin_a; m_(0,2) = 0;
-
m_(1,0) = sin_a; m_(1,1) = cos_a; m_(1,2) = 0;
-
m_(2,0) = 0; m_(2,1) = 0; m_(2,2) = 1;
return m_;
}
- }
+
+ } // end of namespace internal
/*! \brief Represent a rotation function.
@@ -135,6 +135,8 @@
rotation();
/// Constructor with grade alpha and a facultative direction
(rotation axis).
rotation(float alpha, const algebra::vec<n,float>& axis);
+ /// Constructor with quaternion
+ rotation(const algebra::quat& q);
using super_::operator();
/// Perform the rotation of the given vector.
@@ -143,7 +145,7 @@
/// Set a new grade alpha.
void set_alpha(float alpha);
/// Set a new rotation axis.
- void set_dir(unsigned dir);
+ void set_axis(const algebra::vec<n,float>& axis);
protected:
void update();
@@ -173,6 +175,25 @@
template <unsigned n, typename C>
inline
+ rotation<n,C>::rotation(const algebra::quat& q)
+ {
+ mln_precondition(q.is_unit());
+ // FIXME: Should also work for 2d.
+ mln_precondition(n == 3);
+ float
+ w = q.to_vec()[0],
+ x = q.to_vec()[1], x2 = 2*x*x, xw = 2*x*w,
+ y = q.to_vec()[2], y2 = 2*y*y, xy = 2*x*y, yw = 2*y*w,
+ z = q.to_vec()[3], z2 = 2*z*z, xz = 2*x*z, yz = 2*y*z, zw
= 2*z*w;
+ float t[16] = {1.f - y2 - z2, xy - zw, xz + yw, 0,
+ xy + zw, 1.f - x2 - z2, yz - xw, 0,
+ xz - yw, yz + xw, 1.f - x2 - y2, 0,
+ 0, 0, 0, 1};
+ this->m_(make::mat<4,4,16,float>(t));
+ }
+
+ template <unsigned n, typename C>
+ inline
algebra::vec<n,C>
rotation<n,C>::operator()(const algebra::vec<n,C>& v) const
{
@@ -211,8 +232,9 @@
template <unsigned n, typename C>
inline
void
- rotation<n,C>::set_dir(unsigned dir)
+ rotation<n,C>::set_axis(const algebra::vec<n,float>& axis)
{
+ axis_ = axis;
update();
}
Index: mln/fun/x2p/closest_point.hh
--- mln/fun/x2p/closest_point.hh (revision 2611)
+++ mln/fun/x2p/closest_point.hh (working copy)
@@ -49,7 +49,7 @@
typedef P result;
closest_point(const p_array<P>& X, const box<P>& box)
- : X(X), box_(box)
+ : box_(box), X(X)
, log_functor_call(0)
{ }
Index: mln/algebra/quat.hh
--- mln/algebra/quat.hh (revision 2611)
+++ mln/algebra/quat.hh (working copy)
@@ -192,6 +192,10 @@
/// Transform into unit quaternion.
quat& set_unit();
+ /// Rotate using quaternion definition of a rotation
+ template <unsigned n>
+ algebra::vec<n,float> rotate(const algebra::vec<n,float>& v);
+
/// Transform into unit quaternion.
template <typename T>
void set_unit(float theta, const algebra::vec<3,T>& uv);
@@ -475,6 +479,13 @@
set_unit(theta(), uv);
}
+ template <unsigned n>
+ inline
+ algebra::vec<n,float>
+ quat::rotate(const algebra::vec<n,float>& v)
+ {
+ return ((*this) * quat(0. ,v) * (*this).inv()).v();
+ }
// Operators.
Index: mln/registration/get_rot.hh
--- mln/registration/get_rot.hh (revision 0)
+++ mln/registration/get_rot.hh (revision 0)
@@ -0,0 +1,128 @@
+// 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.
+
+#ifndef MLN_REGISTRATION_GET_ROT_HH
+# define MLN_REGISTRATION_GET_ROT_HH
+
+# include <mln/fun/x2x/all.hh>
+# include <mln/algebra/quat.hh>
+# include <mln/math/jacobi.hh>
+
+namespace mln
+{
+
+ namespace registration
+ {
+
+ template <typename P, typename M>
+ fun::x2x::rotation<P::dim, float>
+ get_rot(const p_array<P>& c,
+ const algebra::vec<P::dim,float>& mu_c,
+ const p_array<P>& ck,
+ const M& map,
+ const algebra::vec<P::dim,float>& mu_xk);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename P, typename M>
+ fun::x2x::rotation<2u, float>
+ get_rot(const p_array<P>& c,
+ const algebra::vec<2u,float>& mu_c,
+ const p_array<P>& ck,
+ const M& map,
+ const algebra::vec<2u,float>& mu_xk)
+ {
+ //FIXME: Write 2d version of rotation computation betwenn two p_array
+ return fun::x2x::rotation<2u, float>();
+ }
+
+ template <typename P, typename M>
+ fun::x2x::rotation<3u, float>
+ get_rot(const p_array<P>& c,
+ const algebra::vec<3u,float>& mu_c,
+ const p_array<P>& ck,
+ const M& map,
+ const algebra::vec<3u,float>& mu_xk)
+ {
+ //FIXME: Make assertion static
+ mln_precondition(3u == 3);
+
+ // FIXME: Make use of a cross_covariance accu (maybe not because
of map(ck[i]))
+ algebra::mat<3u,3u,float> Mk(literal::zero);
+ for (unsigned i = 0; i < c.nsites(); ++i)
+ {
+ algebra::vec<3u,float> ci = c[i];
+ algebra::vec<3u,float> xki = map(ck[i]);
+ Mk += make::mat(ci - mu_c) * trans(make::mat(xki - mu_xk));
+ }
+ Mk /= c.nsites();
+
+ algebra::vec<3u,float> a;
+ a[0] = Mk(1,2) - Mk(2,1);
+ a[1] = Mk(2,0) - Mk(0,2);
+ a[2] = Mk(0,1) - Mk(1,0);
+
+ algebra::mat<4u,4u,float> Qk(literal::zero);
+ float t = tr(Mk);
+
+ Qk(0,0) = t;
+ for (int i = 1; i < 4; i++)
+ {
+ Qk(i,0) = a[i - 1];
+ Qk(0,i) = a[i - 1];
+ for (int j = 1; j < 4; j++)
+ if (i == j)
+ Qk(i,j) = 2 * Mk(i - 1,i - 1) - t;
+ }
+
+ Qk(1,2) = Mk(0,1) + Mk(1,0);
+ Qk(2,1) = Mk(0,1) + Mk(1,0);
+
+ Qk(1,3) = Mk(0,2) + Mk(2,0);
+ Qk(3,1) = Mk(0,2) + Mk(2,0);
+
+ Qk(2,3) = Mk(1,2) + Mk(2,1);
+ Qk(3,2) = Mk(1,2) + Mk(2,1);
+
+ algebra::quat qR(literal::zero);
+ qR = math::jacobi(Qk);
+
+ return fun::x2x::rotation<3u, float>(qR);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+ } // end of namespace registration
+
+} // end of namespace mln
+
+#endif /* MLN_REGISTRATION_GET_ROT_HH */
+
+
Index: mln/registration/registration.hh
--- mln/registration/registration.hh (revision 2611)
+++ mln/registration/registration.hh (working copy)
@@ -37,6 +37,7 @@
# include <mln/fun/x2x/all.hh>
# include <mln/fun/x2p/closest_point.hh>
# include <mln/core/image/lazy_image.hh>
+# include <mln/convert/to_p_array.hh>
namespace mln
{
@@ -66,8 +67,9 @@
registration_(const I& cloud,
const J& surface)
{
- p_array<mln_psite(I)> c = convert::to< p_array<mln_psite(I)>
>(cloud);
- p_array<mln_psite(J)> x = convert::to< p_array<mln_psite(I)>
>(surface);
+ //FIXME: Use convert::to< p_array<mln_psite(I)> >()
+ p_array<mln_psite(I)> c = convert::to_p_array(cloud);
+ p_array<mln_psite(J)> x = convert::to_p_array(surface);
//init rigid transform qk
composed< rotation<I::psite::dim, float>,
translation<I::psite::dim, float> > qk;
Index: mln/registration/icp.hh
--- mln/registration/icp.hh (revision 2611)
+++ mln/registration/icp.hh (working copy)
@@ -36,6 +36,7 @@
# include <mln/fun/x2x/all.hh>
# include <mln/fun/x2v/all.hh>
# include <mln/registration/get_rtransf.hh>
+# include <mln/registration/internal/rms.hh>
namespace mln
{
@@ -180,10 +181,12 @@
// d_k = d(Yk, Pk+1)
// = d(closest(qk-1(P)), qk(P))
- d_k = rms(c, map, buf_qk[1], qk);
+ d_k = internal::rms(c, map, buf_qk[1], qk);
k++;
- } while ((qk - buf_qk[1]).sqr_norm() / qk.sqr_norm() > epsilon);
+ //FIXME: Add matrix norm
+ //} while ((qk - buf_qk[1]).sqr_norm() / qk.sqr_norm() >
epsilon);
+ } while (d_k > epsilon);
trace::exiting("registration::impl::icp_");
}
Index: mln/registration/get_rtransf.hh
--- mln/registration/get_rtransf.hh (revision 2611)
+++ mln/registration/get_rtransf.hh (working copy)
@@ -31,6 +31,7 @@
# include <mln/fun/x2x/all.hh>
# include <mln/algebra/quat.hh>
# include <mln/math/jacobi.hh>
+# include <mln/registration/get_rot.hh>
namespace mln
{
@@ -50,7 +51,6 @@
# ifndef MLN_INCLUDE_ONLY
-
template <typename P, typename M>
composed<rotation<P::dim, float>, translation<P::dim, float> >
get_rtransf(const p_array<P>& c,
@@ -64,51 +64,11 @@
mu_xk += convert::to< algebra::vec<P::dim,float> >(map(ck[i]));
mu_xk /= c.nsites();
- // FIXME: Make use of a cross_covariance accu (maybe not because
of map(ck[i]))
// qR
- algebra::mat<P::dim,P::dim,float> Mk(literal::zero);
- for (unsigned i = 0; i < c.nsites(); ++i)
- {
- algebra::vec<P::dim,float> ci = c[i];
- algebra::vec<P::dim,float> xki = map(ck[i]);
- Mk += make::mat(ci - mu_c) * trans(make::mat(xki - mu_xk));
- }
- Mk /= c.nsites();
-
- algebra::vec<3,float> a;
- a[0] = Mk(1,2) - Mk(2,1);
- a[1] = Mk(2,0) - Mk(0,2);
- a[2] = Mk(0,1) - Mk(1,0);
-
- algebra::mat<4,4,float> Qk(literal::zero);
- float t = tr(Mk);
-
- Qk(0,0) = t;
- for (int i = 1; i < 4; i++)
- {
- Qk(i,0) = a[i - 1];
- Qk(0,i) = a[i - 1];
- for (int j = 1; j < 4; j++)
- if (i == j)
- Qk(i,j) = 2 * Mk(i - 1,i - 1) - t;
- }
-
- Qk(1,2) = Mk(0,1) + Mk(1,0);
- Qk(2,1) = Mk(0,1) + Mk(1,0);
-
- Qk(1,3) = Mk(0,2) + Mk(2,0);
- Qk(3,1) = Mk(0,2) + Mk(2,0);
-
- Qk(2,3) = Mk(1,2) + Mk(2,1);
- Qk(3,2) = Mk(1,2) + Mk(2,1);
-
- algebra::quat qR(literal::zero);
- qR = math::jacobi(Qk);
+ rotation<P::dim, float> tqR = get_rot(c, mu_c, ck, map, mu_xk);
// qT
- const algebra::vec<P::dim,float> qT = mu_xk - rotate(qR, mu_c);
-
- rotation<P::dim, float> tqR(qR);
+ const algebra::vec<P::dim,float> qT = mu_xk - tqR(mu_c);
translation<P::dim, float> tqT(qT);
return compose(tqR,tqT);
}
Index: mln/registration/internal/rms.hh
--- mln/registration/internal/rms.hh (revision 0)
+++ mln/registration/internal/rms.hh (revision 0)
@@ -0,0 +1,78 @@
+// 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.
+
+#ifndef MLN_REGISTRATION_INTERNAL_RMS_HH
+# define MLN_REGISTRATION_INTERNAL_RMS_HH
+
+# include <mln/core/site_set/p_array.hh>
+
+namespace mln
+{
+
+ namespace registration
+ {
+
+ namespace internal
+ {
+
+ template <typename P, typename M, typename T>
+ float rms(const p_array<P>& a1,
+ M& map,
+ const unsigned length,
+ const T& q1,
+ const T& q2);
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename P, typename M, typename T>
+ float rms(const p_array<P>& a,
+ M& map,
+ const T& q1,
+ const T& q2)
+ {
+ float f = 0.f;
+ for (unsigned i = 0; i < a.nsites(); ++i)
+ {
+ algebra::vec<P::dim,float> a2f = q2(a[i]);
+ algebra::vec<P::dim,float> a1f =
map(algebra::to_point<P>(q1(a[i])));
+ f += norm::l2(a1f - a2f);
+ }
+ return f / a.nsites();
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of nqmespace mln::registration::internal
+
+ } // end of namespace mln::registration
+
+} // end of namespace mln
+
+
+#endif // ! MLN_REGISTRATION_INTERNAL_RMS_HH
1
0
URL: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
ChangeLog:
2008-10-18 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
* mln/linear/gaussian.hh: Fix linear::gaussian.
(mln_dpsite doesn't exists yet).
---
gaussian.hh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: branches/cleanup-2008/milena/mln/linear/gaussian.hh
===================================================================
--- branches/cleanup-2008/milena/mln/linear/gaussian.hh (revision 2610)
+++ branches/cleanup-2008/milena/mln/linear/gaussian.hh (revision 2611)
@@ -160,7 +160,7 @@
const mln_psite(I)& start,
const mln_psite(I)& finish,
int len,
- const mln_dpsite(I)& d)
+ const mln_deduce(I, psite, delta)& d)
{
std::vector<WorkType> tmp1(len);
std::vector<WorkType> tmp2(len);
1
0
URL: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox
ChangeLog:
2008-10-18 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Improve OCR preprocessing.
* garrigues/ocr/ocr.cc: Add resize + gaussian blur.
* garrigues/ocr/resize.hh: New. Enlarge an image.
---
ocr.cc | 34 ++++++++++++++++-----
resize.hh | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 121 insertions(+), 9 deletions(-)
Index: branches/cleanup-2008/milena/sandbox/garrigues/ocr/resize.hh
===================================================================
--- branches/cleanup-2008/milena/sandbox/garrigues/ocr/resize.hh (revision 0)
+++ branches/cleanup-2008/milena/sandbox/garrigues/ocr/resize.hh (revision 2610)
@@ -0,0 +1,96 @@
+// 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.
+
+#ifndef MLN_GEOM_RESIZE_HH
+# define MLN_GEOM_RESIZE_HH
+
+# include <mln/win/rectangle2d.hh>
+
+namespace mln
+{
+
+ namespace geom
+ {
+
+
+ /*!
+ * \brief Resize an image \p input_ with \p ratio.
+ *
+ * \param[in] input_ The image to resize.
+ * \param[in] ratio The ratio of the resize image.
+ *
+ * \pre \p input_ has to be initialized.
+ * \pre \p ratio >= 1.
+ *
+ * \return The resized image.
+ */
+ template <typename I>
+ mln_concrete(I)
+ resize(const Image<I>& input_, const unsigned ratio);
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I>
+ mln_concrete(I)
+ resize(const Image<I>& input_, const unsigned ratio)
+ {
+ trace::entering("mln::geom::resize");
+
+ typedef mln_concrete(I) O;
+
+ const I input = exact (input_);
+
+ std::size_t rows = input.domain().len(0);
+ std::size_t cols = input.domain().len(1);
+ std::size_t new_rows = ratio * rows;
+ std::size_t new_cols = ratio * cols;
+
+ O output(new_rows, new_cols);
+
+ mln_piter(O) p(output.domain());
+
+ for_all(p)
+ {
+ output(p) = input(point2d(p[0] / ratio, p[1] / ratio)) ? 255 : 0;
+ }
+
+ trace::exiting("mln::geom::resize");
+ return output;
+
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+ } // end of namespace mln::geom
+
+} // end of namespace mln
+
+
+
+#endif // ! MLN_GEOM_RESIZE_HH
Index: branches/cleanup-2008/milena/sandbox/garrigues/ocr/ocr.cc
===================================================================
--- branches/cleanup-2008/milena/sandbox/garrigues/ocr/ocr.cc (revision 2609)
+++ branches/cleanup-2008/milena/sandbox/garrigues/ocr/ocr.cc (revision 2610)
@@ -31,29 +31,45 @@
#include <mln/core/alias/window2d.hh>
#include <mln/core/alias/neighb2d.hh>
+#include <mln/core/image/cast_image.hh>
+
#include <mln/value/int_u8.hh>
-#include <mln/morpho/meyer_wst.hh>
+#include "resize.hh"
+#include <mln/linear/convolve.hh>
+#include <mln/linear/gaussian.hh>
-#include <mln/io/pgm/load.hh>
+#include <mln/trace/all.hh>
+#include <mln/io/pbm/load.hh>
#include <mln/io/pgm/save.hh>
+#include <mln/core/alias/w_window2d_float.hh>
int main(int argc, char** argv)
{
+ mln::trace::quiet = false;
+
using namespace mln;
using value::int_u8;
- image2d<int_u8> input;
+ image2d<bool> input;
+ image2d<int_u8> output;
+ image2d<int_u8> output2;
if (argc != 3)
return 1;
- io::pgm::load(input, argv[1]);
- typedef int_u8 wst_val;
- wst_val nbasins;
- image2d<int_u8> output = morpho::meyer_wst(input, c4(), nbasins);
- std::cout << "nbasins = " << nbasins << std::endl;
- io::pgm::save(output, argv[2]);
+
+ io::pbm::load(input, argv[1]);
+
+
+ // Step 1: Enlarge input.
+ output = geom::resize(cast_image<int_u8>(input), 4);
+
+ // Step 2: Blur.
+ initialize(output2, output);
+ linear::gaussian(output, 15, output2);
+
+ io::pgm::save(output2, argv[2]);
}
1
0
From: Jimmy Ma <jimmy.ma(a)lrde.epita.fr>
To: olena-patches(a)lrde.epita.fr
Subject: r2609: Create a ocr directory
URL: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox
ChangeLog:
2008-10-18 Jimmy Ma <jimmy.ma(a)lrde.epita.fr>
Create a ocr directory.
* garrigues/ocr/ocr.cc: New.
* garrigues/ocr: New.
---
ocr.cc | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
Index: branches/cleanup-2008/milena/sandbox/garrigues/ocr/ocr.cc
===================================================================
--- branches/cleanup-2008/milena/sandbox/garrigues/ocr/ocr.cc (revision 0)
+++ branches/cleanup-2008/milena/sandbox/garrigues/ocr/ocr.cc (revision 2609)
@@ -0,0 +1,59 @@
+// Copyright (C) 2008 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/window2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+
+#include <mln/value/int_u8.hh>
+
+#include <mln/morpho/meyer_wst.hh>
+
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+
+int main(int argc, char** argv)
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<int_u8> input;
+
+ if (argc != 3)
+ return 1;
+
+ io::pgm::load(input, argv[1]);
+
+ typedef int_u8 wst_val;
+ wst_val nbasins;
+ image2d<int_u8> output = morpho::meyer_wst(input, c4(), nbasins);
+ std::cout << "nbasins = " << nbasins << std::endl;
+ io::pgm::save(output, argv[2]);
+}
1
0
2608: Factor mln/core/image/complex_windows.hh using the preprocessor.
by Roland Levillain 18 Oct '08
by Roland Levillain 18 Oct '08
18 Oct '08
* mln/core/image/complex_windows.hh
(mln_gen_complex_window): New (generator) macro.
Use it to factor...
(mln::complex_lower_window_p<D, G>)
(mln::complex_higher_window_p<D, G>)
(mln::complex_lower_higher_window_p<D, G>)
(mln::complex_lower_dim_connected_n_face_window_p<D, G>)
(mln::complex_higher_dim_connected_n_face_window_p<D, G>):
...the definitions of these classes, as well as...
(trait::window_< complex_lower_window_p<D, G> >)
(trait::window_< complex_higher_window_p<D, G> >)
(trait::window_< complex_lower_higher_window_p<D, G> >)
(trait::window_< complex_lower_dim_connected_n_face_window_p<D, G> >)
(trait::window_< complex_higher_dim_connected_n_face_window_p<D, G> >):
...their traits.
* mln/core/internal/complex_window_p_base.hh
(mln::internal::complex_window_p_base<D, G, F, B, E>):
Be more precise in documentation.
---
milena/ChangeLog | 23 +++
milena/mln/core/image/complex_windows.hh | 167 +++++++--------------
milena/mln/core/internal/complex_window_p_base.hh | 6 +-
3 files changed, 84 insertions(+), 112 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1aa444c..1ac37ac 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,28 @@
2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+ Factor mln/core/image/complex_windows.hh using the preprocessor.
+
+ * mln/core/image/complex_windows.hh
+ (mln_gen_complex_window): New (generator) macro.
+ Use it to factor...
+ (mln::complex_lower_window_p<D, G>)
+ (mln::complex_higher_window_p<D, G>)
+ (mln::complex_lower_higher_window_p<D, G>)
+ (mln::complex_lower_dim_connected_n_face_window_p<D, G>)
+ (mln::complex_higher_dim_connected_n_face_window_p<D, G>):
+ ...the definitions of these classes, as well as...
+ (trait::window_< complex_lower_window_p<D, G> >)
+ (trait::window_< complex_higher_window_p<D, G> >)
+ (trait::window_< complex_lower_higher_window_p<D, G> >)
+ (trait::window_< complex_lower_dim_connected_n_face_window_p<D, G> >)
+ (trait::window_< complex_higher_dim_connected_n_face_window_p<D, G> >):
+ ...their traits.
+ * mln/core/internal/complex_window_p_base.hh
+ (mln::internal::complex_window_p_base<D, G, F, B, E>):
+ Be more precise in documentation.
+
+2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+
Factor mln/core/image/complex_neighborhoods.hh using the preprocessor.
* mln/core/image/complex_neighborhoods.hh
diff --git a/milena/mln/core/image/complex_windows.hh b/milena/mln/core/image/complex_windows.hh
index 6c074e7..66dba5d 100644
--- a/milena/mln/core/image/complex_windows.hh
+++ b/milena/mln/core/image/complex_windows.hh
@@ -37,137 +37,86 @@
# include <mln/topo/adj_higher_face_iter.hh>
# include <mln/topo/adj_lower_higher_face_iter.hh>
+/** \brief Generate a complex window class, as well as its traits.
+
+ \param Win The name of the class to generate.
+ \param Fwd_Complex_Iter The underlying forward iterator type.
+ \param Bkd_Complex_Iter The underlying backward iterator type.
+
+ The generated class inherits from
+
+ mln:: internal::complex_window_p_base< D, G,
+ Fwd_Complex_Iter<D>,
+ Bkd_Complex_Iter<D>,
+ Win <D, G> >
+
+ where D and G are template parameters of the generated Win class. */
+# define mln_gen_complex_window(Win, Fwd_Complex_Iter, Bkd_Complex_Iter) \
+ /* Forward declaration. */ \
+ template <unsigned D, typename G> struct Win; \
+ \
+ /* Traits. */ \
+ namespace trait \
+ { \
+ template <unsigned D, typename G> \
+ struct window_< Win <D, G> > \
+ : window_< mln::internal::complex_window_p_base< D, G, \
+ Fwd_Complex_Iter<D>, \
+ Bkd_Complex_Iter <D>, \
+ Win <D, G> > > \
+ { \
+ }; \
+ } \
+ \
+ /* Definition. */ \
+ template <unsigned D, typename G> \
+ struct Win \
+ : internal::complex_window_p_base< D, G, \
+ Fwd_Complex_Iter <D>, \
+ Bkd_Complex_Iter <D>, \
+ Win <D, G> > \
+ { \
+ }
+
namespace mln
{
/// \brief Window centered on an n-face of complex returning its
/// adjacent (n-1)-faces as well as the center n-face.
- template <unsigned D, typename G>
- struct complex_lower_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_lower_face_fwd_iter<D>,
- topo::adj_lower_face_bkd_iter<D>,
- complex_lower_window_p<D, G> >
- {
- };
+ mln_gen_complex_window(complex_lower_window_p,
+ topo::adj_lower_face_fwd_iter,
+ topo::adj_lower_face_bkd_iter);
/// \brief Window centered on an n-face of complex returning its
/// adjacent (n+1)-faces as well as the center n-face.
- template <unsigned D, typename G>
- struct complex_higher_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_higher_face_fwd_iter<D>,
- topo::adj_higher_face_bkd_iter<D>,
- complex_higher_window_p<D, G> >
- {
- };
+ mln_gen_complex_window(complex_higher_window_p,
+ topo::adj_higher_face_fwd_iter,
+ topo::adj_higher_face_bkd_iter);
/// \brief Window centered on an n-face of complex returning its
/// adjacent (n-1)-faces and (n+1)-faces as well as the center
/// n-face.
- template <unsigned D, typename G>
- struct complex_lower_higher_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_lower_higher_face_fwd_iter<D>,
- topo::adj_lower_higher_face_bkd_iter<D>,
- complex_lower_higher_window_p<D, G> >
- {
- };
+ mln_gen_complex_window(complex_lower_higher_window_p,
+ topo::adj_lower_higher_face_fwd_iter,
+ topo::adj_lower_higher_face_bkd_iter);
/// \brief Window centered on an n-face of complex returning the
/// n-faces sharing an (n-1)-face with the center n-face, as well as
/// this center n-face.
- template <unsigned D, typename G>
- struct complex_lower_dim_connected_n_face_window_p
- : internal::complex_window_p_base<
- D, G,
- topo::adj_lower_dim_connected_n_face_fwd_iter<D>,
- topo::adj_lower_dim_connected_n_face_bkd_iter<D>,
- complex_lower_dim_connected_n_face_window_p<D, G>
- >
- {
- };
+ mln_gen_complex_window(complex_lower_dim_connected_n_face_window_p,
+ topo::adj_lower_dim_connected_n_face_fwd_iter,
+ topo::adj_lower_dim_connected_n_face_bkd_iter);
/// \brief Window centered on an n-face of complex returning the
/// n-faces sharing an (n+1)-face with the center n-face, as well as
/// this center n-face.
- template <unsigned D, typename G>
- struct complex_higher_dim_connected_n_face_window_p
- : internal::complex_window_p_base<
- D, G,
- topo::adj_higher_dim_connected_n_face_fwd_iter<D>,
- topo::adj_higher_dim_connected_n_face_bkd_iter<D>,
- complex_higher_dim_connected_n_face_window_p<D, G>
- >
- {
- };
-
-
- // -------- //
- // Traits. //
- // -------- //
-
- namespace trait
- {
-
- template <unsigned D, typename G>
- struct window_< mln::complex_lower_window_p<D, G> >
- : window_< mln::internal::complex_window_p_base<
- D, G,
- mln::topo::adj_lower_face_fwd_iter<D>,
- mln::topo::adj_lower_face_bkd_iter<D>,
- mln::complex_lower_window_p<D, G> >
- >
- {
- };
-
- template <unsigned D, typename G>
- struct window_< mln::complex_higher_window_p<D, G> >
- : window_< mln::internal::complex_window_p_base<
- D, G,
- mln::topo::adj_higher_face_fwd_iter<D>,
- mln::topo::adj_higher_face_bkd_iter<D>,
- mln::complex_higher_window_p<D, G> >
- >
- {
- };
-
- template <unsigned D, typename G>
- struct window_< mln::complex_lower_higher_window_p<D, G> >
- : window_< mln::internal::complex_window_p_base<
- D, G,
- mln::topo::adj_lower_higher_face_fwd_iter<D>,
- mln::topo::adj_lower_higher_face_bkd_iter<D>,
- mln::complex_lower_higher_window_p<D, G> >
- >
- {
- };
-
- template <unsigned D, typename G>
- struct window_< mln::complex_lower_dim_connected_n_face_window_p<D, G> >
- : window_< mln::internal::complex_window_p_base<
- D, G,
- mln::topo::adj_lower_dim_connected_n_face_fwd_iter<D>,
- mln::topo::adj_lower_dim_connected_n_face_bkd_iter<D>,
- mln::complex_lower_dim_connected_n_face_window_p<D, G> >
- >
- {
- };
-
- template <unsigned D, typename G>
- struct window_< mln::complex_higher_dim_connected_n_face_window_p<D, G> >
- : window_< mln::internal::complex_window_p_base<
- D, G,
- mln::topo::adj_higher_dim_connected_n_face_fwd_iter<D>,
- mln::topo::adj_higher_dim_connected_n_face_bkd_iter<D>,
- mln::complex_higher_dim_connected_n_face_window_p<D, G> >
- >
- {
- };
-
- } // end of namespace mln::trait
+ mln_gen_complex_window(complex_higher_dim_connected_n_face_window_p,
+ topo::adj_higher_dim_connected_n_face_fwd_iter,
+ topo::adj_higher_dim_connected_n_face_bkd_iter);
} // end of namespace mln
+# undef mln_gen_complex_window
+
#endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH
diff --git a/milena/mln/core/internal/complex_window_p_base.hh b/milena/mln/core/internal/complex_window_p_base.hh
index 3494552..2362c54 100644
--- a/milena/mln/core/internal/complex_window_p_base.hh
+++ b/milena/mln/core/internal/complex_window_p_base.hh
@@ -78,9 +78,9 @@ namespace mln
center (site) is part of the window.
\tparam D The dimension of the complex.
- \tparam G The geometry functor of the complex.
- \tparam F The underlying forward iterator.
- \tparam B The underlying backward iterator.
+ \tparam G The type of the geometry functor of the complex.
+ \tparam F The underlying forward iterator type.
+ \tparam B The underlying backward iterator type.
\tparam E The exact type. */
template <unsigned D, typename G, typename F, typename B, typename E>
class complex_window_p_base : public Window<E>
--
1.6.0.1
1
0
2607: Factor mln/core/image/complex_neighborhoods.hh using the preprocessor.
by Roland Levillain 18 Oct '08
by Roland Levillain 18 Oct '08
18 Oct '08
* mln/core/image/complex_neighborhoods.hh
(mln_gen_complex_neighborhood): New (generator) macro.
Use it to factor...
(mln::complex_lower_neighborhood<D, G>)
(mln::complex_higher_neighborhood<D, G>)
(mln::complex_lower_higher_neighborhood<D, G>)
(mln::complex_lower_dim_connected_n_face_neighborhood<D, G>)
(mln::complex_higher_dim_connected_n_face_neighborhood<D, G>):
...the definitions of these classes.
* mln/core/internal/complex_neighborhood_base.hh
(mln::internal::complex_neighborhood_base<D, G, F, B, E>):
Be more precise in documentation.
---
milena/ChangeLog | 17 ++++
milena/mln/core/image/complex_neighborhoods.hh | 87 +++++++++----------
.../mln/core/internal/complex_neighborhood_base.hh | 6 +-
3 files changed, 61 insertions(+), 49 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 37db01d..1aa444c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,22 @@
2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+ Factor mln/core/image/complex_neighborhoods.hh using the preprocessor.
+
+ * mln/core/image/complex_neighborhoods.hh
+ (mln_gen_complex_neighborhood): New (generator) macro.
+ Use it to factor...
+ (mln::complex_lower_neighborhood<D, G>)
+ (mln::complex_higher_neighborhood<D, G>)
+ (mln::complex_lower_higher_neighborhood<D, G>)
+ (mln::complex_lower_dim_connected_n_face_neighborhood<D, G>)
+ (mln::complex_higher_dim_connected_n_face_neighborhood<D, G>):
+ ...the definitions of these classes.
+ * mln/core/internal/complex_neighborhood_base.hh
+ (mln::internal::complex_neighborhood_base<D, G, F, B, E>):
+ Be more precise in documentation.
+
+2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+
Add windows based on lower/higher-dimension connected n-faces.
* mln/core/image/complex_windows.hh
diff --git a/milena/mln/core/image/complex_neighborhoods.hh b/milena/mln/core/image/complex_neighborhoods.hh
index 3dce74f..323df38 100644
--- a/milena/mln/core/image/complex_neighborhoods.hh
+++ b/milena/mln/core/image/complex_neighborhoods.hh
@@ -39,71 +39,66 @@
# include <mln/topo/adj_lower_dim_connected_n_face_iter.hh>
# include <mln/topo/adj_higher_dim_connected_n_face_iter.hh>
+/** \brief Generate a complex neighborhood class.
+
+ \param Nbh The name of the class to generate.
+ \param Fwd_Complex_Iter The underlying forward iterator type.
+ \param Bkd_Complex_Iter The underlying backward iterator type.
+
+ The generated class inherits from
+
+ mln:: internal::complex_neighborhood_base< D, G,
+ Fwd_Complex_Iter<D>,
+ Bkd_Complex_Iter<D>,
+ Nbh <D, G> >
+
+ where D and G are template parameters of the generated Nbh class. */
+# define mln_gen_complex_neighborhood(Nbh, Fwd_Complex_Iter, Bkd_Complex_Iter) \
+ template <unsigned D, typename G> \
+ struct Nbh \
+ : internal::complex_neighborhood_base< D, G, \
+ Fwd_Complex_Iter <D>, \
+ Bkd_Complex_Iter <D>, \
+ Nbh <D, G> > \
+ { \
+ }
+
namespace mln
{
/// \brief Neighborhood centered on an n-face of complex returning
/// its adjacent (n-1)-faces.
- template <unsigned D, typename G>
- struct complex_lower_neighborhood
- : internal::complex_neighborhood_base< D, G,
- topo::adj_lower_face_fwd_iter<D>,
- topo::adj_lower_face_bkd_iter<D>,
- complex_lower_neighborhood<D, G> >
- {
- };
+ mln_gen_complex_neighborhood(complex_lower_neighborhood,
+ topo::adj_lower_face_fwd_iter,
+ topo::adj_lower_face_bkd_iter);
/// \brief Neighborhood centered on an n-face of complex returning
/// its adjacent (n+1)-faces.
- template <unsigned D, typename G>
- struct complex_higher_neighborhood
- : internal::complex_neighborhood_base< D, G,
- topo::adj_higher_face_fwd_iter<D>,
- topo::adj_higher_face_bkd_iter<D>,
- complex_higher_neighborhood<D, G> >
- {
- };
+ mln_gen_complex_neighborhood(complex_higher_neighborhood,
+ topo::adj_higher_face_fwd_iter,
+ topo::adj_higher_face_bkd_iter);
/// \brief Neighborhood centered on an n-face of complex returning
/// its adjacent (n-1)-faces and (n+1)-faces.
- template <unsigned D, typename G>
- struct complex_lower_higher_neighborhood
- : internal::complex_neighborhood_base<
- D, G,
- topo::adj_lower_higher_face_fwd_iter<D>,
- topo::adj_lower_higher_face_bkd_iter<D>,
- complex_lower_higher_neighborhood<D, G>
- >
- {
- };
+ mln_gen_complex_neighborhood(complex_lower_higher_neighborhood,
+ topo::adj_lower_higher_face_fwd_iter,
+ topo::adj_lower_higher_face_bkd_iter);
/// \brief Neighborhood centered on an n-face of complex returning
/// the n-faces sharing an (n-1)-face with the center n-face.
- template <unsigned D, typename G>
- struct complex_lower_dim_connected_n_face_neighborhood
- : internal::complex_neighborhood_base<
- D, G,
- topo::adj_lower_dim_connected_n_face_fwd_iter<D>,
- topo::adj_lower_dim_connected_n_face_bkd_iter<D>,
- complex_lower_dim_connected_n_face_neighborhood<D, G>
- >
- {
- };
+ mln_gen_complex_neighborhood(complex_lower_dim_connected_n_face_neighborhood,
+ topo::adj_lower_dim_connected_n_face_fwd_iter,
+ topo::adj_lower_dim_connected_n_face_bkd_iter);
/// \brief Neighborhood centered on an n-face of complex returning
/// the n-faces sharing an (n+1)-face with the center n-face.
- template <unsigned D, typename G>
- struct complex_higher_dim_connected_n_face_neighborhood
- : internal::complex_neighborhood_base<
- D, G,
- topo::adj_higher_dim_connected_n_face_fwd_iter<D>,
- topo::adj_higher_dim_connected_n_face_bkd_iter<D>,
- complex_higher_dim_connected_n_face_neighborhood<D, G>
- >
- {
- };
+ mln_gen_complex_neighborhood(complex_higher_dim_connected_n_face_neighborhood,
+ topo::adj_higher_dim_connected_n_face_fwd_iter,
+ topo::adj_higher_dim_connected_n_face_bkd_iter);
} // end of namespace mln
+# undef mln_gen_complex_neighborhood
+
#endif // ! MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
diff --git a/milena/mln/core/internal/complex_neighborhood_base.hh b/milena/mln/core/internal/complex_neighborhood_base.hh
index 9ecf09f..d422792 100644
--- a/milena/mln/core/internal/complex_neighborhood_base.hh
+++ b/milena/mln/core/internal/complex_neighborhood_base.hh
@@ -60,9 +60,9 @@ namespace mln
based on an pair of (forward and backward) complex iterators.
\tparam D The dimension of the complex.
- \tparam G The geometry functor of the complex.
- \tparam F The underlying forward iterator.
- \tparam B The underlying backward iterator.
+ \tparam G The type of the geometry functor of the complex.
+ \tparam F The underlying forward iterator type.
+ \tparam B The underlying backward iterator type.
\tparam E The exact type. */
template <unsigned D, typename G, typename F, typename B, typename E>
class complex_neighborhood_base : public Neighborhood<E>
--
1.6.0.1
1
0
18 Oct '08
* mln/core/image/complex_windows.hh
(mln::complex_lower_dim_connected_n_face_window_p)
(mln::complex_higher_dim_connected_n_face_window_p):
New windows.
(trait::window_< complex_lower_dim_connected_n_face_window_p<D, G> >)
(trait::window_< complex_higher_dim_connected_n_face_window_p<D, G> >):
New traits.
Exercise these new windows...
* tests/morpho/complex_image_morpho.cc: ...here.
---
milena/ChangeLog | 14 +++++++
milena/mln/core/image/complex_windows.hh | 54 +++++++++++++++++++++++++++
milena/tests/morpho/complex_image_morpho.cc | 5 ++
3 files changed, 73 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 185b935..37db01d 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,19 @@
2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+ Add windows based on lower/higher-dimension connected n-faces.
+
+ * mln/core/image/complex_windows.hh
+ (mln::complex_lower_dim_connected_n_face_window_p)
+ (mln::complex_higher_dim_connected_n_face_window_p):
+ New windows.
+ (trait::window_< complex_lower_dim_connected_n_face_window_p<D, G> >)
+ (trait::window_< complex_higher_dim_connected_n_face_window_p<D, G> >):
+ New traits.
+ Exercise these new windows...
+ * tests/morpho/complex_image_morpho.cc: ...here.
+
+2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+
Add neighborhoods based on lower/higher-dimension connected n-faces.
* mln/core/image/complex_neighborhoods.hh
diff --git a/milena/mln/core/image/complex_windows.hh b/milena/mln/core/image/complex_windows.hh
index 662b528..6c074e7 100644
--- a/milena/mln/core/image/complex_windows.hh
+++ b/milena/mln/core/image/complex_windows.hh
@@ -75,6 +75,38 @@ namespace mln
{
};
+ /// \brief Window centered on an n-face of complex returning the
+ /// n-faces sharing an (n-1)-face with the center n-face, as well as
+ /// this center n-face.
+ template <unsigned D, typename G>
+ struct complex_lower_dim_connected_n_face_window_p
+ : internal::complex_window_p_base<
+ D, G,
+ topo::adj_lower_dim_connected_n_face_fwd_iter<D>,
+ topo::adj_lower_dim_connected_n_face_bkd_iter<D>,
+ complex_lower_dim_connected_n_face_window_p<D, G>
+ >
+ {
+ };
+
+ /// \brief Window centered on an n-face of complex returning the
+ /// n-faces sharing an (n+1)-face with the center n-face, as well as
+ /// this center n-face.
+ template <unsigned D, typename G>
+ struct complex_higher_dim_connected_n_face_window_p
+ : internal::complex_window_p_base<
+ D, G,
+ topo::adj_higher_dim_connected_n_face_fwd_iter<D>,
+ topo::adj_higher_dim_connected_n_face_bkd_iter<D>,
+ complex_higher_dim_connected_n_face_window_p<D, G>
+ >
+ {
+ };
+
+
+ // -------- //
+ // Traits. //
+ // -------- //
namespace trait
{
@@ -112,6 +144,28 @@ namespace mln
{
};
+ template <unsigned D, typename G>
+ struct window_< mln::complex_lower_dim_connected_n_face_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_lower_dim_connected_n_face_fwd_iter<D>,
+ mln::topo::adj_lower_dim_connected_n_face_bkd_iter<D>,
+ mln::complex_lower_dim_connected_n_face_window_p<D, G> >
+ >
+ {
+ };
+
+ template <unsigned D, typename G>
+ struct window_< mln::complex_higher_dim_connected_n_face_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_higher_dim_connected_n_face_fwd_iter<D>,
+ mln::topo::adj_higher_dim_connected_n_face_bkd_iter<D>,
+ mln::complex_higher_dim_connected_n_face_window_p<D, G> >
+ >
+ {
+ };
+
} // end of namespace mln::trait
} // end of namespace mln
diff --git a/milena/tests/morpho/complex_image_morpho.cc b/milena/tests/morpho/complex_image_morpho.cc
index bcf74bd..80b80f5 100644
--- a/milena/tests/morpho/complex_image_morpho.cc
+++ b/milena/tests/morpho/complex_image_morpho.cc
@@ -162,6 +162,11 @@ int main()
test_morpho(ima, complex_lower_higher_window_p<D, G>(),
"lower- and higer-dimension faces");
+ test_morpho(ima, complex_lower_dim_connected_n_face_window_p<D, G>(),
+ "lower-dimension connected n-faces");
+ test_morpho(ima, complex_higher_dim_connected_n_face_window_p<D, G>(),
+ "higher-dimension connected n-faces");
+
/* FIXME: Exercise elementary erosion/dilation (with neighborhoods)
when available. */
}
--
1.6.0.1
1
0
2605: Add neighborhoods based on lower/higher-dimension connected n-faces.
by Roland Levillain 18 Oct '08
by Roland Levillain 18 Oct '08
18 Oct '08
* mln/core/image/complex_neighborhoods.hh
(mln::complex_lower_dim_connected_n_face_neighborhood<D, G>):
(mln::complex_higher_dim_connected_n_face_neighborhood<D, G>):
New neighborhoods.
Exercise them...
* tests/core/image/complex_image.cc: ...here.
---
milena/ChangeLog | 11 +++++++++
milena/mln/core/image/complex_neighborhoods.hh | 28 ++++++++++++++++++++++++
milena/tests/core/image/complex_image.cc | 6 +++++
3 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 2959330..185b935 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,16 @@
2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+ Add neighborhoods based on lower/higher-dimension connected n-faces.
+
+ * mln/core/image/complex_neighborhoods.hh
+ (mln::complex_lower_dim_connected_n_face_neighborhood<D, G>):
+ (mln::complex_higher_dim_connected_n_face_neighborhood<D, G>):
+ New neighborhoods.
+ Exercise them...
+ * tests/core/image/complex_image.cc: ...here.
+
+2008-10-18 Roland Levillain <roland(a)lrde.epita.fr>
+
Have tests/morpho/complex_image_morpho.cc be more verbose/specific.
* tests/morpho/complex_image_morpho.cc (test_morpho): Take an
diff --git a/milena/mln/core/image/complex_neighborhoods.hh b/milena/mln/core/image/complex_neighborhoods.hh
index 174f263..3dce74f 100644
--- a/milena/mln/core/image/complex_neighborhoods.hh
+++ b/milena/mln/core/image/complex_neighborhoods.hh
@@ -36,6 +36,8 @@
# include <mln/topo/adj_lower_face_iter.hh>
# include <mln/topo/adj_higher_face_iter.hh>
# include <mln/topo/adj_lower_higher_face_iter.hh>
+# include <mln/topo/adj_lower_dim_connected_n_face_iter.hh>
+# include <mln/topo/adj_higher_dim_connected_n_face_iter.hh>
namespace mln
@@ -76,6 +78,32 @@ namespace mln
{
};
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// the n-faces sharing an (n-1)-face with the center n-face.
+ template <unsigned D, typename G>
+ struct complex_lower_dim_connected_n_face_neighborhood
+ : internal::complex_neighborhood_base<
+ D, G,
+ topo::adj_lower_dim_connected_n_face_fwd_iter<D>,
+ topo::adj_lower_dim_connected_n_face_bkd_iter<D>,
+ complex_lower_dim_connected_n_face_neighborhood<D, G>
+ >
+ {
+ };
+
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// the n-faces sharing an (n+1)-face with the center n-face.
+ template <unsigned D, typename G>
+ struct complex_higher_dim_connected_n_face_neighborhood
+ : internal::complex_neighborhood_base<
+ D, G,
+ topo::adj_higher_dim_connected_n_face_fwd_iter<D>,
+ topo::adj_higher_dim_connected_n_face_bkd_iter<D>,
+ complex_higher_dim_connected_n_face_neighborhood<D, G>
+ >
+ {
+ };
+
} // end of namespace mln
#endif // ! MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
diff --git a/milena/tests/core/image/complex_image.cc b/milena/tests/core/image/complex_image.cc
index 36028fc..27dfeb0 100644
--- a/milena/tests/core/image/complex_image.cc
+++ b/milena/tests/core/image/complex_image.cc
@@ -231,6 +231,12 @@ int main()
test_neighborhood(ima, complex_lower_higher_neighborhood<D, G>(),
"Lower- and higer-dimension faces");
+ test_neighborhood(ima,
+ complex_lower_dim_connected_n_face_neighborhood<D, G>(),
+ "Lower-dimension connected n-faces");
+ test_neighborhood(ima,
+ complex_higher_dim_connected_n_face_neighborhood<D, G>(),
+ "Higher-dimension connected n-faces");
/* FIXME: Implement other neighborhoods (and windows) and
corresponding iterators for complex-based images.
--
1.6.0.1
1
0