https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Ugo Jardonnet <jardonnet(a)lrde.epita.fr>
Update Registration.
* mln/fun/x2v/all.hh: Add all header.
* mln/fun/x2x/all.hh: Fix includes.
* mln/fun/x2p/closest_point.hh: Fix g++4.3 error.
* mln/registration/registration.hh: Fix namespace use.
* mln/registration/icp.hh: Fix namespace use.
fun/x2p/closest_point.hh | 13 ++++-----
fun/x2v/all.hh | 61
+++++++++++++++++++++++++++++++++++++++++++
fun/x2x/all.hh | 10 ++-----
registration/icp.hh | 3 +-
registration/registration.hh | 4 +-
5 files changed, 75 insertions(+), 16 deletions(-)
Index: mln/fun/x2v/all.hh
--- mln/fun/x2v/all.hh (revision 0)
+++ mln/fun/x2v/all.hh (revision 0)
@@ -0,0 +1,61 @@
+// 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_FUN_X2V_ALL_HH
+# define MLN_FUN_X2V_ALL_HH
+
+/*! \file mln/fun/x2v/all.hh
+ *
+ * \brief File that includes all functions from vector to value.
+ */
+
+
+namespace mln
+{
+
+ namespace fun
+ {
+
+ /// Namespace of functions from vector to value.
+ namespace x2v
+ {
+
+ /// Internal namespace of functions form vector to vector.
+ namespace internal
+ {
+ }
+ }
+ }
+
+}
+
+
+# include <mln/fun/x2v/linear.hh>
+# include <mln/fun/x2v/bilinear.hh>
+# include <mln/fun/x2v/nneighbor.hh>
+
+#endif // ! MLN_FUN_X2V_ALL_HH
Index: mln/fun/x2x/all.hh
--- mln/fun/x2x/all.hh (revision 2542)
+++ mln/fun/x2x/all.hh (working copy)
@@ -54,13 +54,9 @@
}
-# include <mln/fun/x2x/geom/composed.hh>
-# include <mln/fun/x2x/geom/rotation.hh>
-# include <mln/fun/x2x/geom/translation.hh>
-
-# include <mln/fun/x2x/interpol/linear.hh>
-# include <mln/fun/x2x/interpol/bilinear.hh>
-
+# include <mln/fun/x2x/composed.hh>
+# include <mln/fun/x2x/rotation.hh>
+# include <mln/fun/x2x/translation.hh>
#endif // ! MLN_FUN_X2X_ALL_HH
Index: mln/fun/x2p/closest_point.hh
--- mln/fun/x2p/closest_point.hh (revision 2542)
+++ mln/fun/x2p/closest_point.hh (working copy)
@@ -31,6 +31,7 @@
# include <mln/algebra/vec.hh>
# include <mln/norm/l2.hh>
+
namespace mln
{
@@ -44,25 +45,25 @@
template <typename P>
struct closest_point
{
- typedef algebra::vec<P::dim, float> input;
+ typedef const algebra::vec<P::dim, float>& input;
typedef P result;
closest_point(const p_array<P>& X, const box<P>& box)
- : X(X), box(box)
+ : X(X), box_(box)
, log_functor_call(0)
{ }
result
//inline
- operator () (const input& Ck) const
+ operator () (const algebra::vec<P::dim, float>& Ck) const
{
++log_functor_call;
algebra::vec<P::dim,float> Cki = Ck;
algebra::vec<P::dim,float> best_x = X[0];
float best_d = norm::l2(Cki - best_x);
- for (size_t j = 1; j < X.nsites(); ++j)
+ for (unsigned j = 1; j < X.nsites(); ++j)
{
algebra::vec<P::dim,float> Xj = X[j];
float d = norm::l2(Cki - Xj);
@@ -77,11 +78,11 @@
const box<P>& domain() const
{
- return box;
+ return box_;
}
+ const box<P> box_;
const p_array<P>& X;
- const box<P> box;
// log call to the functor
mutable unsigned log_functor_call;
Index: mln/registration/registration.hh
--- mln/registration/registration.hh (revision 2542)
+++ mln/registration/registration.hh (working copy)
@@ -44,7 +44,7 @@
{
- using namespace fun::x2x::geom;
+ using namespace fun::x2x;
/*! Register an image \p cloud over the image \p surface.
*/
@@ -70,7 +70,7 @@
p_array<mln_psite(J)> x = convert::to< p_array<mln_psite(I)>
(surface);
//init rigid transform qk
- composed< rotation<I::P::dim, float>, translation<I::P::dim,
float> > qk;
+ composed< rotation<I::psite::dim, float>,
translation<I::psite::dim, float> > qk;
//working box
const box<mln_psite(I)> working_box =
Index: mln/registration/icp.hh
--- mln/registration/icp.hh (revision 2542)
+++ mln/registration/icp.hh (working copy)
@@ -34,6 +34,7 @@
*/
# include <mln/fun/x2x/all.hh>
+# include <mln/fun/x2v/all.hh>
namespace mln
{
@@ -80,7 +81,7 @@
namespace registration
{
- using namespace fun::x2x::geom;
+ using namespace fun::x2x;
/*! Register point in \p c using a map of closest points \p map
*