Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
January 2008
- 6 participants
- 89 discussions
08 Jan '08
#118: Ensure Milena supports separate compilation
-----------------------+----------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: defect | Status: new
Priority: critical | Milestone: Olena 1.0ß
Component: Milena | Version: 1.0
Resolution: | Keywords: multiple objects separate compilation
-----------------------+----------------------------------------------------
Old description:
> Currently, several things prevent any attempt to use Milena in a
> multiple-object (`.o` files) context:
> * method and function definitions shall be tagged `inline` to prevent
> any name clash;
> * definitions of global variables shall be replaced by function serving
> a static variable;
> * and so on.
>
> I (Roland) am not sure which test protocol we should use to check this is
> fixed correctly in the whole library. Maybe include the whole headers in
> two separate units, and link them together. Or proceed component per
> component?
New description:
This ticket depends on #43.
Currently, several things prevent any attempt to use Milena in a multiple-
object (`.o` files) context:
* method and function definitions shall be tagged `inline` to prevent any
name clash;
* definitions of global variables shall be replaced by function serving a
static variable;
* and so on.
I (Roland) am not sure which test protocol we should use to check this is
fixed correctly in the whole library. Maybe include the whole headers in
two separate units, and link them together. Or proceed component per
component?
Comment (by levill_r):
Mention ticket:43.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/118#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image library.
1
0
08 Jan '08
#99: Uniform access to images (data) in tests
-----------------------+----------------------------------------------------
Reporter: levill_r | Owner: levill_r
Type: defect | Status: closed
Priority: major | Milestone: Olena 1.0ß
Component: Milena | Version: 1.0
Resolution: fixed | Keywords:
-----------------------+----------------------------------------------------
Changes (by levill_r):
* status: new => closed
* resolution: => fixed
Comment:
Fixed in r1638, r1639 and r1642.
--
Ticket URL: <https://trac.lrde.org/olena/ticket/99#comment:1>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image library.
1
0
Encore désolé (je manque de café, là). :( :(
URL: https://svn.lrde.epita.fr/svn/oln/trunk
Index: milena/ChangeLog
===================================================================
--- milena/ChangeLog (revision 1642)
+++ milena/ChangeLog (revision 1643)
@@ -1,3 +1,66 @@
+2008-01-08 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Get rid of hard-coded paths to input images in remaining tests.
+
+ * tests/core/mono_obased_rle_image.cc,
+ * tests/core/mono_rle_image.cc,
+ * tests/core/obased_rle_image.cc,
+ * tests/core/rle_image.cc,
+ * tests/core/sparse_image.cc,
+ * tests/display/save_and_show.cc,
+ * tests/display/show.cc,
+ * tests/fun/x2x/rotation.cc,
+ * tests/io/fits/fits.cc,
+ * tests/io/pbm/pbm.cc,
+ * tests/io/pgm/pgm.cc,
+ * tests/io/pgm/pgm16.cc,
+ * tests/io/pgm/pgm19.cc,
+ * tests/io/pgm/pgm27.cc,
+ * tests/io/ppm/ppm.cc,
+ * tests/io/ppm/ppm16.cc,
+ * tests/io/ppm/ppm23.cc,
+ * tests/labeling/background.cc,
+ * tests/labeling/blobs.cc,
+ * tests/labeling/flat_zones.cc,
+ * tests/labeling/foreground.cc,
+ * tests/labeling/level.cc,
+ * tests/labeling/regional_maxima.cc,
+ * tests/labeling/regional_minima.cc,
+ * tests/level/approx/median.cc,
+ * tests/level/median.cc,
+ * tests/level/median_dir.cc,
+ * tests/level/median_fast.cc,
+ * tests/level/median_hline2d.cc,
+ * tests/level/naive/median.cc,
+ * tests/line_convolve.cc,
+ * tests/linear_convolve.cc,
+ * tests/linear_gaussian.cc,
+ * tests/linear_lap.cc,
+ * tests/linear_log.cc,
+ * tests/plain.cc:
+ Use tests/data.hh to get the path to the img/ directory.
+ * tests/level/Makefile.am (SUBDIRS): New.
+ Add approx and naive.
+ * tests/level/approx/Makefile.am
+ (check_PROGRAMS, median_SOURCES, TESTS): New.
+ * tests/level/naive/Makefile.am: Likewise.
+
+ * tests/fi_adaptor.cc,
+ * tests/fun/x2x/composed.cc,
+ * tests/seed2tiling.cc,
+ * tests/trait_op_plus.cc,
+ * tests/util/branch_iter.cc,
+ * tests/util/branch_iter_ind.cc,
+ * tests/value/quat.cc,
+ * tests/win/backdiag2d.cc,
+ * tests/win/cube3d.cc,
+ * tests/win/diag2d.cc,
+ * tests/win/disk2d.cc,
+ * tests/win/hline2d.cc,
+ * tests/win/octagon2d.cc,
+ * tests/win/vline2d.cc:
+ Wrap long lines.
+
2008-01-08 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
* mln/core/concept/point.hh: Add operator/ between points and
scalars.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 1642)
+++ ChangeLog (revision 1643)
@@ -1,68 +1,5 @@
2008-01-08 Roland Levillain <roland(a)lrde.epita.fr>
- Get rid of hard-coded paths to input images in remaining tests.
-
- * milena/tests/core/mono_obased_rle_image.cc,
- * milena/tests/core/mono_rle_image.cc,
- * milena/tests/core/obased_rle_image.cc,
- * milena/tests/core/rle_image.cc,
- * milena/tests/core/sparse_image.cc,
- * milena/tests/display/save_and_show.cc,
- * milena/tests/display/show.cc,
- * milena/tests/fun/x2x/rotation.cc,
- * milena/tests/io/fits/fits.cc,
- * milena/tests/io/pbm/pbm.cc,
- * milena/tests/io/pgm/pgm.cc,
- * milena/tests/io/pgm/pgm16.cc,
- * milena/tests/io/pgm/pgm19.cc,
- * milena/tests/io/pgm/pgm27.cc,
- * milena/tests/io/ppm/ppm.cc,
- * milena/tests/io/ppm/ppm16.cc,
- * milena/tests/io/ppm/ppm23.cc,
- * milena/tests/labeling/background.cc,
- * milena/tests/labeling/blobs.cc,
- * milena/tests/labeling/flat_zones.cc,
- * milena/tests/labeling/foreground.cc,
- * milena/tests/labeling/level.cc,
- * milena/tests/labeling/regional_maxima.cc,
- * milena/tests/labeling/regional_minima.cc,
- * milena/tests/level/approx/median.cc,
- * milena/tests/level/median.cc,
- * milena/tests/level/median_dir.cc,
- * milena/tests/level/median_fast.cc,
- * milena/tests/level/median_hline2d.cc,
- * milena/tests/level/naive/median.cc,
- * milena/tests/line_convolve.cc,
- * milena/tests/linear_convolve.cc,
- * milena/tests/linear_gaussian.cc,
- * milena/tests/linear_lap.cc,
- * milena/tests/linear_log.cc,
- * milena/tests/plain.cc:
- Use tests/data.hh to get the path to the img/ directory.
- * milena/tests/level/Makefile.am (SUBDIRS): New.
- Add approx and naive.
- * milena/tests/level/approx/Makefile.am
- (check_PROGRAMS, median_SOURCES, TESTS): New.
- * milena/tests/level/naive/Makefile.am: Likewise.
-
- * milena/tests/fi_adaptor.cc,
- * milena/tests/fun/x2x/composed.cc,
- * milena/tests/seed2tiling.cc,
- * milena/tests/trait_op_plus.cc,
- * milena/tests/util/branch_iter.cc,
- * milena/tests/util/branch_iter_ind.cc,
- * milena/tests/value/quat.cc,
- * milena/tests/win/backdiag2d.cc,
- * milena/tests/win/cube3d.cc,
- * milena/tests/win/diag2d.cc,
- * milena/tests/win/disk2d.cc,
- * milena/tests/win/hline2d.cc,
- * milena/tests/win/octagon2d.cc,
- * milena/tests/win/vline2d.cc:
- Wrap long lines.
-
-2008-01-08 Roland Levillain <roland(a)lrde.epita.fr>
-
* configure.ac: Configure milena/tests/data.hh.
2007-12-04 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
1
0
1642: Get rid of hard-coded paths to input images in remaining tests.
by Roland Levillain 08 Jan '08
by Roland Levillain 08 Jan '08
08 Jan '08
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Get rid of hard-coded paths to input images in remaining tests.
* milena/tests/core/mono_obased_rle_image.cc,
* milena/tests/core/mono_rle_image.cc,
* milena/tests/core/obased_rle_image.cc,
* milena/tests/core/rle_image.cc,
* milena/tests/core/sparse_image.cc,
* milena/tests/display/save_and_show.cc,
* milena/tests/display/show.cc,
* milena/tests/fun/x2x/rotation.cc,
* milena/tests/io/fits/fits.cc,
* milena/tests/io/pbm/pbm.cc,
* milena/tests/io/pgm/pgm.cc,
* milena/tests/io/pgm/pgm16.cc,
* milena/tests/io/pgm/pgm19.cc,
* milena/tests/io/pgm/pgm27.cc,
* milena/tests/io/ppm/ppm.cc,
* milena/tests/io/ppm/ppm16.cc,
* milena/tests/io/ppm/ppm23.cc,
* milena/tests/labeling/background.cc,
* milena/tests/labeling/blobs.cc,
* milena/tests/labeling/flat_zones.cc,
* milena/tests/labeling/foreground.cc,
* milena/tests/labeling/level.cc,
* milena/tests/labeling/regional_maxima.cc,
* milena/tests/labeling/regional_minima.cc,
* milena/tests/level/approx/median.cc,
* milena/tests/level/median.cc,
* milena/tests/level/median_dir.cc,
* milena/tests/level/median_fast.cc,
* milena/tests/level/median_hline2d.cc,
* milena/tests/level/naive/median.cc,
* milena/tests/line_convolve.cc,
* milena/tests/linear_convolve.cc,
* milena/tests/linear_gaussian.cc,
* milena/tests/linear_lap.cc,
* milena/tests/linear_log.cc,
* milena/tests/plain.cc:
Use tests/data.hh to get the path to the img/ directory.
* milena/tests/level/Makefile.am (SUBDIRS): New.
Add approx and naive.
* milena/tests/level/approx/Makefile.am
(check_PROGRAMS, median_SOURCES, TESTS): New.
* milena/tests/level/naive/Makefile.am: Likewise.
* milena/tests/fi_adaptor.cc,
* milena/tests/fun/x2x/composed.cc,
* milena/tests/seed2tiling.cc,
* milena/tests/trait_op_plus.cc,
* milena/tests/util/branch_iter.cc,
* milena/tests/util/branch_iter_ind.cc,
* milena/tests/value/quat.cc,
* milena/tests/win/backdiag2d.cc,
* milena/tests/win/cube3d.cc,
* milena/tests/win/diag2d.cc,
* milena/tests/win/disk2d.cc,
* milena/tests/win/hline2d.cc,
* milena/tests/win/octagon2d.cc,
* milena/tests/win/vline2d.cc:
Wrap long lines.
core/mono_obased_rle_image.cc | 18 ++++++++++--------
core/mono_rle_image.cc | 16 +++++++++++-----
core/obased_rle_image.cc | 18 ++++++++++--------
core/rle_image.cc | 16 ++++++++++------
core/sparse_image.cc | 17 +++++++++++------
core/t_image.cc | 4 +++-
display/save_and_show.cc | 7 +++++--
display/show.cc | 6 ++++--
fi_adaptor.cc | 15 +++++++--------
fun/x2x/composed.cc | 9 ++++++---
fun/x2x/rotation.cc | 8 +++++---
io/fits/fits.cc | 17 ++++++-----------
io/pbm/pbm.cc | 6 ++++--
io/pgm/pgm.cc | 20 ++++++++------------
io/pgm/pgm16.cc | 17 ++++++++---------
io/pgm/pgm19.cc | 17 +++++++----------
io/pgm/pgm27.cc | 12 +++++-------
io/ppm/ppm.cc | 6 +++---
io/ppm/ppm16.cc | 29 ++++++++++++++---------------
io/ppm/ppm23.cc | 13 +++++++------
labeling/background.cc | 6 ++++--
labeling/blobs.cc | 6 ++++--
labeling/flat_zones.cc | 6 ++++--
labeling/foreground.cc | 6 ++++--
labeling/level.cc | 9 ++++++---
labeling/regional_maxima.cc | 6 ++++--
labeling/regional_minima.cc | 6 ++++--
level/Makefile.am | 2 ++
level/approx/Makefile.am | 7 +++++++
level/approx/median.cc | 8 ++++----
level/median.cc | 6 +++---
level/median_dir.cc | 6 ++++--
level/median_fast.cc | 7 +++++--
level/median_hline2d.cc | 6 +++---
level/naive/Makefile.am | 7 +++++++
level/naive/median.cc | 10 ++++++----
level/stretch_full.cc | 2 +-
line_convolve.cc | 6 ++++--
linear_convolve.cc | 10 ++++++----
linear_gaussian.cc | 8 ++++++--
linear_lap.cc | 7 +++++--
linear_log.cc | 9 +++++++--
main.cc | 2 ++
plain.cc | 9 ++++++---
seed2tiling.cc | 8 ++++++--
test_positive.cc | 1 +
trait_op_plus.cc | 3 ++-
trait_op_uminus.cc | 3 +++
trait_super.cc | 2 +-
util/branch_iter.cc | 3 ++-
util/branch_iter_ind.cc | 3 ++-
value/builtin.cc | 2 ++
value/float01.cc | 2 ++
value/graylevel.cc | 6 +++---
value/graylevel_full.cc | 2 +-
value/int_s16.cc | 2 ++
value/int_u8.cc | 2 ++
value/interop.cc | 2 +-
value/quat.cc | 3 ++-
value/rgb8.cc | 2 +-
value/scalar.cc | 3 +++
value/set.cc | 1 +
win/backdiag2d.cc | 7 +++++--
win/cube3d.cc | 6 ++++--
win/diag2d.cc | 6 ++++--
win/disk2d.cc | 7 +++++--
win/hline2d.cc | 7 +++++--
win/octagon2d.cc | 8 ++++++--
win/vline2d.cc | 7 +++++--
window1d.cc | 3 ++-
70 files changed, 325 insertions(+), 204 deletions(-)
Index: milena/tests/window1d.cc
--- milena/tests/window1d.cc (revision 1641)
+++ milena/tests/window1d.cc (working copy)
@@ -46,7 +46,8 @@
mln_assertion(w.is_centered() == false);
mln_assertion(w.is_symmetric() == true);
- // w.insert(-1,0); // Do not compile as expected.
+ // FIXME: Does not compile as expected.
+ // w.insert(-1,0);
w.insert(-1);
w.insert( 1);
Index: milena/tests/linear_log.cc
--- milena/tests/linear_log.cc (revision 1641)
+++ milena/tests/linear_log.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -42,6 +42,8 @@
#include <mln/estim/min_max.hh>
#include <mln/level/stretch.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -50,13 +52,16 @@
border::thickness = 2;
- image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int> tmp(lena.domain());
linear::LoG_5x5(lena, tmp);
{
int min, max;
estim::min_max(tmp, min, max);
+ // FIXME: This assertion fails. (Maybe the input file has been
+ // changed, but this line was not updated?)
mln_assertion(min == -929 && max == 1458);
}
Index: milena/tests/level/median.cc
--- milena/tests/level/median.cc (revision 1641)
+++ milena/tests/level/median.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -39,7 +39,7 @@
#include <mln/value/int_u8.hh>
#include <mln/level/median.hh>
-
+#include "tests/data.hh"
int main()
@@ -51,7 +51,7 @@
border::thickness = 6;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> out(lena.domain());
level::median(lena, rect, out);
Index: milena/tests/level/median_hline2d.cc
--- milena/tests/level/median_hline2d.cc (revision 1641)
+++ milena/tests/level/median_hline2d.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -40,7 +40,7 @@
#include <mln/level/median.hh>
#include <mln/level/compare.hh>
-
+#include "tests/data.hh"
int main()
@@ -51,7 +51,7 @@
border::thickness = 0;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8>
out(lena.domain()),
ref(lena.domain());
Index: milena/tests/level/median_fast.cc
--- milena/tests/level/median_fast.cc (revision 1641)
+++ milena/tests/level/median_fast.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,6 +44,8 @@
#include <mln/core/dpoints_pixter.hh>
#include <mln/core/pixel.hh>
+#include "tests/data.hh"
+
namespace mln
{
@@ -79,6 +81,7 @@
using namespace mln;
using value::int_u8;
+ // FIXME: Dead code.
// {
// win::rectangle2d rect(3, 3);
// border::thickness = 4;
@@ -94,7 +97,7 @@
border::thickness = 52;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> out(lena.domain());
level::fast_median(lena, rect, out);
Index: milena/tests/level/approx/median.cc
--- milena/tests/level/approx/median.cc (revision 1641)
+++ milena/tests/level/approx/median.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -40,7 +40,7 @@
#include <mln/value/int_u8.hh>
#include <mln/level/approx/median.hh>
-
+#include "tests/data.hh"
int main()
@@ -53,10 +53,10 @@
border::thickness = 52;
image2d<int_u8> lena;
-
- io::pgm::load(lena, "../../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> out(lena.domain());
+ // FIXME: Dead code?
// level::approx::median(lena, rect, out);
level::approx::median(lena, oct, out);
io::pgm::save(out, "out.pgm");
Index: milena/tests/level/approx/Makefile.am
--- milena/tests/level/approx/Makefile.am (revision 1641)
+++ milena/tests/level/approx/Makefile.am (working copy)
@@ -1,3 +1,10 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS = \
+ median
+
+median_SOURCES = median.cc
+
+TESTS = $(check_PROGRAMS)
Index: milena/tests/level/median_dir.cc
--- milena/tests/level/median_dir.cc (revision 1641)
+++ milena/tests/level/median_dir.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -38,6 +38,8 @@
#include <mln/value/int_u8.hh>
#include <mln/level/median.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -47,7 +49,7 @@
border::thickness = 7;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> out(lena.domain());
level::median_dir(lena, 1, 15, out);
Index: milena/tests/level/stretch_full.cc
--- milena/tests/level/stretch_full.cc (revision 1641)
+++ milena/tests/level/stretch_full.cc (working copy)
@@ -64,7 +64,7 @@
level::stretch(input, output);
- // FIXME : How test that?
+ // FIXME: How to test that?
}
template <typename I, typename J>
Index: milena/tests/level/naive/median.cc
--- milena/tests/level/naive/median.cc (revision 1641)
+++ milena/tests/level/naive/median.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -39,6 +39,8 @@
#include <mln/value/int_u8.hh>
#include <mln/level/naive/median.hh>
+#include "tests/data.hh"
+
using namespace mln;
using namespace mln::value;
@@ -49,9 +51,9 @@
win::rectangle2d rec(51, 51);
border::thickness = 52;
- image2d<int_u8>
- lena = io::pgm::load("../img/lena.pgm"),
- out(lena.domain());
+ image2d<int_u8> lena;
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ image2d<int_u8> out(lena.domain());
level::naive::median(lena, rec, out);
io::pgm::save(out, "out.pgm");
Index: milena/tests/level/naive/Makefile.am
--- milena/tests/level/naive/Makefile.am (revision 1641)
+++ milena/tests/level/naive/Makefile.am (working copy)
@@ -1,3 +1,10 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
include $(top_srcdir)/milena/tests/tests.mk
+
+check_PROGRAMS = \
+ median
+
+median_SOURCES = median.cc
+
+TESTS = $(check_PROGRAMS)
Index: milena/tests/level/Makefile.am
--- milena/tests/level/Makefile.am (revision 1641)
+++ milena/tests/level/Makefile.am (working copy)
@@ -1,5 +1,7 @@
## Process this file through Automake to create Makefile.in -*- Makefile -*-
+SUBDIRS = approx naive
+
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
Index: milena/tests/main.cc
--- milena/tests/main.cc (revision 1641)
+++ milena/tests/main.cc (working copy)
@@ -25,6 +25,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
+// FIXME: Rename (and possibly move) this file.
+
/*!
* \file tests/main.cc
*
Index: milena/tests/value/set.cc
--- milena/tests/value/set.cc (revision 1641)
+++ milena/tests/value/set.cc (working copy)
@@ -59,6 +59,7 @@
using namespace mln;
test<bool>();
+ // FIXME: Dead code?
// test<unsigned char>();
// test<unsigned short>();
// test<value::int_u8>();
Index: milena/tests/value/graylevel_f.cc
Index: milena/tests/value/rgb8.cc
--- milena/tests/value/rgb8.cc (revision 1641)
+++ milena/tests/value/rgb8.cc (working copy)
@@ -50,7 +50,7 @@
v.blue() = 2;
rgb8 c(0, 1, 2);
- // FIXME: Do not compile because we lack ops!
+ // FIXME: Does not compile because we lack ops!
// mln_sum_(rgb8) sum;
// sum + c;
// c = c + c;
Index: milena/tests/value/scalar.cc
--- milena/tests/value/scalar.cc (revision 1641)
+++ milena/tests/value/scalar.cc (working copy)
@@ -46,6 +46,7 @@
{
namespace trait
{
+ // FIXME: Dead code?
// template <typename O1, typename O2>
// struct set_binary_< op::less, Object,O1, Object,O2 > { typedef bool ret; };
@@ -71,6 +72,7 @@
{
using namespace mln;
+ // FIXME: Dead code?
// int i = 51;
// foo(i);
// foo( value::scalar(i) );
@@ -84,6 +86,7 @@
b = value::scalar(j) < value::scalar(j);
+ // FIXME: Dead code?
// mln_trait_op_less_(value::scalar_< value::int_u8 >, value::scalar_< value::int_u8 >) tmp;
// void* v = tmp;
Index: milena/tests/value/builtin.cc
--- milena/tests/value/builtin.cc (revision 1641)
+++ milena/tests/value/builtin.cc (working copy)
@@ -60,6 +60,7 @@
typedef double ret;
};
+ // FIXME: Dead code?
// template <typename I>
// struct set_unary_< op::test,
// mln::value::Integer, I >
@@ -85,6 +86,7 @@
typedef double ret;
};
+ // FIXME: Dead code?
// template < typename I, typename S >
// struct set_binary_< op::test_2,
// mln::value::Integer, I,
Index: milena/tests/value/float01.cc
--- milena/tests/value/float01.cc (revision 1641)
+++ milena/tests/value/float01.cc (working copy)
@@ -79,6 +79,7 @@
result operator()(float01_<16> v) const
{
result ret = int(v.value() * 255);
+ // FIXME: Dead code.
//std::cout << v << "-> " << ret << std::endl;
return ret;
}
@@ -143,6 +144,7 @@
io::pgm::save(lena, "out.pgm");
io::pgm::save(ref, "ref.pgm");
mln_assertion(lena == ref);
+ // FIXME: Dead code.
//debug::println(out);
}
Index: milena/tests/value/int_u8.cc
--- milena/tests/value/int_u8.cc (revision 1641)
+++ milena/tests/value/int_u8.cc (working copy)
@@ -65,6 +65,7 @@
sym_compare_assert(3.0f, ==, i);
sym_compare_assert(i, !=, 2.99f);
+ // FIXME: Is this an incorrect behavior or what?
// Error at run-time as expected :-)
// i = 256;
// i = -1;
@@ -159,6 +160,7 @@
i *= d;
sym_compare_assert(i, ==, 0.f);
+ // FIXME: Is this an incorrect behavior or what?
// Error at run-time as expected :-)
// i = 128;
// i *= 2;
Index: milena/tests/value/quat.cc
--- milena/tests/value/quat.cc (revision 1641)
+++ milena/tests/value/quat.cc (working copy)
@@ -66,7 +66,8 @@
std::cout << q2.conj() << std::endl;
std::cout << q2.inv() << std::endl;
- std::cout << norm::l2(q2.to_vec()) << ' ' << norm::l2(q2.inv().to_vec()) << std::endl;
+ std::cout << norm::l2(q2.to_vec()) << ' '<< norm::l2(q2.inv().to_vec())
+ << std::endl;
std::cout << q2.inv().inv() << std::endl;
}
Index: milena/tests/value/graylevel_full.cc
--- milena/tests/value/graylevel_full.cc (revision 1641)
+++ milena/tests/value/graylevel_full.cc (working copy)
@@ -80,7 +80,7 @@
mln_assertion(f == g);
mln_assertion(h == g);
- // FIXME : make the following tests compile.
+ // FIXME: Make the following tests compile.
{
// With gray_f.
//gl8 a = mln::value::internal::gray_f(12.5);
Index: milena/tests/value/interop.cc
--- milena/tests/value/interop.cc (revision 1641)
+++ milena/tests/value/interop.cc (working copy)
@@ -52,7 +52,7 @@
using value::int_s8;
-
+ // FIXME: Dead code?
// {
// // Operations on int_u<n>
// int_u8 i = 128;
Index: milena/tests/value/int_s16.cc
--- milena/tests/value/int_s16.cc (revision 1641)
+++ milena/tests/value/int_s16.cc (working copy)
@@ -89,6 +89,7 @@
mln_assertion(3.0f == i);
mln_assertion(i != 2.99f);
+ // FIXME: Is this an incorrect behavior or what?
// Error at run-time as expected :-)
// i = 256;
// i = -1;
@@ -176,6 +177,7 @@
i *= d;
mln_assertion(i == 0);
+ // FIXME: Is this an incorrect behavior or what?
// Error at run-time as expected :-)
// i = 128;
// i *= 2;
Index: milena/tests/value/graylevel.cc
--- milena/tests/value/graylevel.cc (revision 1641)
+++ milena/tests/value/graylevel.cc (working copy)
@@ -46,7 +46,7 @@
-// FIXME : make a more explicit error message.
+// FIXME: Give a more explicit error message.
// template <typename T>
// void foo()
// {
@@ -72,7 +72,7 @@
using mln::literal::black;
- // FIXME : make all the test pass.
+ // FIXME: Make all the test pass.
gl8 a(white);
gl8 b(white);
@@ -151,7 +151,7 @@
}
{
- // FIXME : comparaison with literals doesn't work
+ // FIXME: comparison with literals doesn't work
// c = a;
// mln_assertion(c == white);
Index: milena/tests/win/backdiag2d.cc
--- milena/tests/win/backdiag2d.cc (revision 1641)
+++ milena/tests/win/backdiag2d.cc (working copy)
@@ -50,8 +50,11 @@
for (int x = -5; x <= 5; ++x)
for (int y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 4) && (abs(y) <= 4)) || !diag.has(dpoint2d(y, x)));
- mln_assertion((x == y) == (diag.has(dpoint2d(y, x))) || abs(x) > 4 || abs(y) > 4);
+ mln_assertion(((abs(x) <= 4) && (abs(y) <= 4)) ||
+ !diag.has(dpoint2d(y, x)));
+ mln_assertion((x == y) == (diag.has(dpoint2d(y, x))) ||
+ abs(x) > 4 ||
+ abs(y) > 4);
}
debug::println(convert::to_image(diag));
Index: milena/tests/win/disk2d.cc
--- milena/tests/win/disk2d.cc (revision 1641)
+++ milena/tests/win/disk2d.cc (working copy)
@@ -51,8 +51,11 @@
for (int x = -30; x <= 30; ++x)
for (int y = -30; y <= 30; ++y)
{
- mln_assertion(((abs(x) <= 27) && (abs(y) <= 27)) || !disk.has(dpoint2d(y, x)));
- mln_assertion(((x * x + y * y) <= l2) == (disk.has(dpoint2d(y, x))) || abs(x) > 27 || abs(y) > 27);
+ mln_assertion(((abs(x) <= 27) && (abs(y) <= 27)) ||
+ !disk.has(dpoint2d(y, x)));
+ mln_assertion(((x * x + y * y) <= l2) == (disk.has(dpoint2d(y, x))) ||
+ abs(x) > 27 ||
+ abs(y) > 27);
}
debug::println(convert::to_image(disk));
Index: milena/tests/win/octagon2d.cc
--- milena/tests/win/octagon2d.cc (revision 1641)
+++ milena/tests/win/octagon2d.cc (working copy)
@@ -50,8 +50,12 @@
for (int x = -16; x <= 16; ++x)
for (int y = -16; y <= 16; ++y)
{
- mln_assertion(((abs(x) <= 6) && (abs(y) <= 6)) || !oct.has(dpoint2d(y, x)));
- mln_assertion((abs(x) + abs(y) <= l / 2 + l / 6) == (oct.has(dpoint2d(y, x))) || abs(x) > 2 || abs(y) > 2);
+ mln_assertion(((abs(x) <= 6) && (abs(y) <= 6)) ||
+ !oct.has(dpoint2d(y, x)));
+ mln_assertion((abs(x) + abs(y) <= l / 2 + l / 6) ==
+ (oct.has(dpoint2d(y, x))) ||
+ abs(x) > 2 ||
+ abs(y) > 2);
}
debug::println(convert::to_image(oct));
Index: milena/tests/win/vline2d.cc
--- milena/tests/win/vline2d.cc (revision 1641)
+++ milena/tests/win/vline2d.cc (working copy)
@@ -50,8 +50,11 @@
for (int x = -5; x <= 5; ++x)
for (int y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) || !vline.has(dpoint2d(x, y)));
- mln_assertion((0 == x) == (vline.has(dpoint2d(y, x))) || abs(x) > 2 || abs(y) > 2);
+ mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) ||
+ !vline.has(dpoint2d(x, y)));
+ mln_assertion((0 == x) == (vline.has(dpoint2d(y, x))) ||
+ abs(x) > 2 ||
+ abs(y) > 2);
}
debug::println(convert::to_image(vline));
Index: milena/tests/win/cube3d.cc
--- milena/tests/win/cube3d.cc (revision 1641)
+++ milena/tests/win/cube3d.cc (working copy)
@@ -51,8 +51,10 @@
for (int y = -5; y <= 5; ++y)
for (int z = -5; z <= 5; ++z)
{
- mln_assertion(((abs(x) <= 2) && (abs(y) <= 2) && (abs(z) <= 2)) || !cube.has(dpoint3d(z, y, x)));
- mln_assertion((abs(x) <= 2 && abs(y) <= 2 && abs(z) <= 2) == (cube.has(dpoint3d(z, y, x))));
+ mln_assertion(((abs(x) <= 2) && (abs(y) <= 2) && (abs(z) <= 2)) ||
+ !cube.has(dpoint3d(z, y, x)));
+ mln_assertion((abs(x) <= 2 && abs(y) <= 2 && abs(z) <= 2) ==
+ (cube.has(dpoint3d(z, y, x))));
}
debug::println(convert::to_image(cube));
Index: milena/tests/win/hline2d.cc
--- milena/tests/win/hline2d.cc (revision 1641)
+++ milena/tests/win/hline2d.cc (working copy)
@@ -50,8 +50,11 @@
for (int x = -5; x <= 5; ++x)
for (int y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) || !hline.has(dpoint2d(x, y)));
- mln_assertion((0 == y) == (hline.has(dpoint2d(y, x))) || abs(x) > 2 || abs(y) > 2);
+ mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) ||
+ !hline.has(dpoint2d(x, y)));
+ mln_assertion((0 == y) == (hline.has(dpoint2d(y, x))) ||
+ abs(x) > 2 ||
+ abs(y) > 2);
}
debug::println(convert::to_image(hline));
Index: milena/tests/win/diag2d.cc
--- milena/tests/win/diag2d.cc (revision 1641)
+++ milena/tests/win/diag2d.cc (working copy)
@@ -50,7 +50,8 @@
for (int x = -5; x <= 5; ++x)
for (int y = -5; y <= 5; ++y)
{
- mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) || !diag.has(dpoint2d(y, x)));
+ mln_assertion(((abs(x) <= 2) && (abs(y) <= 2)) ||
+ !diag.has(dpoint2d(y, x)));
std::cout << "x = "
<< x
<< ", y = "
@@ -58,7 +59,8 @@
<< " : "
<< ((diag.has(dpoint2d(x, y))) ? "VRAI" : "FAUX")
<< std::endl;
- mln_assertion((x == -y) == (diag.has(dpoint2d(y, x))) || abs(x) > 2 || abs(y) > 2);
+ mln_assertion((x == -y) ==
+ (diag.has(dpoint2d(y, x))) || abs(x) > 2 || abs(y) > 2);
}
debug::println(convert::to_image(diag));
Index: milena/tests/display/show.cc
--- milena/tests/display/show.cc (revision 1641)
+++ milena/tests/display/show.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -45,6 +45,8 @@
# include <mln/display/color_pretty.hh>
# include <mln/io/ppm/save.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -53,7 +55,7 @@
unsigned max = 51;
- image2d<bool> input = io::pbm::load("../../img/toto.pbm");
+ image2d<bool> input = io::pbm::load(MLN_IMG_DIR "/toto.pbm");
// Create a weighted windows :
// 0 2 0
Index: milena/tests/display/save_and_show.cc
--- milena/tests/display/save_and_show.cc (revision 1641)
+++ milena/tests/display/save_and_show.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,13 +44,16 @@
# include <mln/display/save_and_show.hh>
# include <mln/level/fill.hh>
+#include "tests/data.hh"
+
+
int main()
{
using namespace mln;
unsigned max = 51;
- image2d<bool> input = io::pbm::load("../../img/toto.pbm");
+ image2d<bool> input = io::pbm::load(MLN_IMG_DIR "/toto.pbm");
// Create a weighted windows :
// 0 2 0
Index: milena/tests/util/branch_iter.cc
--- milena/tests/util/branch_iter.cc (revision 1641)
+++ milena/tests/util/branch_iter.cc (working copy)
@@ -46,7 +46,8 @@
util::node<int>* g = f->add_child(31);
f->add_child(32);
- g->add_child(41)->add_child(51)->add_child(61)->add_child(71)->add_child(81)->add_child(91);
+ g->add_child(41)->add_child(51)->add_child(61)->add_child(71)
+ ->add_child(81)->add_child(91);
g->add_child(42);
f->add_child(33);
f->add_child(34);
Index: milena/tests/util/branch_iter_ind.cc
--- milena/tests/util/branch_iter_ind.cc (revision 1641)
+++ milena/tests/util/branch_iter_ind.cc (working copy)
@@ -46,7 +46,8 @@
util::node<int>* g = f->add_child(31);
f->add_child(32);
- g->add_child(41)->add_child(51)->add_child(61)->add_child(71)->add_child(81)->add_child(91);
+ g->add_child(41)->add_child(51)->add_child(61)->add_child(71)
+ ->add_child(81)->add_child(91);
g->add_child(42);
f->add_child(33);
f->add_child(34);
Index: milena/tests/labeling/regional_maxima.cc
--- milena/tests/labeling/regional_maxima.cc (revision 1641)
+++ milena/tests/labeling/regional_maxima.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -36,13 +36,15 @@
#include <mln/io/pgm/load.hh>
#include <mln/labeling/regional_maxima.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
using value::int_u8;
- image2d<int_u8> lena = io::pgm::load<int_u8>("../../img/tiny.pgm");
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/tiny.pgm");
unsigned n;
labeling::regional_maxima(lena, c4(), n);
Index: milena/tests/labeling/background.cc
--- milena/tests/labeling/background.cc (revision 1641)
+++ milena/tests/labeling/background.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -36,12 +36,14 @@
#include <mln/labeling/background.hh>
#include <mln/logical/not.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
- image2d<bool> pic = io::pbm::load("../../img/picasso.pbm");
+ image2d<bool> pic = io::pbm::load(MLN_IMG_DIR "/picasso.pbm");
unsigned n;
labeling::background(logical::not_(pic), c4(), n);
mln_assertion(n == 33);
Index: milena/tests/labeling/blobs.cc
--- milena/tests/labeling/blobs.cc (revision 1641)
+++ milena/tests/labeling/blobs.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -35,12 +35,14 @@
#include <mln/core/neighb2d.hh>
#include <mln/labeling/blobs.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
- image2d<bool> pic = io::pbm::load("../../img/picasso.pbm");
+ image2d<bool> pic = io::pbm::load(MLN_IMG_DIR "/picasso.pbm");
unsigned n;
labeling::blobs(pic, c4(), n);
mln_assertion(n == 33);
Index: milena/tests/labeling/flat_zones.cc
--- milena/tests/labeling/flat_zones.cc (revision 1641)
+++ milena/tests/labeling/flat_zones.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -39,13 +39,15 @@
#include <mln/labeling/blobs.hh>
#include <mln/pw/all.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
using value::int_u8;
- image2d<int_u8> lena = io::pgm::load<int_u8>("../../img/tiny.pgm");
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/tiny.pgm");
unsigned n;
image2d<unsigned> labels = labeling::flat_zones(lena, c4(), n);
Index: milena/tests/labeling/level.cc
--- milena/tests/labeling/level.cc (revision 1641)
+++ milena/tests/labeling/level.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,20 +44,23 @@
#include <mln/debug/println.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
using value::int_u8;
- image2d<int_u8> lena = io::pgm::load<int_u8>("../../img/tiny.pgm");
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/tiny.pgm");
image2d<bool> lvl(lena.domain());
unsigned n, npixels = 0;
for (unsigned l = 0; l <= 255; ++l)
{
image2d<unsigned> labels = labeling::level(lena, l, c4(), n);
- unsigned npix = accu::compute< accu::count >(labels | (pw::value(labels) != pw::cst(0)));
+ unsigned npix =
+ accu::compute<accu::count>(labels | (pw::value(labels) != pw::cst(0)));
npixels += npix;
}
mln_assertion(npixels == lena.npoints());
Index: milena/tests/labeling/foreground.cc
--- milena/tests/labeling/foreground.cc (revision 1641)
+++ milena/tests/labeling/foreground.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -35,12 +35,14 @@
#include <mln/core/neighb2d.hh>
#include <mln/labeling/foreground.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
- image2d<bool> pic = io::pbm::load("../../img/picasso.pbm");
+ image2d<bool> pic = io::pbm::load(MLN_IMG_DIR "/picasso.pbm");
unsigned n;
labeling::foreground(pic, c4(), n);
mln_assertion(n == 33);
Index: milena/tests/labeling/regional_minima.cc
--- milena/tests/labeling/regional_minima.cc (revision 1641)
+++ milena/tests/labeling/regional_minima.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -37,13 +37,15 @@
#include <mln/pw/all.hh>
#include <mln/labeling/regional_minima.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
using value::int_u8;
- image2d<int_u8> lena = io::pgm::load<int_u8>("../../img/tiny.pgm");
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/tiny.pgm");
unsigned n;
labeling::regional_minima((pw::cst(255) - pw::value(lena)) | lena.domain(),
Index: milena/tests/trait_super.cc
--- milena/tests/trait_super.cc (revision 1641)
+++ milena/tests/trait_super.cc (working copy)
@@ -89,7 +89,7 @@
void is_test() {}
};
-
+ // FIXME: Dead code?
// template <typename I>
// void foo(const Integer<I>&)
// {
Index: milena/tests/plain.cc
--- milena/tests/plain.cc (revision 1641)
+++ milena/tests/plain.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -39,14 +39,17 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
+#include "tests/data.hh"
+
+
int main()
{
using namespace mln;
using value::int_u8;
{
- plain< image2d<int_u8> >
- lena = io::pgm::load<int_u8>("../img/lena.pgm");
+ plain< image2d<int_u8> > lena
+ = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> ima;
image2d<int_u8> ima2;
Index: milena/tests/core/sparse_image.cc
--- milena/tests/core/sparse_image.cc (revision 1641)
+++ milena/tests/core/sparse_image.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,6 +44,9 @@
#include <mln/core/sparse_encode.hh>
+#include "tests/data.hh"
+
+
struct fold_t : public mln::Function_v2v< fold_t >
{
typedef mln::value::int_u8 result;
@@ -51,23 +54,25 @@
};
-
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/small.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/small.pgm");
image2d<int_u8> cmp(lena.domain());
unsigned n;
- image2d<unsigned> labels = labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
+ image2d<unsigned> labels =
+ labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
c4(), n);
- sparse_image<point2d, int_u8> sparse = sparse_encode(level::transform(labels, fold_t()));
+ sparse_image<point2d, int_u8> sparse =
+ sparse_encode(level::transform(labels, fold_t()));
- std::cout << n << ", compression :" << sparse.compression() << std::endl;
+ std::cout << n << ", compression ratio: " << sparse.compression()
+ << std::endl;
level::fill(cmp, literal::zero);
level::paste(sparse, cmp);
Index: milena/tests/core/obased_rle_image.cc
--- milena/tests/core/obased_rle_image.cc (revision 1641)
+++ milena/tests/core/obased_rle_image.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,6 +44,9 @@
#include <mln/core/obased_rle_encode.hh>
+#include "tests/data.hh"
+
+
struct fold_t : public mln::Function_v2v< fold_t >
{
typedef mln::value::int_u8 result;
@@ -51,25 +54,24 @@
};
-
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/small.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/small.pgm");
image2d<int_u8> cmp(lena.domain());
unsigned n;
- image2d<unsigned>
- labels = labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
+ image2d<unsigned> labels =
+ labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
c4(), n);
- obased_rle_image<point2d, int_u8>
- rle = obased_rle_encode(level::transform(labels, fold_t()));
+ obased_rle_image<point2d, int_u8> rle =
+ obased_rle_encode(level::transform(labels, fold_t()));
- std::cout << n << ", compression :" << rle.compression() << std::endl;
+ std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
level::fill(cmp, literal::zero);
level::paste(rle, cmp);
Index: milena/tests/core/t_image.cc
--- milena/tests/core/t_image.cc (revision 1641)
+++ milena/tests/core/t_image.cc (working copy)
@@ -36,7 +36,6 @@
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
-
int main()
{
using namespace mln;
@@ -49,4 +48,7 @@
t_image<I> t_ima(ima, 0, 1);
debug::println(t_ima);
+
+ // FIXME: Enrich this test (exercise more features and write
+ // assertions).
}
Index: milena/tests/core/mono_rle_image.cc
--- milena/tests/core/mono_rle_image.cc (revision 1641)
+++ milena/tests/core/mono_rle_image.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,6 +44,9 @@
#include <mln/core/mono_rle_encode.hh>
+#include "tests/data.hh"
+
+
struct fold_t : public mln::Function_v2v< fold_t >
{
typedef mln::value::int_u8 result;
@@ -56,22 +59,25 @@
result operator()(unsigned i) const { return i == 2 ? 2 : 0; }
};
+
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/small.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/small.pgm");
image2d<int_u8> cmp(lena.domain());
unsigned n;
- image2d<unsigned> labels = labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
+ image2d<unsigned> labels =
+ labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
c4(), n);
- mono_rle_image<point2d, int_u8> rle = mono_rle_encode(level::transform(labels, fold_t()), 2);
+ mono_rle_image<point2d, int_u8> rle =
+ mono_rle_encode(level::transform(labels, fold_t()), 2);
- std::cout << n << ", compression :" << rle.compression() << std::endl;
+ std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
level::fill(cmp, literal::zero);
level::paste(rle, cmp);
Index: milena/tests/core/rle_image.cc
--- milena/tests/core/rle_image.cc (revision 1641)
+++ milena/tests/core/rle_image.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,6 +44,9 @@
#include <mln/core/rle_encode.hh>
+#include "tests/data.hh"
+
+
struct fold_t : public mln::Function_v2v< fold_t >
{
typedef mln::value::int_u8 result;
@@ -51,23 +54,24 @@
};
-
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/small.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/small.pgm");
image2d<int_u8> cmp(lena.domain());
unsigned n;
- image2d<unsigned> labels = labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
+ image2d<unsigned> labels =
+ labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
c4(), n);
- rle_image<point2d, int_u8> rle = rle_encode(level::transform(labels, fold_t()));
+ rle_image<point2d, int_u8> rle =
+ rle_encode(level::transform(labels, fold_t()));
- std::cout << n << ", compression :" << rle.compression() << std::endl;
+ std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
level::fill(cmp, literal::zero);
level::paste(rle, cmp);
Index: milena/tests/core/mono_obased_rle_image.cc
--- milena/tests/core/mono_obased_rle_image.cc (revision 1641)
+++ milena/tests/core/mono_obased_rle_image.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -44,6 +44,9 @@
#include <mln/core/mono_obased_rle_encode.hh>
+#include "tests/data.hh"
+
+
struct fold_t : public mln::Function_v2v< fold_t >
{
typedef mln::value::int_u8 result;
@@ -51,25 +54,24 @@
};
-
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/small.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/small.pgm");
image2d<int_u8> cmp(lena.domain());
unsigned n;
- image2d<unsigned>
- labels = labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
+ image2d<unsigned> labels =
+ labeling::blobs((pw::value(lena) > pw::cst(172u)) | lena.domain(),
c4(), n);
- mono_obased_rle_image<point2d, int_u8>
- rle = mono_obased_rle_encode(level::transform(labels, fold_t()));
+ mono_obased_rle_image<point2d, int_u8> rle =
+ mono_obased_rle_encode(level::transform(labels, fold_t()));
- std::cout << n << ", compression :" << rle.compression() << std::endl;
+ std::cout << n << ", compression ratio: " << rle.compression() << std::endl;
level::fill(cmp, literal::zero);
level::paste(rle, cmp);
Index: milena/tests/fi_adaptor.cc
--- milena/tests/fi_adaptor.cc (revision 1641)
+++ milena/tests/fi_adaptor.cc (working copy)
@@ -56,12 +56,12 @@
using typename value::rgb8;
{
- // FIXME:
- // Under Linux or under any *nix OS (i.e. under Unix or MacOSX), you need to call
- // FreeImage_Initialise at the beginning of your main function and you need to call
- // FreeImage_DeInitialise at the end of this main function (this is not needed when
- // using FreeImage as a .SO).
-
+ /* FIXME: Under GNU/Linux or under any *nix OS (i.e. under Unix or
+ Mac OS X), you need to call FreeImage_Initialise at the
+ beginning of your main function and you need to call
+ FreeImage_DeInitialise at the end of this main function (this
+ is not needed when using FreeImage as a shared library
+ (*.so)). */
//FreeImage_Initialise();
win::rectangle2d rect(51, 51);
@@ -82,8 +82,7 @@
display::show (adaptor, "xv");
// FIXME: Likewise.
- /*
- Check if this statement holds in our case. Maybe we need to
+ /* Check if this statement holds in our case. Maybe we need to
involve Libtool in to handle FreeImagePlus properly. */
//FreeImage_DeInitialise();
}
Index: milena/tests/seed2tiling.cc
--- milena/tests/seed2tiling.cc (revision 1641)
+++ milena/tests/seed2tiling.cc (working copy)
@@ -55,11 +55,15 @@
#include <mln/core/w_window2d_int.hh>
#include <mln/make/win_chamfer.hh>
-int main(int argc, char** argv)
+int main(int argc, char* argv[])
{
+ // FIXME: A test should not be interactive. Maybe this program
+ // should be moved elsewehere.
if (argc < 2)
{
- std::cerr << "missing argument : specify the location of the binary image (*.pbm)" << std::endl;
+ std::cerr << "missing argument: "
+ << "specify the location of the binary image (*.pbm)"
+ << std::endl;
return 1;
}
using namespace mln;
Index: milena/tests/trait_op_uminus.cc
--- milena/tests/trait_op_uminus.cc (revision 1641)
+++ milena/tests/trait_op_uminus.cc (working copy)
@@ -78,6 +78,7 @@
namespace trait
{
+ // FIXME: Dead code?
// template <>
// struct p_setrecise_unary_< op::uminus, test >
// {
@@ -105,6 +106,8 @@
{
using namespace mln;
+ // FIXME: Dead code?
+
// {
// mln_trait_op_uminus_(test) tmp; /* bool if precise */
// bool* b = &tmp;
Index: milena/tests/trait_op_plus.cc
--- milena/tests/trait_op_plus.cc (revision 1641)
+++ milena/tests/trait_op_plus.cc (working copy)
@@ -67,7 +67,8 @@
typedef bool ret;
};
- // precise definition: my_image2d<T> + my_image2d<U> -> my_image2d<V> ('&' is to avoid compiling an empty class)
+ // precise definition: my_image2d<T> + my_image2d<U> -> my_image2d<V>
+ // ('&' is to avoid compiling an empty class)
template <typename T, typename U>
struct set_precise_binary_< op::plus, my_image2d<T>, my_image2d<U> >
Index: milena/tests/linear_convolve.cc
--- milena/tests/linear_convolve.cc (revision 1641)
+++ milena/tests/linear_convolve.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -42,6 +42,8 @@
#include <mln/border/thickness.hh>
#include <mln/linear/convolve.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -50,9 +52,9 @@
border::thickness = 2;
- image2d<int_u8>
- lena = io::pgm::load("../img/lena.pgm"),
- out(lena.domain());
+ image2d<int_u8> lena;
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
+ image2d<int_u8> out(lena.domain());
float ws[] = { .04, .04, .04, .04, .04,
.04, .04, .04, .04, .04,
Index: milena/tests/test_positive.cc
--- milena/tests/test_positive.cc (revision 1641)
+++ milena/tests/test_positive.cc (working copy)
@@ -59,6 +59,7 @@
test_v2b(fun::v2v::id<mln_value_(I)>() >= pw::cst(0));
+ // FIXME: Dead code?
// test2(fun::v2v::id<mln_value_(I)>() >= pw::cst(0));
// test::positive(ima);
}
Index: milena/tests/line_convolve.cc
--- milena/tests/line_convolve.cc (revision 1641)
+++ milena/tests/line_convolve.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -42,6 +42,8 @@
#include <mln/border/thickness.hh>
#include <mln/linear/line_convolve.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -51,7 +53,7 @@
border::thickness = 4;
image2d<int_u8>
- lena = io::pgm::load("../img/lena.pgm"),
+ lena = io::pgm::load(MLN_IMG_DIR "/lena.pgm"),
out(lena.domain());
image2d<float> tmp(lena.domain());
Index: milena/tests/fun/x2x/rotation.cc
--- milena/tests/fun/x2x/rotation.cc (revision 1641)
+++ milena/tests/fun/x2x/rotation.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -30,7 +30,6 @@
* \brief Tests on mln::fun::x2x::rotation.
*/
-
#include <iostream>
#include <mln/fun/x2x/rotation.hh>
#include <mln/core/image2d.hh>
@@ -40,13 +39,16 @@
#include <mln/core/interpolated.hh>
#include <mln/make/vec.hh>
+#include "tests/data.hh"
+
+
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> out(lena.domain());
interpolated<image2d<int_u8> > inter(lena);
Index: milena/tests/fun/x2x/composed.cc
--- milena/tests/fun/x2x/composed.cc (revision 1641)
+++ milena/tests/fun/x2x/composed.cc (working copy)
@@ -56,10 +56,13 @@
std::cout << "tr(vec) : " << tr(vec1) << std::endl;
std::cout << "rot(vec) : " << rot(vec1) << std::endl;
std::cout << "tr(rot(vec)) : " << compose(tr, rot)(vec1) << std::endl;
- std::cout << "rot(rot_1(vec)) : " << compose(rot, rot.inv())(vec1) << std::endl;
- std::cout << "tr(rot(tr(vec))) : " << compose(tr, compose(rot, tr))(vec1) << std::endl;
+ std::cout << "rot(rot_1(vec)) : " << compose(rot, rot.inv())(vec1)
+ << std::endl;
+ std::cout << "tr(rot(tr(vec))) : " << compose(tr, compose(rot, tr))(vec1)
+ << std::endl;
std::cout << "(rototr_1)(rot(tr(vec)))) : "
- << compose(compose(rot, tr).inv(), compose(rot, tr))(vec1) << std::endl;
+ << compose(compose(rot, tr).inv(), compose(rot, tr))(vec1)
+ << std::endl;
mln_assertion(fabs(compose(rot, tr)(vec1)[0] - rot(tr(vec1))[0]) <= 0.125);
mln_assertion(fabs(compose(rot, tr)(vec1)[1] - rot(tr(vec1))[1]) <= 0.125);
mln_assertion(fabs(compose(rot, tr)(vec1)[2] - rot(tr(vec1))[2]) <= 0.125);
Index: milena/tests/linear_gaussian.cc
--- milena/tests/linear_gaussian.cc (revision 1641)
+++ milena/tests/linear_gaussian.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -42,12 +42,16 @@
#include <mln/linear/gaussian.hh>
+#include "tests/data.hh"
+
+
int main()
{
using namespace mln;
- image2d< value::int_u8 > lena = io::pgm::load("../img/lena.pgm");
+ image2d< value::int_u8 > lena;
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<float> tmp(lena.domain());
linear::gaussian(lena, 5.1f, tmp);
Index: milena/tests/linear_lap.cc
--- milena/tests/linear_lap.cc (revision 1641)
+++ milena/tests/linear_lap.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -37,6 +37,8 @@
#include <mln/border/thickness.hh>
#include <mln/linear/lap.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -45,7 +47,8 @@
border::thickness = 1;
- image2d<int_u8> lena = io::pgm::load("../img/lena.pgm");
+ image2d<int_u8> lena;
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int> tmp(lena.domain());
linear::lap_4(lena, tmp);
}
Index: milena/tests/io/pgm/pgm27.cc
--- milena/tests/io/pgm/pgm27.cc (revision 1641)
+++ milena/tests/io/pgm/pgm27.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -41,6 +41,8 @@
#include <mln/level/transform.hh>
#include <mln/level/compare.hh>
+#include "tests/data.hh"
+
using namespace mln;
@@ -66,6 +68,7 @@
}
};
+
int main()
{
using namespace mln;
@@ -73,23 +76,18 @@
using value::int_u;
typedef value::int_u<27> int_u27;
- image2d<int_u8>
- lena = io::pgm::load<int_u8>("../../../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
image2d<int_u27> out(lena.domain());
level::transform(lena, to27bits(), out);
-
io::pgm::save(out, "out27.pgm");
image2d<int_u27> lena2;
io::pgm::load(lena2, "out27.pgm");
image2d<int_u8> out2(lena.domain());
-
level::transform(lena2, to8bits(), out2);
-
io::pgm::save(out2, "out8.pgm");
-
assert(out2 == lena);
}
Index: milena/tests/io/pgm/pgm19.cc
--- milena/tests/io/pgm/pgm19.cc (revision 1641)
+++ milena/tests/io/pgm/pgm19.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -40,6 +40,8 @@
#include <mln/level/transform.hh>
#include <mln/level/compare.hh>
+#include "tests/data.hh"
+
using namespace mln;
@@ -65,6 +67,7 @@
}
};
+
int main()
{
using namespace mln;
@@ -74,22 +77,16 @@
border::thickness = 52;
- image2d<int_u8>
- lena = io::pgm::load<int_u8>("../../../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
image2d<int_u19> out(lena.domain());
level::transform(lena, to19bits(), out);
-
io::pgm::save(out, "out19.pgm");
- image2d<int_u19>
- lena2 = io::pgm::load<int_u19>("out19.pgm");
- image2d<int_u8> out2(lena.domain());
+ image2d<int_u19> lena2 = io::pgm::load<int_u19>("out19.pgm");
+ image2d<int_u8> out2(lena.domain());
level::transform(lena2, to8bits(), out2);
-
io::pgm::save(out2, "out8.pgm");
-
assert(out2 == lena);
-
}
Index: milena/tests/io/pgm/pgm.cc
--- milena/tests/io/pgm/pgm.cc (revision 1641)
+++ milena/tests/io/pgm/pgm.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -40,33 +40,29 @@
#include <mln/level/compare.hh>
+#include "tests/data.hh"
+
+
int main()
{
using namespace mln;
using value::int_u8;
{
- image2d<int_u8>
- lena = io::pgm::load<int_u8>("../../../img/lena.pgm");
-
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
io::pgm::save(lena, "out.pgm");
- image2d<int_u8>
- lena2 = io::pgm::load<int_u8>("out.pgm");
-
+ image2d<int_u8> lena2 = io::pgm::load<int_u8>("out.pgm");
mln_assertion(lena2 == lena);
}
-
{
- image2d< value::int_u<8> >
- lena, lena2;
- io::pgm::load(lena, "../../../img/lena.pgm");
+ image2d< value::int_u<8> > lena, lena2;
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::save(lena, "out.pgm");
io::pgm::load(lena2, "out.pgm");
mln_assertion(lena2 == lena);
}
-
}
Index: milena/tests/io/pgm/pgm16.cc
--- milena/tests/io/pgm/pgm16.cc (revision 1641)
+++ milena/tests/io/pgm/pgm16.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -41,6 +41,8 @@
#include <mln/level/transform.hh>
+#include "tests/data.hh"
+
using namespace mln;
@@ -66,6 +68,7 @@
}
};
+
int main()
{
using namespace mln;
@@ -76,32 +79,28 @@
win::rectangle2d rect(51, 51);
border::thickness = 52;
- image2d<int_u8>
- lena = io::pgm::load<int_u8>("../../../img/lena.pgm");
+ image2d<int_u8> lena = io::pgm::load<int_u8>(MLN_IMG_DIR "/lena.pgm");
image2d<int_u16> out(lena.domain());
level::transform(lena, to16bits(), out);
-
io::pgm::save(out, "out16.pgm");
- image2d<int_u16>
- lena2 = io::pgm::load<int_u16>("out16.pgm");
- image2d<int_u8> out2(lena.domain());
+ image2d<int_u16> lena2 = io::pgm::load<int_u16>("out16.pgm");
+ image2d<int_u8> out2(lena.domain());
level::transform(lena2, to8bits(), out2);
-
io::pgm::save(out2, "out8.pgm");
}
{
+ /* FIXME: Is this dead code, or code not working? Be more specific. */
// Abort
// image2d< value::int_u<8> > a;
// io::pgm::load(a, "out16.pgm");
image2d< value::int_u<16> > b;
io::pgm::load(b, "out16.pgm");
-
}
}
Index: milena/tests/io/fits/fits.cc
--- milena/tests/io/fits/fits.cc (revision 1641)
+++ milena/tests/io/fits/fits.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -39,25 +39,20 @@
#include <mln/io/pfm/save.hh>
#include <mln/io/pfm/load.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
{
- image2d<float>
- fits_in = io::fits::load("../../../img/test.fits");
+ image2d<float> fits_in = io::fits::load(MLN_IMG_DIR "/test.fits");
io::pfm::save(fits_in, "out.pfm");
-
- image2d<float>
- pfm = io::pfm::load("out.pfm");
-
+ image2d<float> pfm = io::pfm::load("out.pfm");
mln_assertion(pfm == fits_in);
io::pfm::save(fits_in, "out2.pfm");
-
- image2d<float>
- pfm2 = io::pfm::load("out2.pfm");
-
+ image2d<float> pfm2 = io::pfm::load("out2.pfm");
mln_assertion(fits_in == pfm2);
}
}
Index: milena/tests/io/ppm/ppm.cc
--- milena/tests/io/ppm/ppm.cc (revision 1641)
+++ milena/tests/io/ppm/ppm.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -38,7 +38,7 @@
#include <mln/level/compare.hh>
-
+#include "tests/data.hh"
int main()
@@ -46,7 +46,7 @@
using namespace mln;
using value::rgb8;
- image2d<rgb8> lena = io::ppm::load<rgb8>("../../../img/lena.ppm");
+ image2d<rgb8> lena = io::ppm::load<rgb8>(MLN_IMG_DIR "/lena.ppm");
io::ppm::save(lena, "out.ppm");
image2d<rgb8> lena2;
Index: milena/tests/io/ppm/ppm23.cc
--- milena/tests/io/ppm/ppm23.cc (revision 1641)
+++ milena/tests/io/ppm/ppm23.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -40,6 +40,8 @@
#include <mln/level/compare.hh>
+#include "tests/data.hh"
+
using namespace mln;
@@ -79,14 +81,13 @@
typedef image2d<rgb8> I;
- // load a 8bits image A
- image2d<rgb8>
- a = io::ppm::load<rgb8>("../../../img/lena.ppm");
+ // load a 8-bit image A
+ image2d<rgb8> a = io::ppm::load<rgb8>(MLN_IMG_DIR "/lena.ppm");
image2d<rgb23> b(a.domain());
image2d<rgb8>::fwd_piter p(b.domain());
- // save it as a 23bits ppm image B
+ // save it as a 23-bit ppm image B
to23bits f;
for_all(p)
b(p) = f(a(p));
@@ -98,7 +99,7 @@
image2d<rgb8> d(a.domain());
- // save C as a 8bits ppm image D
+ // save C as a 8-bit ppm image D
to8bits g;
for_all(p)
d(p) = g(c(p));
Index: milena/tests/io/ppm/ppm16.cc
--- milena/tests/io/ppm/ppm16.cc (revision 1641)
+++ milena/tests/io/ppm/ppm16.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -41,6 +41,8 @@
#include <mln/level/compare.hh>
+#include "tests/data.hh"
+
using namespace mln;
@@ -79,26 +81,24 @@
typedef image2d<rgb8> I;
{
- // load a 8bits image A
- image2d<rgb8>
- a = io::ppm::load<rgb8>("../../../img/lena.ppm");
+ // load a 8-bit image A
+ image2d<rgb8> a = io::ppm::load<rgb8>(MLN_IMG_DIR "/lena.ppm");
image2d<rgb16> b(a.domain());
image2d<rgb8>::fwd_piter p(b.domain());
- // save it as a 16bits ppm image B
+ // save it as a 16-bit ppm image B
to16bits f;
for_all(p)
b(p) = f(a(p));
io::ppm::save(b, "out16.ppm");
// reload B into C
- image2d<rgb16>
- c = io::ppm::load<rgb16>("out16.ppm");
+ image2d<rgb16> c = io::ppm::load<rgb16>("out16.ppm");
image2d<rgb8> d(a.domain());
- // save C as a 8bits ppm image D
+ // save C as a 8-bit ppm image D
to8bits g;
for_all(p)
d(p) = g(c(p));
@@ -111,27 +111,26 @@
{
// Abort
// image2d<rgb8> a;
-// io::ppm::load(a, "../../../img/lena_16.ppm");
+// io::ppm::load(a, MLN_IMG_DIR "/lena_16.ppm");
image2d< value::rgb<16> > b;
- io::ppm::load(b, "../../../img/lena_16.ppm");
+ io::ppm::load(b, MLN_IMG_DIR "/lena_16.ppm");
}
{
// Abort
// image2d< value::rgb<8> > a =
-// io::ppm::load("../../../img/lena_16.ppm");
+// io::ppm::load(MLN_IMG_DIR "/lena_16.ppm");
// Abort
// image2d< value::rgb<16> > a =
-// io::ppm::load< value::rgb<16> >("../../../img/lena.ppm");
+// io::ppm::load< value::rgb<16> >(MLN_IMG_DIR "/lena.ppm");
image2d< value::rgb<16> > a =
- io::ppm::load< value::rgb<16> >("../../../img/lena_16.ppm");
+ io::ppm::load< value::rgb<16> >(MLN_IMG_DIR "/lena_16.ppm");
image2d< value::rgb<8> > b =
- io::ppm::load< value::rgb<8> >("../../../img/lena.ppm");
-
+ io::ppm::load< value::rgb<8> >(MLN_IMG_DIR "/lena.ppm");
}
}
Index: milena/tests/io/pbm/pbm.cc
--- milena/tests/io/pbm/pbm.cc (revision 1641)
+++ milena/tests/io/pbm/pbm.cc (working copy)
@@ -1,4 +1,4 @@
-// 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
@@ -36,12 +36,14 @@
#include <mln/level/compare.hh>
+#include "tests/data.hh"
+
int main()
{
using namespace mln;
- image2d<bool> pic = io::pbm::load("../../../img/picasso.pbm");
+ image2d<bool> pic = io::pbm::load(MLN_IMG_DIR "/picasso.pbm");
io::pbm::save(pic, "pic.pbm");
image2d<bool> pic2 = io::pbm::load("pic.pbm");
1
0
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2008-01-08 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
* mln/core/concept/point.hh: Add operator/ between points and scalars.
---
point.hh | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
Index: trunk/milena/mln/core/concept/point.hh
===================================================================
--- trunk/milena/mln/core/concept/point.hh (revision 1640)
+++ trunk/milena/mln/core/concept/point.hh (revision 1641)
@@ -35,6 +35,7 @@
# include <mln/core/concept/point_site.hh>
# include <mln/core/concept/dpoint.hh>
+# include <mln/value/concept/scalar.hh>
namespace mln
@@ -104,7 +105,18 @@
template <typename P, typename D>
P& operator-=(Point<P>& p, const Dpoint<D>& dp);
+ /*! \brief Divise a point \p by a scalar \p s.
+ *
+ * \param[in,out] p The targeted point.
+ * \param[in] dp A scalar.
+ * \return A reference to the point \p p once divised by \p s.
+ *
+ * \relates mln::Point
+ */
+ template <typename P, typename D>
+ P& operator/(Point<P>& p, const value::Scalar<D>& dp);
+ // FIXME : add operators and traits?
# ifndef MLN_INCLUDE_ONLY
@@ -146,6 +158,19 @@
return p;
}
+
+ template <typename P, typename D>
+ inline
+ P&
+ operator/(Point<P>& p_, const value::Scalar<D>& s_)
+ {
+ P& p = exact(p_);
+ const D& s = exact(s_);
+ for (unsigned i = 0; i < P::dim; ++i)
+ p[i] /= s;
+ return p;
+ }
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
1
0
08 Jan '08
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2008-01-08 Guillaume Duhamel <guillaume.duhamel(a)lrde.epita.fr>
Add file for example of character extraction.
* sandbox/nivault/extract_character.cc: New example.
---
extract_character.cc | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
Index: trunk/milena/sandbox/nivault/extract_character.cc
===================================================================
--- trunk/milena/sandbox/nivault/extract_character.cc (revision 0)
+++ trunk/milena/sandbox/nivault/extract_character.cc (revision 1640)
@@ -0,0 +1,69 @@
+// Copyright (C) 2007, 2008 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
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+# include <mln/core/image2d.hh>
+# include <mln/io/pbm/load.hh>
+# include <mln/debug/println.hh>
+# include <mln/logical/not.hh>
+# include <mln/logical/or.hh>
+# include <mln/io/pbm/save.hh>
+
+# include <mln/morpho/erosion.hh>
+# include <mln/morpho/dilation.hh>
+# include <mln/make/w_window2d.hh>
+# include <mln/win/rectangle2d.hh>
+# include <mln/win/vline2d.hh>
+# include <mln/win/hline2d.hh>
+# include <mln/level/fill.hh>
+
+
+using namespace mln;
+
+int
+main(int argc, char** argv)
+{
+ using value::int_u8;
+
+ if (argc != 3)
+ {
+ std::cerr << "Usage : " << argv[0]
+ << " input.pbm output.pbm" << std::endl;
+ exit(1);
+ }
+ std::string path_input = argv[1];
+ std::string path_output = argv[2];
+
+ image2d<bool> input = io::pbm::load (path_input);
+
+ image2d<bool> output = clone(input);
+ output = logical::not_(output);
+
+ io::pbm::save (output, path_output);
+
+ std::cout << path_output << " generated" << std::endl;
+}
+
1
0
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
* configure.ac: Configure milena/tests/data.hh.
configure.ac | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Index: configure.ac
--- configure.ac (revision 1638)
+++ configure.ac (working copy)
@@ -78,7 +78,10 @@
## Tests. ##
## ------- ##
-# FIXME: Should be performed through oln.m4 macros?
+#
+AC_CONFIG_FILES([milena/tests/data.hh])
+
+# FIXME: Should be performed through oln.m4 macros, as we did in Olena 0.11?
AC_CONFIG_FILES([
milena/tests/Makefile
milena/tests/core/Makefile
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
I'll extend this to other tests, and I ask everybody to stop using
hard-coded paths to images in tests as of now. Thanks in advance!
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Have morpho tests using input images be independent of the
location of the build tree w.r.t. the source tree by removing
hard-coded paths.
* tests/data.hh.in: New.
* tests/morpho/contrast.cc,
* tests/morpho/dilation.cc,
* tests/morpho/dilation_max_h.cc,
* tests/morpho/erosion.cc,
* tests/morpho/erosion_min_h.cc,
* tests/morpho/gradient.cc,
* tests/morpho/hit_or_miss.cc,
* tests/morpho/laplacian.cc,
* tests/morpho/opening_area.cc,
* tests/morpho/thinning.cc: Use tests/data.hh to get the path to
the img/ directory.
* tests/tests.mk (AM_CPPFLAGS): Add -I$(top_builddir)/milena.
data.hh.in | 39 +++++++++++++++++++++++++++++++++++++++
morpho/contrast.cc | 4 +++-
morpho/dilation.cc | 4 +++-
morpho/dilation_max_h.cc | 4 +++-
morpho/erosion.cc | 4 +++-
morpho/erosion_min_h.cc | 4 +++-
morpho/gradient.cc | 3 ++-
morpho/hit_or_miss.cc | 9 ++++++++-
morpho/laplacian.cc | 4 +++-
morpho/opening_area.cc | 4 +++-
morpho/thinning.cc | 10 ++++++----
tests.mk | 6 ++++--
12 files changed, 80 insertions(+), 15 deletions(-)
Index: tests/tests.mk
--- tests/tests.mk (revision 1637)
+++ tests/tests.mk (working copy)
@@ -1,12 +1,14 @@
## FIXME: Revamp (see Olena 0.11's test suite).
-AM_CPPFLAGS = -I$(top_srcdir)/milena
+# Look for Milena header in srcdir and for (generated) test headers
+# (like data.hh) in builddir.
+AM_CPPFLAGS = -I$(top_srcdir)/milena -I$(top_builddir)/milena
# FIXME: Add
#
# AM_CXXFLAGS = $(CXXFLAGS_STRICT) $(CXXFLAGS_DEBUG)
#
# when oln.m4 is available in the distribution, instead of using the
-# set-by-hand TESTS_CXXFLAGS.
+# hand-made TESTS_CXXFLAGS.
TESTS_CXXFLAGS = @TESTS_CXXFLAGS@
AM_CXXFLAGS = $(TESTS_CXXFLAGS)
Index: tests/data.hh.in
--- tests/data.hh.in (revision 0)
+++ tests/data.hh.in (revision 0)
@@ -0,0 +1,39 @@
+// Copyright (C) 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
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef TESTS_DATA_HH
+# define TESTS_DATA_HH
+
+# include <string>
+
+/** \brief The absolute path to the img directory of Milena.
+
+ Macros are evil, but they save us an extra compilation unit here
+ (as well as additional burden in Makefiles, too.). */
+# define MLN_IMG_DIR "@abs_top_srcdir@/milena/img"
+
+#endif // ! TESTS_DATA_HH
Index: tests/morpho/contrast.cc
--- tests/morpho/contrast.cc (revision 1637)
+++ tests/morpho/contrast.cc (working copy)
@@ -41,6 +41,8 @@
#include <mln/morpho/contrast.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -51,7 +53,7 @@
border::thickness = 1;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/tiny.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
image2d<int_u8> out = morpho::contrast(lena, rect);
io::pgm::save(out, "out.pgm");
Index: tests/morpho/gradient.cc
--- tests/morpho/gradient.cc (revision 1637)
+++ tests/morpho/gradient.cc (working copy)
@@ -39,6 +39,7 @@
#include <mln/value/int_u8.hh>
#include <mln/morpho/gradient.hh>
+#include "tests/data.hh"
int main()
@@ -50,7 +51,7 @@
border::thickness = 2;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/tiny.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
io::pgm::save( morpho::gradient(lena, rect),
"out.pgm" );
Index: tests/morpho/erosion.cc
--- tests/morpho/erosion.cc (revision 1637)
+++ tests/morpho/erosion.cc (working copy)
@@ -51,6 +51,8 @@
#include <mln/convert/to_p_array.hh>
#include <mln/convert/to_window.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -75,7 +77,7 @@
// 25 66 15
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
// trace::quiet = false;
Index: tests/morpho/thinning.cc
--- tests/morpho/thinning.cc (revision 1637)
+++ tests/morpho/thinning.cc (working copy)
@@ -43,6 +43,8 @@
#include <mln/morpho/thinning.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -63,12 +65,12 @@
{
image2d<bool> pic;
- io::pbm::load(pic, "../../img/picasso.pbm");
+ io::pbm::load(pic, MLN_IMG_DIR "/picasso.pbm");
io::pbm::save(morpho::thinning(pic, win_fg, win_bg), "out.pbm" );
}
+ // FIXME: Dead code?
// {
-// image2d<int_u8> pic = io::pgm::load("../img/picasso.pgm");
-// io::pgm::save( morpho::thinning(pic, win_fg, win_bg),
-// "out.pgm" );
+// image2d<int_u8> pic = io::pgm::load(MLN_IMG_DIR "/picasso.pgm");
+// io::pgm::save( morpho::thinning(pic, win_fg, win_bg), "out.pgm" );
// }
}
Index: tests/morpho/dilation_max_h.cc
--- tests/morpho/dilation_max_h.cc (revision 1637)
+++ tests/morpho/dilation_max_h.cc (working copy)
@@ -43,6 +43,8 @@
#include <mln/convert/to_p_array.hh>
#include <mln/convert/to_window.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -53,7 +55,7 @@
border::thickness = 66;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
{
p_array<point2d> vec = convert::to_p_array(rec, point2d::origin);
Index: tests/morpho/hit_or_miss.cc
--- tests/morpho/hit_or_miss.cc (revision 1637)
+++ tests/morpho/hit_or_miss.cc (working copy)
@@ -45,6 +45,8 @@
#include <mln/morpho/hit_or_miss.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -76,8 +78,13 @@
border::thickness = 2;
image2d<bool> pic;
- io::pbm::load(pic, "../../img/picasso.pbm");
+ io::pbm::load(pic, MLN_IMG_DIR "/picasso.pbm");
image2d<bool> out = morpho::hit_or_miss(pic, win_hit, win_miss);
+ // FIXME: We shall handle out images as well as input images.
+ // Currently, output images are named `out.*', and each test
+ // overwrites the product(s) of the previous one. Moreover, nothing
+ // is cleaned upon `make clean', which will probably bother `make
+ // distcheck'.
io::pbm::save(out, "out.pbm");
mln_postcondition(morpho::hit_or_miss(morpho::complementation(pic),
Index: tests/morpho/dilation.cc
--- tests/morpho/dilation.cc (revision 1637)
+++ tests/morpho/dilation.cc (working copy)
@@ -51,6 +51,8 @@
#include <mln/convert/to_p_array.hh>
#include <mln/convert/to_window.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -61,7 +63,7 @@
border::thickness = 66;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
// {
// image2d<int_u8> out(lena.domain());
Index: tests/morpho/laplacian.cc
--- tests/morpho/laplacian.cc (revision 1637)
+++ tests/morpho/laplacian.cc (working copy)
@@ -43,6 +43,8 @@
#include <mln/morpho/laplacian.hh>
+#include "tests/data.hh"
+
int main()
@@ -54,7 +56,7 @@
border::thickness = 2;
image2d<int_u8> tiny;
- io::pgm::load(tiny, "../../img/tiny.pgm");
+ io::pgm::load(tiny, MLN_IMG_DIR "/tiny.pgm");
image2d<int> lap(tiny.domain());
morpho::laplacian(tiny, rect, lap);
Index: tests/morpho/opening_area.cc
--- tests/morpho/opening_area.cc (revision 1637)
+++ tests/morpho/opening_area.cc (working copy)
@@ -39,6 +39,8 @@
#include <mln/morpho/opening_area.hh>
+#include "tests/data.hh"
+
int main()
@@ -47,7 +49,7 @@
using value::int_u8;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
image2d<int_u8> out(lena.domain());
morpho::opening_area(lena, c4(), 510, out);
Index: tests/morpho/erosion_min_h.cc
--- tests/morpho/erosion_min_h.cc (revision 1637)
+++ tests/morpho/erosion_min_h.cc (working copy)
@@ -43,6 +43,8 @@
#include <mln/convert/to_p_array.hh>
#include <mln/convert/to_window.hh>
+#include "tests/data.hh"
+
int main()
{
@@ -53,7 +55,7 @@
border::thickness = 66;
image2d<int_u8> lena;
- io::pgm::load(lena, "../../img/lena.pgm");
+ io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
{
p_array<point2d> vec = convert::to_p_array(rec, point2d::origin);
1
0
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
* tests/trait_ch_value.cc: Typo in comment.
Reported by Alexandre Duret-Lutz.
trait_ch_value.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: tests/trait_ch_value.cc
--- tests/trait_ch_value.cc (revision 1636)
+++ tests/trait_ch_value.cc (working copy)
@@ -50,6 +50,6 @@
L ima2;
mlc_equal(L, image2d<float>)::check();
- // FIXME: Exercize more image types.
+ // FIXME: Exercise more image types.
// ...
}
1
0
It seems I'm still not used to using several ChangeLogs. :(
URL: https://svn.lrde.epita.fr/svn/oln/trunk
Index: milena/ChangeLog
===================================================================
--- milena/ChangeLog (revision 1635)
+++ milena/ChangeLog (revision 1636)
@@ -90,6 +90,35 @@
* tests/morpho/opening_area.cc,
* tests/morpho/thinning.cc: Fix path of images and update brief.
+2008-01-01 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix the tests in tests/morpho.
+
+ * mln/morpho/erosion.spe.hh
+ (erosion_iterative_(kind::logic, speed::fastest, const I&, const W&)):
+ Fix the assignment of the out pixter in the case of a non-centered
+ window.
+ * mln/value/int_u_sat.hh (mln::value::props< int_u_sat<n> >):
+ Remove.
+ Superseded by...
+ (mln::trait::value_< mln::value::int_u_sat<n> >): ...this (new
+ specialization).
+ * mln/set/inter.hh (mln::set::inter): Fix uses of the tracing
+ mechanism.
+ * mln/value/int_u.hh: Don't use Doxygen comments to announce
+ forward declarations.
+ * tests/morpho/contrast.cc,
+ * tests/morpho/dilation.cc,
+ * tests/morpho/dilation_max_h.cc,
+ * tests/morpho/erosion.cc,
+ * tests/morpho/erosion_min_h.cc,
+ * tests/morpho/gradient.cc,
+ * tests/morpho/hit_or_miss.cc,
+ * tests/morpho/laplacian.cc,
+ * tests/morpho/opening_area.cc,
+ * tests/morpho/thinning.cc:
+ Catch up with the new I/O interface of Milena.
+
2007-12-22 Roland Levillain <roland(a)lrde.epita.fr>
Move mathematical morphology-related tests into tests/morpho.
Index: ChangeLog
===================================================================
--- ChangeLog (revision 1635)
+++ ChangeLog (revision 1636)
@@ -1,32 +1,3 @@
-2008-01-01 Roland Levillain <roland(a)lrde.epita.fr>
-
- Fix the tests in tests/morpho.
-
- * mln/morpho/erosion.spe.hh
- (erosion_iterative_(kind::logic, speed::fastest, const I&, const W&)):
- Fix the assignment of the out pixter in the case of a non-centered
- window.
- * mln/value/int_u_sat.hh (mln::value::props< int_u_sat<n> >):
- Remove.
- Superseded by...
- (mln::trait::value_< mln::value::int_u_sat<n> >): ...this (new
- specialization).
- * mln/set/inter.hh (mln::set::inter): Fix uses of the tracing
- mechanism.
- * mln/value/int_u.hh: Don't use Doxygen comments to announce
- forward declarations.
- * tests/morpho/contrast.cc,
- * tests/morpho/dilation.cc,
- * tests/morpho/dilation_max_h.cc,
- * tests/morpho/erosion.cc,
- * tests/morpho/erosion_min_h.cc,
- * tests/morpho/gradient.cc,
- * tests/morpho/hit_or_miss.cc,
- * tests/morpho/laplacian.cc,
- * tests/morpho/opening_area.cc,
- * tests/morpho/thinning.cc:
- Catch up with the new I/O interface of Milena.
-
2007-12-04 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Improve support for the cfitsio library.
1
0