https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Kill more warnings in tests.
* mln/morpho/Rd.hh (mln::morpho::impl::Rd::Rd): Add braces around
inner `if' to avoid (visual) ambiguity w.r.t. a dangling `else'.
* mln/morpho/contrast.hh: Wrap long lines.
* mln/morpho/opening.hh, tests/morpho/contrast.cc:
Add FIXMEs.
mln/morpho/Rd.hh | 2 ++
mln/morpho/contrast.hh | 3 ++-
mln/morpho/opening.hh | 2 ++
tests/morpho/contrast.cc | 9 +++++++--
4 files changed, 13 insertions(+), 3 deletions(-)
Index: tests/morpho/contrast.cc
--- tests/morpho/contrast.cc (revision 2151)
+++ tests/morpho/contrast.cc (working copy)
@@ -54,12 +54,17 @@
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
+ /* FIXME: Have dilation take the border into account (as erosion
+ does), and fill it with min_value(V), sot that the post-condition
+ in opening works. */
image2d<int_u8> out = morpho::contrast(lena, rect);
io::pgm::save(out, "out.pgm");
{
- // self-duality test:
- image2d<int_u8> out_ = morpho::complementation( morpho::contrast(
morpho::complementation(lena),
+ // Self-duality test.
+ // FIXME: Likewise.
+ image2d<int_u8> out_ =
+ morpho::complementation( morpho::contrast( morpho::complementation(lena),
rect )
);
mln_assertion(out_ == out);
Index: mln/morpho/contrast.hh
--- mln/morpho/contrast.hh (revision 2151)
+++ mln/morpho/contrast.hh (working copy)
@@ -62,7 +62,8 @@
mln_precondition(exact(input).has_data());
mln_precondition(! exact(win).is_empty());
- mln_concrete(I) output = arith::plus( input,
+ mln_concrete(I) output =
+ arith::plus( input,
top_hat_white(input, win) - top_hat_black(input, win),
fun::v2v::saturate<mln_value(I)>() );
Index: mln/morpho/opening.hh
--- mln/morpho/opening.hh (revision 2151)
+++ mln/morpho/opening.hh (working copy)
@@ -62,6 +62,8 @@
mln_concrete(I) output = dilation(erosion(input, win), geom::sym(win));
+ // FIXME: Is this postcondition always true, even if the
+ // structuring element is not centered?
mln_postcondition(output <= input);
trace::exiting("morpho::opening");
return output;
Index: mln/morpho/Rd.hh
--- mln/morpho/Rd.hh (revision 2151)
+++ mln/morpho/Rd.hh (working copy)
@@ -147,10 +147,12 @@
{
point p = S[i];
if (parent(p) == p)
+ {
if (o(p) == mln_max(value))
o(p) = g(p);
else
o(p) = o(parent(p));
+ }
is_proc(p) = true;
}