I've got an error since last 2 patchs :
error: no matching function for call to 'init_(oln::box2d*, const oln::image2d<int>&)'
We look at it with nico but didn't manage to fix.
Index: ChangeLog
from Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
Morpho : Elementary versions.
* oln/morpho/elementary_gradient.hh: New.
* oln/morpho/elementary_gradient_external.hh: New.
* oln/morpho/elementary_laplace.hh: New.
* oln/morpho/gradient_internal.hh: .
* oln/morpho/gradient.hh: .
* oln/morpho/gradient_external.hh: .
* oln/morpho/laplace.hh: .
* oln/morpho/erosion.hh: .
* oln/morpho/elementary_gradient_internal.hh: New.
* oln/core/2d/image2d.hh: .
core/2d/image2d.hh | 3 -
morpho/elementary_gradient.hh | 84 +++++++++++++++++++++++++++++++++
morpho/elementary_gradient_external.hh | 83 ++++++++++++++++++++++++++++++++
morpho/elementary_gradient_internal.hh | 83 ++++++++++++++++++++++++++++++++
morpho/elementary_laplace.hh | 84 +++++++++++++++++++++++++++++++++
morpho/erosion.hh | 6 +-
morpho/gradient.hh | 25 +++++----
morpho/gradient_external.hh | 29 +++++------
morpho/gradient_internal.hh | 28 +++++------
morpho/laplace.hh | 23 +++++----
10 files changed, 395 insertions(+), 53 deletions(-)
Index: oln/morpho/elementary_gradient.hh
--- oln/morpho/elementary_gradient.hh (revision 0)
+++ oln/morpho/elementary_gradient.hh (revision 0)
@@ -0,0 +1,84 @@
+// Copyright (C) 2007 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 OLN_MORPHO_ELEMENTARY_GRADIENT_HH
+# define OLN_MORPHO_ELEMENTARY_GRADIENT_HH
+
+#include <oln/morpho/elementary_erosion.hh>
+#include <oln/morpho/elementary_dilation.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient_(const Image_with_Nbh<I>& input)
+ {
+ return elementary_dilation(input) - elementary_erosion(input);
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient(const Image_with_Nbh<I>& input)
+ {
+ return impl::elementary_gradient_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_ELEMENTARY_GRADIENT_HH
Index: oln/morpho/elementary_gradient_external.hh
--- oln/morpho/elementary_gradient_external.hh (revision 0)
+++ oln/morpho/elementary_gradient_external.hh (revision 0)
@@ -0,0 +1,83 @@
+// Copyright (C) 2007 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 OLN_MORPHO_EXTERNAL_GRADIENT_HH
+# define OLN_MORPHO_EXTERNAL_GRADIENT_HH
+
+#include <oln/morpho/elementary_dilation.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient_external(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient_external_(const Image_with_Nbh<I>& input)
+ {
+ return elementary_dilation(input) - input;
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient_external(const Image_with_Nbh<I>& input)
+ {
+ return impl::elementary_gradient_external_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_EXTERNAL_GRADIENT_HH
Index: oln/morpho/elementary_laplace.hh
--- oln/morpho/elementary_laplace.hh (revision 0)
+++ oln/morpho/elementary_laplace.hh (revision 0)
@@ -0,0 +1,84 @@
+// Copyright (C) 2007 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 OLN_MORPHO_ELEMENTARY_LAPLACE_HH
+# define OLN_MORPHO_ELEMENTARY_LAPLACE_HH
+
+#include <oln/morpho/elementary_gradient_external.hh>
+#include <oln/morpho/elementary_gradient_internal.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_laplace(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_laplace_(const Image_with_Nbh<I>& input)
+ {
+ return elementary_gradient_external(input) - elementary_gradient_internal(input);
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_laplace(const Image_with_Nbh<I>& input)
+ {
+ return impl::elementary_laplace_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_ELEMENTARY_LAPLACE_HH
Index: oln/morpho/gradient_internal.hh
--- oln/morpho/gradient_internal.hh (revision 905)
+++ oln/morpho/gradient_internal.hh (working copy)
@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_MORPHO_INSIDE_GRADIENT_HH
-# define OLN_MORPHO_INSIDE_GRADIENT_HH
+#ifndef OLN_MORPHO_GRADIENT_INTERNAL_HH
+# define OLN_MORPHO_GRADIENT_INTERNAL_HH
-#include <oln/morpho/elementary_erosion.hh>
+#include <oln/morpho/erosion.hh>
#include <oln/arith/minus.hh>
namespace oln
@@ -39,9 +39,10 @@
// Fwd decl.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- inside_gradient(const Image_with_Nbh<I>& input);
+ gradient_internal(const Image<I>& input,
+ const Window<W>& win);
# ifndef OLN_INCLUDE_ONLY
@@ -51,26 +52,27 @@
// Generic version.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- inside_gradient_(const Image_with_Nbh<I>& input)
+ gradient_internal_(const Image<I>& input,
+ const Window<W>& win)
{
- return input - elementary_erosion(input);
+ return input - erosion(input, win);
}
- // FIXME: Add a fast version.
} // end of namespace oln::morpho::impl
// Facade.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- inside_gradient(const Image_with_Nbh<I>& input)
+ gradient_internal(const Image<I>& input,
+ const Window<W>& win)
{
- return impl::inside_gradient_(exact(input));
+ return impl::gradient_internal_(exact(input), win);
}
# endif // ! OLN_INCLUDE_ONLY
@@ -80,4 +82,4 @@
} // end of namespace oln
-#endif // ! OLN_MORPHO_INSIDE_GRADIENT_HH
+#endif // ! OLN_MORPHO_GRADIENT_INTERNAL_HH
Index: oln/morpho/gradient.hh
--- oln/morpho/gradient.hh (revision 905)
+++ oln/morpho/gradient.hh (working copy)
@@ -28,8 +28,8 @@
#ifndef OLN_MORPHO_GRADIENT_HH
# define OLN_MORPHO_GRADIENT_HH
-#include <oln/morpho/elementary_erosion.hh>
-#include <oln/morpho/elementary_dilation.hh>
+#include <oln/morpho/erosion.hh>
+#include <oln/morpho/dilation.hh>
#include <oln/arith/minus.hh>
namespace oln
@@ -40,9 +40,10 @@
// Fwd decl.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- gradient(const Image_with_Nbh<I>& input);
+ gradient(const Image<I>& input,
+ const Window<W>& win);
# ifndef OLN_INCLUDE_ONLY
@@ -52,26 +53,26 @@
// Generic version.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- gradient_(const Image_with_Nbh<I>& input)
+ gradient_(const Image<I>& input,
+ const Window<W>& win)
{
- return elementary_dilation(input) - elementary_erosion(input);
+ return dilation(input, win) - erosion(input, win);
}
- // FIXME: Add a fast version.
-
} // end of namespace oln::morpho::impl
// Facade.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- gradient(const Image_with_Nbh<I>& input)
+ gradient(const Image<I>& input,
+ const Window<W>& win)
{
- return impl::gradient_(exact(input));
+ return impl::gradient_(exact(input), win);
}
# endif // ! OLN_INCLUDE_ONLY
Index: oln/morpho/gradient_external.hh
--- oln/morpho/gradient_external.hh (revision 905)
+++ oln/morpho/gradient_external.hh (working copy)
@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef OLN_MORPHO_EXTERNAL_GRADIENT_HH
-# define OLN_MORPHO_EXTERNAL_GRADIENT_HH
+#ifndef OLN_MORPHO_GRADIENT_EXTERNAL_HH
+# define OLN_MORPHO_GRADIENT_EXTERNAL_HH
-#include <oln/morpho/elementary_dilation.hh>
+#include <oln/morpho/dilation.hh>
#include <oln/arith/minus.hh>
namespace oln
@@ -39,9 +39,10 @@
// Fwd decl.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- external_gradient(const Image_with_Nbh<I>& input);
+ gradient_external(const Image<I>& input,
+ const Window<W>& win);
# ifndef OLN_INCLUDE_ONLY
@@ -51,26 +52,26 @@
// Generic version.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- external_gradient_(const Image_with_Nbh<I>& input)
+ gradient_external_(const Image<I>& input,
+ const Window<W>& win)
{
- return elementary_dilation(input) - input;
+ return dilation(input, win) - input;
}
- // FIXME: Add a fast version.
-
} // end of namespace oln::morpho::impl
// Facade.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- external_gradient(const Image_with_Nbh<I>& input)
+ gradient_external(const Image<I>& input,
+ const Window<W>& win)
{
- return impl::external_gradient_(exact(input));
+ return impl::gradient_external_(exact(input), win);
}
# endif // ! OLN_INCLUDE_ONLY
@@ -80,4 +81,4 @@
} // end of namespace oln
-#endif // ! OLN_MORPHO_EXTERNAL_GRADIENT_HH
+#endif // ! OLN_MORPHO_GRADIENT_EXTERNAL_HH
Index: oln/morpho/laplace.hh
--- oln/morpho/laplace.hh (revision 905)
+++ oln/morpho/laplace.hh (working copy)
@@ -28,8 +28,8 @@
#ifndef OLN_MORPHO_LAPLACE_HH
# define OLN_MORPHO_LAPLACE_HH
-#include <oln/morpho/gradient_external.hh>
-#include <oln/morpho/gradient_internal.hh>
+#include <oln/morpho/elementary_gradient_external.hh>
+#include <oln/morpho/elementary_gradient_internal.hh>
#include <oln/arith/minus.hh>
namespace oln
@@ -40,9 +40,10 @@
// Fwd decl.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- laplace(const Image_with_Nbh<I>& input);
+ laplace(const Image<I>& input,
+ const Window<W>& win);
# ifndef OLN_INCLUDE_ONLY
@@ -52,11 +53,12 @@
// Generic version.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- laplace_(const Image_with_Nbh<I>& input)
+ laplace_(const Image<I>& input,
+ const Window<W>& win)
{
- return external_gradient(input) - inside_gradient(input);
+ return gradient_external(input, win) - gradient_internal(input, win);
}
@@ -67,11 +69,12 @@
// Facade.
- template <typename I>
+ template <typename I, typename W>
oln_plain(I)
- laplace(const Image_with_Nbh<I>& input)
+ laplace(const Image<I>& input,
+ const Window<W>& win)
{
- return impl::laplace_(exact(input));
+ return impl::laplace_(exact(input), win);
}
# endif // ! OLN_INCLUDE_ONLY
Index: oln/morpho/erosion.hh
--- oln/morpho/erosion.hh (revision 905)
+++ oln/morpho/erosion.hh (working copy)
@@ -30,7 +30,7 @@
#include <oln/level/apply_local.hh>
#include <oln/border/fill.hh>
-#include <oln/accumulator/max.hh>
+#include <oln/accumulator/min.hh>
namespace oln
{
@@ -56,7 +56,7 @@
oln_plain(I)
erosion_(const Image<I>& input, const Window<W>& win)
{
- border::fill(input, oln_min(oln_value(I)));
+ border::fill(input, oln_max(oln_value(I)));
accumulator::min_<oln_value(I)> min;
return level::apply_local(min, input, win);
}
@@ -66,7 +66,7 @@
erosion_on_set_(const Image<I>&,
const I& input)
{
- border::fill(input, oln_min(oln_value(I)));
+ border::fill(input, true);
accumulator::and_<oln_value(I)> accu_and;
return level::apply_local(accu_and, input);
}
Index: oln/morpho/elementary_gradient_internal.hh
--- oln/morpho/elementary_gradient_internal.hh (revision 0)
+++ oln/morpho/elementary_gradient_internal.hh (revision 0)
@@ -0,0 +1,83 @@
+// Copyright (C) 2007 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 OLN_MORPHO_ELEMENTARY_GRADIENT_INTERNAL_HH
+# define OLN_MORPHO_ELEMENTARY_GRADIENT_INTERNAL_HH
+
+#include <oln/morpho/elementary_erosion.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient_internal(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient_internal_(const Image_with_Nbh<I>& input)
+ {
+ return input - elementary_erosion(input);
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ elementary_gradient_internal(const Image_with_Nbh<I>& input)
+ {
+ return impl::elementary_gradient_internal_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_ELEMENTARY_GRADIENT_INTERNAL_HH
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 905)
+++ oln/core/2d/image2d.hh (working copy)
@@ -213,7 +213,8 @@
box2d b;
bool box_ok = init(b, with, dat);
postcondition(box_ok);
- array2d_<T,int>* ptr = new array2d_<T,int>(b.pmin().row(),
+ array2d_<T,int>* ptr = new array2d_<T,int>(b.pmin().row(), //FIXME
+ //: *.
b.pmin().col(),
b.pmax().row(),
b.pmax().col());
Index: ChangeLog
from Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
Mopho : Top_hat_white, top_hat_black, Fix Opening, Renaming.
* oln/morpho/inside_gradient.hh: Remove.
* oln/morpho/gradient_internal.hh: New.
* oln/morpho/top_hat_black.hh: New.
* oln/morpho/closing.hh: Fixed.
* oln/morpho/top_hat_white.hh: New.
* oln/morpho/opening.hh: Fixed.
* oln/morpho/external_gradient.hh: Remove.
* oln/morpho/gradient_external.hh: New.
* oln/morpho/laplace.hh: .
closing.hh | 4 +-
laplace.hh | 4 +-
opening.hh | 8 ++---
top_hat_black.hh | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
top_hat_white.hh | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 183 insertions(+), 8 deletions(-)
Index: oln/morpho/top_hat_black.hh
--- oln/morpho/top_hat_black.hh (revision 0)
+++ oln/morpho/top_hat_black.hh (revision 0)
@@ -0,0 +1,88 @@
+// Copyright (C) 2007 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 OLN_MORPHO_TOP_HAT_BLACK_HH
+# define OLN_MORPHO_TOP_HAT_BLACK_HH
+
+#include <oln/morpho/opening.hh>
+#include <oln/morpho/closing.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I, typename W>
+ oln_plain(I)
+ top_hat_black(const Image<I>& input,
+ const Window<W>& win);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I, typename W>
+ oln_plain(I)
+ top_hat_black_(const Image<I>& input,
+ const Window<W>& win)
+ {
+ return closing(input, win) - input;
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I, typename W>
+ oln_plain(I)
+ top_hat_black(const Image<I>& input,
+ const Window<W>& win)
+ {
+ return impl::top_hat_black_(exact(input), win);
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_TOP_HAT_BLACK_HH
+
Index: oln/morpho/closing.hh
--- oln/morpho/closing.hh (revision 903)
+++ oln/morpho/closing.hh (working copy)
@@ -28,8 +28,8 @@
#ifndef OLN_MORPHO_CLOSING_HH
# define OLN_MORPHO_CLOSING_HH
-#include <oln/morpho/elementary_erosion.hh>
-#include <oln/morpho/elementary_dilation.hh>
+#include <oln/morpho/erosion.hh>
+#include <oln/morpho/dilation.hh>
namespace oln
{
Index: oln/morpho/top_hat_white.hh
--- oln/morpho/top_hat_white.hh (revision 0)
+++ oln/morpho/top_hat_white.hh (revision 0)
@@ -0,0 +1,87 @@
+// Copyright (C) 2007 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 OLN_MORPHO_TOP_HAT_WHITE_HH
+# define OLN_MORPHO_TOP_HAT_WHITE_HH
+
+#include <oln/morpho/opening.hh>
+#include <oln/morpho/closing.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I, typename W>
+ oln_plain(I)
+ top_hat_white(const Image<I>& input,
+ const Window<W>& win);
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I, typename W>
+ oln_plain(I)
+ top_hat_white_(const Image<I>& input,
+ const Window<W>& win)
+ {
+ return input - opening(input, win);
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I, typename W>
+ oln_plain(I)
+ top_hat_white(const Image<I>& input,
+ const Window<W>& win)
+ {
+ return impl::top_hat_white_(exact(input), win);
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_TOP_HAT_WHITE_HH
+
Index: oln/morpho/opening.hh
--- oln/morpho/opening.hh (revision 903)
+++ oln/morpho/opening.hh (working copy)
@@ -28,8 +28,8 @@
#ifndef OLN_MORPHO_OPENING_HH
# define OLN_MORPHO_OPENING_HH
-#include <oln/morpho/elementary_erosion.hh>
-#include <oln/morpho/elementary_dilation.hh>
+#include <oln/morpho/erosion.hh>
+#include <oln/morpho/dilation.hh>
namespace oln
{
@@ -56,8 +56,8 @@
opening_(const Image<I>& input,
const Window<W>& win)
{
- oln_plain(I) tmp = morpho::dilation(input, win);
- return morpho::erosion(tmp, win); // FIXME : inverse(win).
+ oln_plain(I) tmp = morpho::erosion(input, win);
+ return morpho::dilation(tmp, win); // FIXME : inverse(win).
}
// FIXME: Add a fast version.
Index: oln/morpho/laplace.hh
--- oln/morpho/laplace.hh (revision 903)
+++ oln/morpho/laplace.hh (working copy)
@@ -28,8 +28,8 @@
#ifndef OLN_MORPHO_LAPLACE_HH
# define OLN_MORPHO_LAPLACE_HH
-#include <oln/morpho/external_gradient.hh>
-#include <oln/morpho/inside_gradient.hh>
+#include <oln/morpho/gradient_external.hh>
+#include <oln/morpho/gradient_internal.hh>
#include <oln/arith/minus.hh>
namespace oln
Index: ChangeLog
from Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
Morpho : Gradient, gradient+ gradient-, Laplace. Arith : +, -.
* oln/morpho/laplace.hh: New.
* oln/morpho/inside_gradient.hh: New.
* oln/morpho/gradient.hh: New.
* oln/morpho/external_gradient.hh: New.
* oln/arith: New.
* oln/arith/plus.hh: New.
* oln/arith/minus.hh: New.
* oln/core/concept/operators.hh: .
* oln/core/2d/image2d.hh: .
arith/minus.hh | 64 +++++++++++++++++++++++++++++++++
arith/plus.hh | 64 +++++++++++++++++++++++++++++++++
core/2d/image2d.hh | 2 -
core/concept/operators.hh | 3 +
morpho/external_gradient.hh | 83 +++++++++++++++++++++++++++++++++++++++++++
morpho/gradient.hh | 84 ++++++++++++++++++++++++++++++++++++++++++++
morpho/inside_gradient.hh | 83 +++++++++++++++++++++++++++++++++++++++++++
morpho/laplace.hh | 84 ++++++++++++++++++++++++++++++++++++++++++++
8 files changed, 465 insertions(+), 2 deletions(-)
Index: oln/morpho/laplace.hh
--- oln/morpho/laplace.hh (revision 0)
+++ oln/morpho/laplace.hh (revision 0)
@@ -0,0 +1,84 @@
+// Copyright (C) 2007 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 OLN_MORPHO_LAPLACE_HH
+# define OLN_MORPHO_LAPLACE_HH
+
+#include <oln/morpho/external_gradient.hh>
+#include <oln/morpho/inside_gradient.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ laplace(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ laplace_(const Image_with_Nbh<I>& input)
+ {
+ return external_gradient(input) - inside_gradient(input);
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ laplace(const Image_with_Nbh<I>& input)
+ {
+ return impl::laplace_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_LAPLACE_HH
Index: oln/morpho/inside_gradient.hh
--- oln/morpho/inside_gradient.hh (revision 0)
+++ oln/morpho/inside_gradient.hh (revision 0)
@@ -0,0 +1,83 @@
+// Copyright (C) 2007 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 OLN_MORPHO_INSIDE_GRADIENT_HH
+# define OLN_MORPHO_INSIDE_GRADIENT_HH
+
+#include <oln/morpho/elementary_erosion.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ inside_gradient(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ inside_gradient_(const Image_with_Nbh<I>& input)
+ {
+ return input - elementary_erosion(input);
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ inside_gradient(const Image_with_Nbh<I>& input)
+ {
+ return impl::inside_gradient_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_INSIDE_GRADIENT_HH
Index: oln/morpho/gradient.hh
--- oln/morpho/gradient.hh (revision 0)
+++ oln/morpho/gradient.hh (revision 0)
@@ -0,0 +1,84 @@
+// Copyright (C) 2007 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 OLN_MORPHO_GRADIENT_HH
+# define OLN_MORPHO_GRADIENT_HH
+
+#include <oln/morpho/elementary_erosion.hh>
+#include <oln/morpho/elementary_dilation.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ gradient(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ gradient_(const Image_with_Nbh<I>& input)
+ {
+ return elementary_dilation(input) - elementary_erosion(input);
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ gradient(const Image_with_Nbh<I>& input)
+ {
+ return impl::gradient_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_GRADIENT_HH
Index: oln/morpho/external_gradient.hh
--- oln/morpho/external_gradient.hh (revision 0)
+++ oln/morpho/external_gradient.hh (revision 0)
@@ -0,0 +1,83 @@
+// Copyright (C) 2007 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 OLN_MORPHO_EXTERNAL_GRADIENT_HH
+# define OLN_MORPHO_EXTERNAL_GRADIENT_HH
+
+#include <oln/morpho/elementary_dilation.hh>
+#include <oln/arith/minus.hh>
+
+namespace oln
+{
+
+ namespace morpho
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ external_gradient(const Image_with_Nbh<I>& input);
+
+
+# ifndef OLN_INCLUDE_ONLY
+
+ namespace impl
+ {
+
+ // Generic version.
+
+ template <typename I>
+ oln_plain(I)
+ external_gradient_(const Image_with_Nbh<I>& input)
+ {
+ return elementary_dilation(input) - input;
+ }
+
+
+ // FIXME: Add a fast version.
+
+ } // end of namespace oln::morpho::impl
+
+
+ // Facade.
+
+ template <typename I>
+ oln_plain(I)
+ external_gradient(const Image_with_Nbh<I>& input)
+ {
+ return impl::external_gradient_(exact(input));
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::morpho
+
+} // end of namespace oln
+
+
+#endif // ! OLN_MORPHO_EXTERNAL_GRADIENT_HH
Index: oln/arith/plus.hh
--- oln/arith/plus.hh (revision 0)
+++ oln/arith/plus.hh (revision 0)
@@ -0,0 +1,64 @@
+// Copyright (C) 2007 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 OLN_ARITH_PLUS_HH
+# define OLN_ARITH_PLUS_HH
+
+
+namespace oln
+{
+
+ namespace arith
+ {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ operator + (const Image<I>& lhs, const Image<I>& rhs);
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename I>
+ oln_plain(I)
+ operator + (const Image<I>& lhs, const Image<I>& rhs)
+ {
+ oln_plain(I) output;
+ init(output, with, lhs);
+ oln_piter(I) p(lhs.points());
+ for_all(p)
+ output(p) = lhs(p) + rhs(p);
+ return output;
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+ } // end of namespace oln::arith
+
+} // end of namespace oln
+
+#endif // ! OLN_ARITH_PLUS_HH
Index: oln/arith/minus.hh
--- oln/arith/minus.hh (revision 0)
+++ oln/arith/minus.hh (revision 0)
@@ -0,0 +1,64 @@
+// Copyright (C) 2007 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 OLN_ARITH_MINUS_HH
+# define OLN_ARITH_MINUS_HH
+
+
+namespace oln
+{
+
+// namespace arith
+// {
+
+ // Fwd decl.
+
+ template <typename I>
+ oln_plain(I)
+ operator - (const Image<I>& lhs, const Image<I>& rhs);
+
+# ifndef OLN_INCLUDE_ONLY
+
+ template <typename I>
+ oln_plain(I)
+ operator - (const Image<I>& lhs, const Image<I>& rhs)
+ {
+ oln_plain(I) output;
+ init(output, with, lhs);
+ oln_piter(I) p(lhs.points());
+ for_all(p)
+ output(p) = lhs(p) - rhs(p);
+ return output;
+ }
+
+# endif // ! OLN_INCLUDE_ONLY
+
+// } // end of namespace oln::arith
+
+} // end of namespace oln
+
+#endif // ! OLN_ARITH_MINUS_HH
Index: oln/core/concept/operators.hh
--- oln/core/concept/operators.hh (revision 901)
+++ oln/core/concept/operators.hh (working copy)
@@ -158,12 +158,13 @@
return exact(rhs).op_unary_minus_();
}
- template <typename T>
+/* template <typename T>
T operator- (const Any<T>& lhs, const Any<T>& rhs)
{
T tmp = exact(lhs);
return tmp -= rhs;
}
+*/
// template <typename L, typename R>
// xtd_op_minus_trait(L, R) operator- (const Any<L>& lhs, const Any<R>& rhs)
Index: oln/core/2d/image2d.hh
--- oln/core/2d/image2d.hh (revision 901)
+++ oln/core/2d/image2d.hh (working copy)
@@ -213,7 +213,7 @@
box2d b;
bool box_ok = init(b, with, dat);
postcondition(box_ok);
- array2d_<T,int> ptr = new array2d_<T,int>(b.pmin().row(),
+ array2d_<T,int>* ptr = new array2d_<T,int>(b.pmin().row(),
b.pmin().col(),
b.pmax().row(),
b.pmax().col());