904: Mopho : Top_hat_white, top_hat_black, Fix Opening, Renaming.

Index: ChangeLog from Ugo Jardonnet <ugo.jardonnet@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
participants (1)
-
Ugo Jardonnet