https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Update calls to morphological structural closing and opening.
* nivault/extract_score.cc,
* garrigues/factures/extract_array_highlight.cc,
* inim/nature/closing.cc,
* inim/nature/nature.cc,
* inim/nature/opening.cc,
* inim/nature/hom.cc,
* theo/exec/closing_isotropic.cc
(closing, opening): Update to...
(closing::structural, opening::structural): ...this.
* dalila/dematOld.hh,
* dalila/demat.hh: Remove; they are just copies of...
* scribo/demat.hh: ...this!
garrigues/factures/extract_array_highlight.cc | 12 ++++++++----
inim/nature/closing.cc | 8 +++++---
inim/nature/hom.cc | 10 ++++++----
inim/nature/nature.cc | 11 ++++++-----
inim/nature/opening.cc | 8 +++++---
nivault/extract_score.cc | 13 +++++++------
theo/exec/closing_isotropic.cc | 6 +++---
7 files changed, 40 insertions(+), 28 deletions(-)
Index: nivault/extract_score.cc
--- nivault/extract_score.cc (revision 3462)
+++ nivault/extract_score.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// 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
@@ -40,8 +41,8 @@
# include <mln/morpho/erosion.hh>
# include <mln/morpho/dilation.hh>
# include <mln/morpho/complementation.hh>
-# include <mln/morpho/closing.hh>
-# include <mln/morpho/opening.hh>
+# include <mln/morpho/closing/structural.hh>
+# include <mln/morpho/opening/structural.hh>
# include <mln/make/w_window2d.hh>
# include <mln/win/rectangle2d.hh>
# include <mln/win/vline2d.hh>
@@ -209,8 +210,8 @@
// }
{ // fermeture avec un disk et un element vertial pour reperer les notes.
- IB closed1 = morpho::opening(score_b, win::vline2d(5));
- IB closed2 = morpho::opening(score_b, win::disk2d(5));
+ IB closed1 = morpho::opening::structural(score_b, win::vline2d(5));
+ IB closed2 = morpho::opening::structural(score_b, win::disk2d(5));
morpho::opening_area(closed1, c4(), 20, closed1);
morpho::opening_area(closed2, c4(), 15, closed2);
io::pbm::save(closed1, "closed1.pbm");
@@ -220,7 +221,7 @@
}
{ // Fermeture avec un element struturant en horizontale pour obtenir les lignes de
port�e.
-// IB hclosed = morpho::closing(score_b, win::hline2d(73));
+// IB hclosed = morpho::closing::structural(score_b, win::hline2d(73));
// io::pbm::save(hclosed, "hclosed.pbm");
}
}
Index: garrigues/factures/extract_array_highlight.cc
--- garrigues/factures/extract_array_highlight.cc (revision 3462)
+++ garrigues/factures/extract_array_highlight.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// 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
@@ -31,7 +32,7 @@
#include <mln/geom/resize.hh>
#include <mln/display/all.hh>
#include <mln/value/int_u8.hh>
-#include <mln/morpho/opening.hh>
+#include <mln/morpho/opening/structural.hh>
#include <mln/win/hline2d.hh>
#include <mln/win/vline2d.hh>
#include <mln/win/disk2d.hh>
@@ -51,10 +52,12 @@
#include <mln/draw/box.hh>
+
using namespace mln;
typedef image2d<bool> ima2d_bool;
typedef image2d<unsigned> ima2d_unsigned;
+
image2d<bool>
filter_arrays(image2d<bool> in)
{
@@ -98,6 +101,7 @@
return output;
}
+
image2d<value::rgb8>
highlight_vlines(image2d<bool> in)
{
@@ -106,7 +110,7 @@
tmp = filter_arrays(in);
// Opening.
- tmp = morpho::opening(tmp, win::vline2d(5));
+ tmp = morpho::opening::structural(tmp, win::vline2d(5));
image2d<value::rgb8> output(tmp.domain());
mln_fwd_piter_(ima2d_unsigned) p(tmp.domain());
@@ -127,7 +131,7 @@
image2d<bool> tmp;
tmp = filter_arrays(in);
// Opening.
- tmp = morpho::opening(tmp, win::hline2d(5));
+ tmp = morpho::opening::structural(tmp, win::hline2d(5));
image2d<value::rgb8> output(tmp.domain());
mln_fwd_piter_(ima2d_unsigned) p(tmp.domain());
Index: inim/nature/closing.cc
--- inim/nature/closing.cc (revision 3462)
+++ inim/nature/closing.cc (working copy)
@@ -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
@@ -32,7 +33,8 @@
#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
-#include <mln/morpho/closing.hh>
+#include <mln/morpho/closing/structural.hh>
+
int main(int argc, const char * argv[])
{
@@ -54,6 +56,6 @@
std::string name(argv[i]);
name.erase(name.length() - 4);
- io::pgm::save(morpho::closing(ima, rect), name.append("_closed.pgm"));
+ io::pgm::save(morpho::closing::structural(ima, rect),
name.append("_closed.pgm"));
}
}
Index: inim/nature/nature.cc
--- inim/nature/nature.cc (revision 3462)
+++ inim/nature/nature.cc (working copy)
@@ -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
@@ -53,7 +54,7 @@
#include <mln/morpho/hit_or_miss.hh>
#include <mln/morpho/gradient.hh>
-#include <mln/morpho/opening.hh>
+#include <mln/morpho/opening/structural.hh>
#include <mln/binarization/threshold.hh>
@@ -367,8 +368,8 @@
image2d<bool> inter (up_left + up_right + bottom_right + bottom_left + up +
bottom + left + right);
- image2d<bool> final = morpho::opening(inter, win::hline2d(20));
- final += morpho::opening(inter, win::vline2d(20));
+ image2d<bool> final = morpho::opening::structural(inter, win::hline2d(20));
+ final += morpho::opening::structural(inter, win::vline2d(20));
// Now we count blank points in our result
@@ -398,7 +399,7 @@
// Last but not least : text detection thanks to FFT
- transform::fft<double> fourier(morpho::opening(uinty, win::hline2d(20)));
+ transform::fft<double> fourier(morpho::opening::structural(uinty,
win::hline2d(20)));
fourier.transform();
std::string name(argv[1]);
Index: inim/nature/opening.cc
--- inim/nature/opening.cc (revision 3462)
+++ inim/nature/opening.cc (working copy)
@@ -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
@@ -32,7 +33,8 @@
#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
-#include <mln/morpho/opening.hh>
+#include <mln/morpho/opening/structural.hh>
+
int main(int argc, const char * argv[])
{
@@ -54,6 +56,6 @@
std::string name(argv[i]);
name.erase(name.length() - 4);
- io::pgm::save(morpho::opening(ima, rect), name.append("_opened.pgm"));
+ io::pgm::save(morpho::opening::structural(ima, rect),
name.append("_opened.pgm"));
}
}
Index: inim/nature/hom.cc
--- inim/nature/hom.cc (revision 3462)
+++ inim/nature/hom.cc (working copy)
@@ -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
@@ -43,11 +44,12 @@
#include <mln/estim/mean.hh>
#include <mln/morpho/hit_or_miss.hh>
#include <mln/morpho/dilation.hh>
-#include <mln/morpho/opening.hh>
+#include <mln/morpho/opening/structural.hh>
#include <mln/win/hline2d.hh>
#include <mln/win/vline2d.hh>
+
int main(int argc, const char * argv[])
{
using namespace mln;
@@ -305,8 +307,8 @@
convert::from_to(vert, winin);
convert::from_to(hori, winout);
- image2d<bool> final = morpho::opening(inter, win::hline2d(20));
- final += morpho::opening(inter, win::vline2d(20));
+ image2d<bool> final = morpho::opening::structural(inter, win::hline2d(20));
+ final += morpho::opening::structural(inter, win::vline2d(20));
io::pbm::save( final,
name.append("_hom.pbm"));
Index: theo/exec/closing_isotropic.cc
--- theo/exec/closing_isotropic.cc (revision 3462)
+++ theo/exec/closing_isotropic.cc (working copy)
@@ -1,6 +1,6 @@
#include "filetype.hh"
-#include <mln/morpho/closing.hh>
+#include <mln/morpho/closing/structural.hh>
#include <mln/win/disk2d.hh>
#include <mln/win/sphere3d.hh>
@@ -41,7 +41,7 @@
{
image2d<bool> ima, out;
io::pbm::load(ima, argv[1]);
- out = morpho::closing(ima, win::disk2d(2 * r + 1));
+ out = morpho::closing::structural(ima, win::disk2d(2 * r + 1));
io::pbm::save(out, argv[3]);
}
break;
@@ -50,7 +50,7 @@
{
image3d<bool> ima, out;
io::dump::load(ima, argv[1]);
- out = morpho::closing(ima, win::sphere3d(2 * r + 1));
+ out = morpho::closing::structural(ima, win::sphere3d(2 * r + 1));
io::dump::save(out, argv[3]);
}
break;