Commit cbcb55eb authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Add activity to morphology algebraic canvas.

	* mln/canvas/morpho/algebraic_union_find.hh (activity): New.
	This allows for accumulators that cannot properly implement
	set_value to work with algebraic filters and levelings.
	* mln/test/predicate.hh: Fix signature.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3175 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 55fda38f
2009-01-21 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Add activity to morphology algebraic canvas.
* mln/canvas/morpho/algebraic_union_find.hh (activity): New.
This allows for accumulators that cannot properly implement
set_value to work with algebraic filters and levelings.
* mln/test/predicate.hh: Fix signature.
2009-01-20 Guillaume Lazzara <z@lrde.epita.fr>
 
Introduce debug::quiet.
......@@ -98,6 +98,7 @@ namespace mln
// Auxiliary data.
mln_ch_value(O, bool) deja_vu;
mln_ch_value(I, bool) activity;
mln_ch_value(O, P) parent;
mln_ch_value(O, A) data;
......@@ -105,6 +106,8 @@ namespace mln
{
initialize(deja_vu, input);
mln::data::fill(deja_vu, false);
initialize(activity, input);
mln::data::fill(activity, true);
initialize(parent, input);
initialize(data, input);
f.init(); // init required.
......@@ -151,7 +154,7 @@ namespace mln
P r = find_root(parent, n);
if (r != p)
{
if (input(r) == input(p) || f.is_active(data(r))) // Equiv(r, p)
if (input(r) == input(p) || (activity(r) && f.is_active(data(r)))) // Equiv(r, p)
// Either a flat zone or the component of r is still growing.
{
/* FIXME: Same remark as above concerning the
......@@ -168,9 +171,14 @@ namespace mln
template parameter A is not bound). */
data(p).take(data(r));
parent(r) = p;
if (activity(r) == false)
activity(p) = false;
}
else
f.inactivate(data(p));
else
{
activity(p) = false;
f.inactivate(data(p));
}
}
}
deja_vu(p) = true;
......
// Copyright (C) 2007 EPITA Research and Development Laboratory
// Copyright (C) 2007, 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
......@@ -28,10 +29,9 @@
#ifndef MLN_TEST_PREDICATE_HH
# define MLN_TEST_PREDICATE_HH
/*! \file mln/test/predicate.hh
*
* \brief Test a predicate on the pixel values of an image.
*/
/// \file mln/test/predicate.hh
///
/// Test a predicate on the pixel values of an image.
# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
......@@ -62,7 +62,7 @@ namespace mln
* \param[in] f The predicate.
*/
template <typename I, typename J, typename F>
bool predicate(const Image<I>& lhs, const Image<J>& rhs, const Function_v2b<F>& f);
bool predicate(const Image<I>& lhs, const Image<J>& rhs, const Function_vv2b<F>& f);
/*! Test if all points of \p pset verify the predicate \p f.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment