* mln/optical_flow/combination/verysimple.hh: Here. --- milena/ChangeLog | 6 ++ .../combination/verysimple.hh} | 71 +++++++++----------- 2 files changed, 39 insertions(+), 38 deletions(-) copy milena/mln/{morpho/tree/propagate_representative.hh => optical_flow/combination/verysimple.hh} (50%)
diff --git a/milena/ChangeLog b/milena/ChangeLog index 9a6f18d..557569c 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,11 @@ 2013-01-29 Sylvain Lobry lobry@lrde.epita.fr
+ Added a simple combination. + + * mln/optical_flow/combination/verysimple.hh: Here. + +2013-01-29 Sylvain Lobry lobry@lrde.epita.fr + Added functions used in the trust map computation.
* mln/optical_flow/trustmap.hh: Here. diff --git a/milena/mln/morpho/tree/propagate_representative.hh b/milena/mln/optical_flow/combination/verysimple.hh similarity index 50% copy from milena/mln/morpho/tree/propagate_representative.hh copy to milena/mln/optical_flow/combination/verysimple.hh index 64d91b4..fe4ad0e 100644 --- a/milena/mln/morpho/tree/propagate_representative.hh +++ b/milena/mln/optical_flow/combination/verysimple.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -23,67 +24,61 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License.
-#ifndef MLN_MORPHO_TREE_PROPAGATE_REPRESENTATIVE_HH -# define MLN_MORPHO_TREE_PROPAGATE_REPRESENTATIVE_HH +#ifndef MLN_OPTICAL_FLOW_COMBINATION_VERYSIMPLE_HH_ +# define MLN_OPTICAL_FLOW_COMBINATION_VERYSIMPLE_HH_
/// \file /// -/// Component tree routines. - +/// \brief The simpliest combination.
+# include <mln/value/int_u8.hh> +# include <mln/core/alias/vec2d.hh> # include <mln/core/concept/image.hh> -# include <mln/morpho/tree/data.hh> - +# include <mln/win/rectangle2d.hh> +# include <mln/pw/value.hh> +# include <mln/core/image/dmorph/image_if.hh>
namespace mln {
- namespace morpho + namespace optical_flow {
- namespace tree + namespace combination {
- /// Propagate the representative node's value to - /// non-representative points of the component. + /// \brief The simpliest combination /// - /// \param t Component tree. - /// \param f_ Value image. - // - template <typename T, typename F> - void - propagate_representative(const T& t, Image<F>& f_); - + /// @param optical_flowHS The optical flow from the global algorithm + /// @param optical_flowLK The optical flow from the local algorithm + /// @param mask The mask of the trust map
+ void + verysimpleCombination (mln::image2dmln::vec2d_f& optical_flowHS, + mln::image2dmln::vec2d_f& optical_flowLK, + mln::image2d<bool>& mask);
# ifndef MLN_INCLUDE_ONLY - - - template <typename T, typename F> - inline void - propagate_representative(const T& t, Image<F>& f_) + verysimpleCombination (mln::image2dmln::vec2d_f& optical_flowHS, + mln::image2dmln::vec2d_f& optical_flowLK, + mln::image2d<bool>& mask) { - F a = exact(f_); - mln_precondition(a.is_valid()); + mln_piter_ (mln::image2dmln::vec2d_f) p2 (optical_flowHS.domain());
- mln_up_site_piter(T) p(t); - for_all(p) - if (! t.is_a_node(p)) - { - mln_assertion(t.is_a_node(t.parent(p))); - a(p) = a(t.parent(p)); - } + for_all(p2) + { + if (mask(p2) == false) + optical_flowLK(p2) = optical_flowHS(p2); + } }
- # endif // ! MLN_INCLUDE_ONLY
+ } //end of namespace combination
- } // end of namespace mln::morpho::tree - - } // end of namespace mln::morpho + } //end of namespace optical_flow
-} // end of namespace mln +} //end of namespace mln
-#endif // ! MLN_MORPHO_TREE_PROPAGATE_REPRESENTATIVE_HH +#endif // ! MLN_OPTICAL_FLOW_COMBINATION_VERYSIMPLE_HH_