Commit fd644948 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Small fixes in Milena.

	* mln/draw/site_set.hh: Remove call to exact().

	* mln/morpho/skeleton_constrained.hh: Add a missing const in fast
	implementation.

	* mln/topo/is_simple_2d.hh: Add a comment.

	* mln/topo/skeleton/is_simple_point.hh: Fix a wrong neighborhood
	type.

	* tests/topo/skeleton/is_simple_point.cc: Fix compilation.
parent 7c8d8eda
2011-09-06 Guillaume Lazzara <z@lrde.epita.fr>
Small fixes in Milena.
* mln/draw/site_set.hh: Remove call to exact().
* mln/morpho/skeleton_constrained.hh: Add a missing const in fast
implementation.
* mln/topo/is_simple_2d.hh: Add a comment.
* mln/topo/skeleton/is_simple_point.hh: Fix a wrong neighborhood
type.
* tests/topo/skeleton/is_simple_point.cc: Fix compilation.
2011-09-06 Guillaume Lazzara <z@lrde.epita.fr>
 
* mln/morpho/skeleton_constrained.hh: Fix algorithm.
......@@ -67,12 +67,12 @@ namespace mln
const mln_value(I)& v,
unsigned output_ratio)
{
mln_precondition(exact(ima).is_valid());
mln_precondition(exact(ima).domain() >= exact(s));
I& ima = exact(ima_);
const S& s = exact(s_);
mln_precondition(ima.is_valid());
mln_precondition(ima.domain() >= s);
mln_piter(S) p(s);
for_all(p)
ima(p / output_ratio) = v;
......
......@@ -193,7 +193,7 @@ namespace mln
output = duplicate(input);
extension::adjust_fill(output, nbh, false);
mln_pixter(I) p_in(input);
mln_pixter(const I) p_in(input);
for_all(p_in)
if (p_in.val() == false &&
is_simple.check__(input, p_in)) // <-- is_simple.check
......
......@@ -161,6 +161,7 @@ namespace mln
unsigned res = 0;
// Note: fwd here but bkd in is_simple_point.hh...
mln_fwd_niter(N2) n(c8(), p);
for_all(n)
{
......
......@@ -159,7 +159,8 @@ namespace mln
{
unsigned res = 0;
mln_bkd_niter(N) n(c8(), p);
// Note: bkd here but fwd in is_simple_2d.hh...
mln_bkd_niter(N2) n(c8(), p);
for_all(n)
{
res = (res << 1);
......
......@@ -27,6 +27,7 @@
#include <mln/make/image2d.hh>
#include <mln/topo/skeleton/is_simple_point.hh>
#include <mln/make/image.hh>
#include <mln/make/dual_neighb.hh>
static const unsigned ref[] = { 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0 };
......@@ -40,8 +41,14 @@ int main()
typedef image2d<bool> I;
I ima = make::image(vals);
typedef
neighb<win::multiple_size<2u, window<dpoint<grid::square, short int> >,
pw::value_<image2d<bool> > > >
nbh_t;
nbh_t nbh = make::dual_neighb(ima, c8(), c4());
unsigned i = 0;
topo::skeleton::is_simple_point<neighb2d> is_simple(c8());
topo::skeleton::is_simple_point<nbh_t> is_simple(nbh);
// Test generic version.
{
......
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