* mln/algebra/all.hh: fix comments.
* mln/algebra/vec.hh: add operator>>.
* mln/core/internal/graph_psite_base.hh: convert to the correct id
type.
* mln/debug/draw_graph.hh: update doc.
* mln/graph/all.hh,
* mln/graph/essential.hh: new headers.
* mln/all.hh,
* mln/essential/routine.hh: include new headers.
* mln/io/pnm/load.hh: fix load_ascii builtin.
* mln/make/edge_image.hh: update prototype.
* mln/make/vertex_image.hh: be less restrictive on the function type.
* tests/level/approx/median.cc,
* tests/level/median.cc,
* tests/level/naive/median.cc: use a smaller image.
* tests/make/dummy_p_vertices.cc: test element id.
---
milena/ChangeLog | 31 +++++++
milena/mln/algebra/all.hh | 12 ++--
milena/mln/algebra/vec.hh | 18 ++++-
milena/mln/all.hh | 4 +-
milena/mln/core/internal/graph_psite_base.hh | 16 +++-
milena/mln/debug/draw_graph.hh | 97 +++++++++++++--------
milena/mln/essential/routine.hh | 4 +-
milena/mln/{algebra => graph}/all.hh | 25 ++---
milena/mln/{algebra/all.hh => graph/essential.hh} | 30 ++-----
milena/mln/io/pnm/load.hh | 11 ++-
milena/mln/make/edge_image.hh | 11 +--
milena/mln/make/vertex_image.hh | 15 ++--
milena/tests/level/approx/median.cc | 4 +-
milena/tests/level/median.cc | 2 +-
milena/tests/level/naive/median.cc | 12 ++--
milena/tests/make/dummy_p_vertices.cc | 3 +-
16 files changed, 185 insertions(+), 110 deletions(-)
copy milena/mln/{algebra => graph}/all.hh (72%)
copy milena/mln/{algebra/all.hh => graph/essential.hh} (70%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 5edf45d..b073efe 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,34 @@
+2009-04-29 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Small fixes.
+
+ * mln/algebra/all.hh: fix comments.
+
+ * mln/algebra/vec.hh: add operator>>.
+
+ * mln/core/internal/graph_psite_base.hh: convert to the correct id
+ type.
+
+ * mln/debug/draw_graph.hh: update doc.
+
+ * mln/graph/all.hh,
+ * mln/graph/essential.hh: new headers.
+
+ * mln/all.hh,
+ * mln/essential/routine.hh: include new headers.
+
+ * mln/io/pnm/load.hh: fix load_ascii builtin.
+
+ * mln/make/edge_image.hh: update prototype.
+
+ * mln/make/vertex_image.hh: be less restrictive on the function type.
+
+ * tests/level/approx/median.cc,
+ * tests/level/median.cc,
+ * tests/level/naive/median.cc: use a smaller image.
+
+ * tests/make/dummy_p_vertices.cc: test element id.
+
2009-04-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
Rename Image::pset to Image::domain_t.
diff --git a/milena/mln/algebra/all.hh b/milena/mln/algebra/all.hh
index ba62843..9250b03 100644
--- a/milena/mln/algebra/all.hh
+++ b/milena/mln/algebra/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 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,16 +29,15 @@
#ifndef MLN_ALGEBRA_ALL_HH
# define MLN_ALGEBRA_ALL_HH
-/*! \file mln/algebra/essential.hh
- *
- * \brief File that includes essential "point-wise" expression tools.
- */
+/// \file mln/algebra/all.hh
+///
+/// File that includes all algebraic structures.
namespace mln
{
- /// Namespace of "point-wise" expression tools.
+ /// Namespace of algebraic structure.
namespace algebra {}
} // end of namespace mln
diff --git a/milena/mln/algebra/vec.hh b/milena/mln/algebra/vec.hh
index 858dcea..64c6db0 100644
--- a/milena/mln/algebra/vec.hh
+++ b/milena/mln/algebra/vec.hh
@@ -345,7 +345,7 @@ namespace mln
operator-(const vec<n,T>& lhs, const vec<n,U>& rhs);
// vec * vec
-
+
/// Scalar product (dot product).
template <unsigned n, typename T, typename U>
mln_sum_product(T,U)
@@ -369,6 +369,12 @@ namespace mln
std::ostream&
operator<<(std::ostream& ostr, const vec<n,T>& v);
+ // >>
+
+ template <unsigned n, typename T>
+ std::istream&
+ operator>>(std::istream& istr, vec<n,T>& v);
+
// vprod // FIXME: Generalize...
/// Vectorial product (cross product).
@@ -613,6 +619,16 @@ namespace mln
return ostr;
}
+ template <unsigned n, typename T>
+ inline
+ std::istream&
+ operator>>(std::istream& istr, vec<n,T>& v)
+ {
+ for (unsigned i = 0; i < n; ++i)
+ istr >> v[i];
+ return istr;
+ }
+
// vprod
template <typename T, typename U>
diff --git a/milena/mln/all.hh b/milena/mln/all.hh
index 879cd94..cc4374b 100644
--- a/milena/mln/all.hh
+++ b/milena/mln/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 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
@@ -48,6 +49,7 @@
#include <mln/extract/all.hh>
#include <mln/fun/all.hh>
#include <mln/geom/all.hh>
+#include <mln/graph/all.hh>
#include <mln/histo/all.hh>
#include <mln/io/all.hh>
#include <mln/labeling/all.hh>
diff --git a/milena/mln/core/internal/graph_psite_base.hh
b/milena/mln/core/internal/graph_psite_base.hh
index d02df00..553c060 100644
--- a/milena/mln/core/internal/graph_psite_base.hh
+++ b/milena/mln/core/internal/graph_psite_base.hh
@@ -55,6 +55,7 @@ namespace mln
// As a Proxy:
const mln_site(S)& subj_();
+ typedef typename S::graph_element::id_t id_t;
/// Setters.
/// \{
@@ -77,7 +78,7 @@ namespace mln
const typename S::graph_t& graph() const;
/// Return the id of the graph element designated by this psite.
- unsigned id() const;
+ id_t id() const;
/// \}
@@ -89,6 +90,9 @@ namespace mln
/// Convertion towards the graph element Id.
operator unsigned() const;
+ /// Convertion towards the graph element Id.
+ operator id_t() const;
+
/// Conversion towards the graph element (vertex or edge).
operator const typename S::graph_element&() const;
@@ -258,7 +262,7 @@ namespace mln
template <typename S, typename E>
inline
- unsigned
+ typename graph_psite_base<S,E>::id_t
graph_psite_base<S,E>::id() const
{
return elt_.id();
@@ -296,6 +300,14 @@ namespace mln
template <typename S, typename E>
inline
+ graph_psite_base<S,E>::operator id_t() const
+ {
+ mln_precondition(is_valid());
+ return elt_.id();
+ }
+
+ template <typename S, typename E>
+ inline
graph_psite_base<S,E>::operator unsigned() const
{
mln_precondition(is_valid());
diff --git a/milena/mln/debug/draw_graph.hh b/milena/mln/debug/draw_graph.hh
index 7584b4e..90b12ac 100644
--- a/milena/mln/debug/draw_graph.hh
+++ b/milena/mln/debug/draw_graph.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2007, 2008, 2009 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
@@ -49,34 +49,55 @@ namespace mln
namespace debug
{
- /// Draw an image \p ima from a mln::p_graph \p pg, with
- /// value \p vertex_v for vertices, value \p edge_v for edges and 0 for
+ /// Draw an image \p ima from a mln::p_vertices \p pv, with
+ /// value \p vcolor for vertices, value \p ecolor for edges and 0 for
/// the background.
- ///
- /// \param[in,out] ima The image to be drawn.
- /// \param[in] pv The p_vertices which contains vertices positions.
- /// \param[in] vertex_v The value to assign to pixels which contains
- /// vertices.
- /// \param[in] edge_v The value to assign to pixels which contains
- /// edges.
+ /*
+ * \param[in,out] ima The image to be drawn.
+ * \param[in] pv The p_vertices which contains vertices positions.
+ * \param[in] vcolor The value to assign to pixels which contains
+ * vertices.
+ * \param[in] ecolor The value to assign to pixels which contains
+ * edges.
+ */
template <typename I, typename G, typename F>
void
draw_graph(Image<I>& ima, const p_vertices<G, F>& pv,
- mln_value(I) vertex_v, mln_value(I) edge_v);
-
-
+ mln_value(I) vcolor, mln_value(I) ecolor);
+
+
+ /// Draw an image \p ima from a mln::p_vertices \p pv. Colors for vertices
+ /// are defined through \p vcolor_f_. Colors for edges are defined though
+ /// \p ecolor_f_.
+ /*
+ * \param[in,out] ima The image to be drawn.
+ * \param[in] pv The p_vertices which contains vertices positions.
+ * \param[in] vcolor_f_ A function returning a color value for vertices.
+ * \param[in] ecolor_f_ A function returning a color value for edges.
+ *
+ */
template <typename I, typename G, typename F, typename V, typename E>
void
draw_graph(Image<I>& ima,
const p_vertices<G, F>& pv,
- const Function<V>& vcolor, const Function<E>& ecolor_);
-
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_);
+
+ /// Draw an image \p ima from a mln::p_vertices \p pv. Colors for vertices
+ /// are defined through \p vcolor_f_. Colors for edges are defined though
+ /// \p ecolor_f_.
+ /*
+ * \param[in,out] ima The image to be drawn.
+ * \param[in] pv The p_vertices which contains vertices positions.
+ * \param[in] vcolor_f_ A function returning a color value for vertices.
+ * \param[in] ecolor_f_ A function returning a color value for edges.
+ *
+ */
template <typename I, typename G, typename F, typename V, typename E>
inline
void
draw_graph(Image<I>& ima,
const p_vertices<util::line_graph<G>, F>& pv,
- const Function<V>& vcolor_, const Function<E>& ecolor_);
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_);
# ifndef MLN_INCLUDE_ONLY
@@ -91,8 +112,8 @@ namespace mln
void
draw_graph(Image<I>& ima,
const p_edges<G, F>& pe,
- mln_value(I) vertex_v,
- mln_value(I) edge_v)
+ mln_value(I) vcolor,
+ mln_value(I) ecolor)
{
trace::entering("debug::draw_graph");
@@ -102,11 +123,11 @@ namespace mln
for_all(p)
{
if (exact(ima).has(p.first()) && exact(ima).has(p.second()))
- draw::line(exact(ima), p.first(), p.second(), edge_v);
+ draw::line(exact(ima), p.first(), p.second(), ecolor);
if (exact(ima).has(p.first()))
- exact(ima)(p.first()) = vertex_v;
+ exact(ima)(p.first()) = vcolor;
if (exact(ima).has(p.second()))
- exact(ima)(p.second()) = vertex_v;
+ exact(ima)(p.second()) = vcolor;
}
trace::exiting("debug::draw_graph");
@@ -118,8 +139,8 @@ namespace mln
void
draw_graph(Image<I>& ima,
const p_vertices<G, F>& pv,
- mln_value(I) vertex_v,
- mln_value(I) edge_v)
+ mln_value(I) vcolor,
+ mln_value(I) ecolor)
{
trace::entering("debug::draw_graph");
@@ -128,58 +149,60 @@ namespace mln
typedef p_vertices<G, F> pv_t;
mln_edge_iter(G) ei(g);
for_all(ei)
- draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), edge_v);
+ draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), ecolor);
// Draw vertices.
mln_piter(pv_t) p(pv);
for_all(p)
if (exact(ima).has(p))
- exact(ima)(p) = vertex_v;
+ exact(ima)(p) = vcolor;
trace::exiting("debug::draw_graph");
}
+
// FIXME: Refactor + be more restrictive on the function type.
template <typename I, typename G, typename F, typename V, typename E>
inline
void
draw_graph(Image<I>& ima,
const p_vertices<G, F>& pv,
- const Function<V>& vcolor_, const Function<E>& ecolor_)
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_)
{
trace::entering("debug::draw_graph");
- const V& vcolor = exact(vcolor_);
- const E& ecolor = exact(ecolor_);
+ const V& vcolor_f = exact(vcolor_f_);
+ const E& ecolor_f = exact(ecolor_f_);
// Draw edges.
const G& g = pv.graph();
typedef p_vertices<G, F> pv_t;
mln_edge_iter(G) ei(g);
for_all(ei)
- draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), ecolor(ei.id()));
+ draw::line(exact(ima), pv(ei.v1()), pv(ei.v2()), ecolor_f(ei.id()));
// Draw vertices.
mln_piter(pv_t) p(pv);
for_all(p)
if (exact(ima).has(p))
- exact(ima)(p) = vcolor(p);
+ exact(ima)(p) = vcolor_f(p);
trace::exiting("debug::draw_graph");
}
+
// FIXME: Refactor + be more restrictive on the function type.
template <typename I, typename G, typename F, typename V, typename E>
inline
void
draw_graph(Image<I>& ima,
const p_vertices<util::line_graph<G>, F>& pv,
- const Function<V>& vcolor_, const Function<E>& ecolor_)
+ const Function<V>& vcolor_f_, const Function<E>& ecolor_f_)
{
trace::entering("debug::draw_graph");
- const V& vcolor = exact(vcolor_);
- const E& ecolor = exact(ecolor_);
+ const V& vcolor_f = exact(vcolor_f_);
+ const E& ecolor_f = exact(ecolor_f_);
typedef util::line_graph<G> LG;
@@ -191,13 +214,13 @@ namespace mln
{
p_line2d l = pv(vi.id());
// Draw edges (Line graph vertices).
- draw::line(exact(ima), l.begin(), l.end(), ecolor(vi.id()));
+ draw::line(exact(ima), l.begin(), l.end(), ecolor_f(vi.id()));
// Draw vertices (graph vertices).
if (exact(ima).has(l.begin()))
- exact(ima)(l.begin()) = vcolor(g.edge(vi).v1());
+ exact(ima)(l.begin()) = vcolor_f(g.edge(vi).v1());
if (exact(ima).has(l.end()))
- exact(ima)(l.end()) = vcolor(g.edge(vi).v2());
+ exact(ima)(l.end()) = vcolor_f(g.edge(vi).v2());
}
trace::exiting("debug::draw_graph");
diff --git a/milena/mln/essential/routine.hh b/milena/mln/essential/routine.hh
index 434519f..1818964 100644
--- a/milena/mln/essential/routine.hh
+++ b/milena/mln/essential/routine.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 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
@@ -45,6 +46,7 @@
# include <mln/extract/essential.hh>
# include <mln/fun/essential.hh>
# include <mln/geom/essential.hh>
+# include <mln/graph/essential.hh>
# include <mln/histo/essential.hh>
# include <mln/io/essential.hh>
# include <mln/labeling/essential.hh>
diff --git a/milena/mln/algebra/all.hh b/milena/mln/graph/all.hh
similarity index 72%
copy from milena/mln/algebra/all.hh
copy to milena/mln/graph/all.hh
index ba62843..35707fe 100644
--- a/milena/mln/algebra/all.hh
+++ b/milena/mln/graph/all.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2009 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
@@ -25,29 +25,24 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ALGEBRA_ALL_HH
-# define MLN_ALGEBRA_ALL_HH
+#ifndef MLN_GRAPH_ALL_HH
+# define MLN_GRAPH_ALL_HH
-/*! \file mln/algebra/essential.hh
- *
- * \brief File that includes essential "point-wise" expression tools.
- */
+/// \file mln/graph/all.hh
+///
+/// File that include all graph related routines.
namespace mln
{
- /// Namespace of "point-wise" expression tools.
- namespace algebra {}
+ /// Namespace of graph related routines.
+ namespace graph {}
} // end of namespace mln
-# include <mln/algebra/h_mat.hh>
-# include <mln/algebra/h_vec.hh>
-# include <mln/algebra/mat.hh>
-# include <mln/algebra/quat.hh>
-# include <mln/algebra/vec.hh>
+# include <mln/graph/compute.hh>
-#endif // ! MLN_ALGEBRA_ALL_HH
+#endif // ! MLN_GRAPH_ALL_HH
diff --git a/milena/mln/algebra/all.hh b/milena/mln/graph/essential.hh
similarity index 70%
copy from milena/mln/algebra/all.hh
copy to milena/mln/graph/essential.hh
index ba62843..d4a0ef1 100644
--- a/milena/mln/algebra/all.hh
+++ b/milena/mln/graph/essential.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2009 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
@@ -25,29 +25,15 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_ALGEBRA_ALL_HH
-# define MLN_ALGEBRA_ALL_HH
+#ifndef MLN_GRAPH_ESSENTIAL_HH
+# define MLN_GRAPH_ESSENTIAL_HH
-/*! \file mln/algebra/essential.hh
- *
- * \brief File that includes essential "point-wise" expression tools.
- */
+/// \file mln/graph/essential.hh
+///
+/// File that include essential graph related routines.
-namespace mln
-{
+# include <mln/graph/all.hh>
- /// Namespace of "point-wise" expression tools.
- namespace algebra {}
-} // end of namespace mln
-
-
-# include <mln/algebra/h_mat.hh>
-# include <mln/algebra/h_vec.hh>
-# include <mln/algebra/mat.hh>
-# include <mln/algebra/quat.hh>
-# include <mln/algebra/vec.hh>
-
-
-#endif // ! MLN_ALGEBRA_ALL_HH
+#endif // ! MLN_GRAPH_ESSENTIAL_HH
diff --git a/milena/mln/io/pnm/load.hh b/milena/mln/io/pnm/load.hh
index be37c51..71ee293 100644
--- a/milena/mln/io/pnm/load.hh
+++ b/milena/mln/io/pnm/load.hh
@@ -181,8 +181,17 @@ namespace mln
void load_ascii_builtin(std::ifstream& file, I& ima)
{
mln_fwd_piter(I) p(ima.domain());
+
+ // FIXME: May be wrong!
+ // Worked out with an image with a max value of 255
+ // loaded in an image2d<unsigned char>.
+ unsigned n;
+
for_all(p)
- file >> ima(p);
+ {
+ file >> n;
+ ima(p) = n;
+ }
}
/// load_raw_2d.
diff --git a/milena/mln/make/edge_image.hh b/milena/mln/make/edge_image.hh
index 7ca6980..11f9358 100644
--- a/milena/mln/make/edge_image.hh
+++ b/milena/mln/make/edge_image.hh
@@ -81,10 +81,10 @@ namespace mln
///
/// \return an edge image.
//
- template <typename P, typename V, typename FP, typename FV, typename G>
+ template <typename P, typename V, typename G, typename FP, typename FV>
mln::edge_image<mln_result(FP),mln_result(FV),G>
edge_image(const vertex_image<P,V,G>& v_ima_,
- const Function_v2v<FP>& fp_,
+ const p_edges<G,FP> pe,
const Function_vv2v<FV>& fv_);
@@ -125,23 +125,20 @@ namespace mln
}
- template <typename P, typename V, typename FP, typename FV, typename G>
+ template <typename P, typename V, typename G, typename FP, typename FV>
mln::edge_image<mln_result(FP),mln_result(FV),G>
edge_image(const vertex_image<P,V,G>& v_ima_,
- const Function_v2v<FP>& fp_,
+ const p_edges<G,FP> pe,
const Function_vv2v<FV>& fv_)
{
trace::entering("make::edge_image");
- const FP& fp = exact(fp_);
const FV& fv = exact(fv_);
const vertex_image<P,V,G>& v_ima = exact(v_ima_);
mln_precondition(v_ima.is_valid());
fun::i2v::array<mln_result(FV)> tmp_fv(v_ima.domain().graph().e_nmax());
- p_edges<G,FP> pe(v_ima.domain().graph(), fp);
-
typedef mln::edge_image<mln_result(FP),mln_result(FV),G> edge_ima_t;
edge_ima_t ima_e(pe, tmp_fv);
diff --git a/milena/mln/make/vertex_image.hh b/milena/mln/make/vertex_image.hh
index dc7e28f..a013a5e 100644
--- a/milena/mln/make/vertex_image.hh
+++ b/milena/mln/make/vertex_image.hh
@@ -51,9 +51,9 @@ namespace mln
///
/// \return A vertex image.
//
- template <typename V, typename G>
- mln::vertex_image<void,V,G>
- vertex_image(const Graph<G>& g, const fun::i2v::array<V>& fv);
+ template <typename G, typename FV>
+ mln::vertex_image<void,mln_result(FV),G>
+ vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv);
/// Construct a vertex image
@@ -74,15 +74,16 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
- template <typename V, typename G>
- mln::vertex_image<void,V,G>
- vertex_image(const Graph<G>& g, const fun::i2v::array<V>& fv)
+ template <typename G, typename FV>
+ mln::vertex_image<void,mln_result(FV),G>
+ vertex_image(const Graph<G>& g, const Function_i2v<FV>& fv)
{
trace::entering("make::vertex_image");
mln_precondition(exact(g).is_valid());
p_vertices<G> pv(g);
- mln::vertex_image<void,V,G> ima(pv, fv);
+ mln::vertex_image<void,mln_result(FV),G>
+ ima(pv, mln::convert::to<fun::i2v::array<mln_result(FV)> >(fv));
trace::exiting("make::vertex_image");
return ima;
diff --git a/milena/tests/level/approx/median.cc b/milena/tests/level/approx/median.cc
index 7dd3f12..5bd8062 100644
--- a/milena/tests/level/approx/median.cc
+++ b/milena/tests/level/approx/median.cc
@@ -47,10 +47,10 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
{
- win::octagon2d oct(51);
+ win::octagon2d oct(49);
image2d<int_u8> out = level::approx::median(lena, oct);
io::pgm::save(out, "out_oct.pgm");
}
diff --git a/milena/tests/level/median.cc b/milena/tests/level/median.cc
index 40ca061..8489260 100644
--- a/milena/tests/level/median.cc
+++ b/milena/tests/level/median.cc
@@ -49,7 +49,7 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
{
win::rectangle2d rect(51, 51);
image2d<int_u8> out = level::median(lena, rect);
diff --git a/milena/tests/level/naive/median.cc b/milena/tests/level/naive/median.cc
index 9f73289..71772d3 100644
--- a/milena/tests/level/naive/median.cc
+++ b/milena/tests/level/naive/median.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009 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
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/level/naive/median.cc
- *
- * \brief Test on mln::level::naive::median.
- */
+/// \file tests/level/naive/median.cc
+///
+/// Test on mln::level::naive::median.
#include <mln/core/image/image2d.hh>
#include <mln/win/rectangle2d.hh>
@@ -52,7 +52,7 @@ int main()
border::thickness = 52;
image2d<int_u8> lena;
- io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
image2d<int_u8> out(lena.domain());
level::naive::median(lena, rec, out);
diff --git a/milena/tests/make/dummy_p_vertices.cc
b/milena/tests/make/dummy_p_vertices.cc
index c97e805..ba7a1db 100644
--- a/milena/tests/make/dummy_p_vertices.cc
+++ b/milena/tests/make/dummy_p_vertices.cc
@@ -54,11 +54,12 @@ int main()
{
typedef p_vertices<G> pe_t;
pe_t pe = make::dummy_p_vertices(g);
+ unsigned i = 0;
mln_assertion(pe.nsites() == 5);
mln_piter_(pe_t) p(pe);
for_all(p)
- mln_assertion(p == 0);
+ mln_assertion(p.id() == i++);
}
{
--
1.5.6.5