* src/misc/Makefile.am: Add new target. * src/misc/closure_rectanle.cc: New. --- scribo/ChangeLog | 8 +++++ scribo/src/misc/Makefile.am | 6 +++- .../src/misc/closure_rectangle.cc | 28 ++++++++++++------- 3 files changed, 30 insertions(+), 12 deletions(-) copy milena/tests/io/tiff/tiff2pbm.cc => scribo/src/misc/closure_rectangle.cc (74%) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index 0b6042c..0412e63 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,13 @@ 2011-05-17 Guillaume Lazzara <z@lrde.epita.fr> + Add a new tool. + + * src/misc/Makefile.am: Add new target. + + * src/misc/closure_rectanle.cc: New. + +2011-05-17 Guillaume Lazzara <z@lrde.epita.fr> + Fix use of skeleton_constrained. * scribo/estim/components_features.hh, diff --git a/scribo/src/misc/Makefile.am b/scribo/src/misc/Makefile.am index 0323aaa..e44660f 100644 --- a/scribo/src/misc/Makefile.am +++ b/scribo/src/misc/Makefile.am @@ -1,5 +1,5 @@ -# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory -# (LRDE). +# Copyright (C) 2009, 2010, 2011 EPITA Research and Development +# Laboratory (LRDE). # # This file is part of Olena. # @@ -18,12 +18,14 @@ include $(top_srcdir)/scribo/scribo.mk noinst_PROGRAMS = \ + closure_rectangle \ dmap \ morpho \ negate \ rectangularity \ superpose +closure_rectangle_SOURCES = closure_rectangle.cc dmap_SOURCES = dmap.cc morpho_SOURCES = morpho.cc negate_SOURCES = negate.cc diff --git a/milena/tests/io/tiff/tiff2pbm.cc b/scribo/src/misc/closure_rectangle.cc similarity index 74% copy from milena/tests/io/tiff/tiff2pbm.cc copy to scribo/src/misc/closure_rectangle.cc index a7484dc..b25206f 100644 --- a/milena/tests/io/tiff/tiff2pbm.cc +++ b/scribo/src/misc/closure_rectangle.cc @@ -24,25 +24,33 @@ // executable file might be covered by the GNU General Public License. #include <mln/core/image/image2d.hh> -#include <mln/io/tiff/load.hh> -#include <mln/io/pbm/save.hh> -// #include <mln/data/convert.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pbm/all.hh> + +#include <mln/win/rectangle2d.hh> +#include <mln/morpho/closing/structural.hh> + +#include <scribo/make/debug_filename.hh> int main(int argc, char *argv[]) { using namespace mln; - if (argc < 3) + if (argc != 4) { - std::cout << "Usage: " << argv[0] << " <input.tiff> <output.pbm>" << std::endl; + std::cout << argv[0] << " in.pbm out.pbm wsize" << std::endl; return 1; } - image2d<bool> ima; - io::tiff::load(ima, argv[1]); - io::pbm::save(ima, argv[2]); + unsigned wsize = atoi(argv[3]); + typedef image2d<bool> I; + + I in; + io::pbm::load(in, argv[1]); + + I out = morpho::closing::structural(in, win::rectangle2d(wsize, wsize)); -// io::ppm::save(ima, argv[2]); -// io::pbm::save(data::convert(bool(), ima), argv[2]); + io::pbm::save(out, argv[2]); } -- 1.5.6.5