* src/Makefile.am: Add postprocessing subdir.
* src/postprocessing/Makefile.am,
* src/postprocessing/fill_object_holes.cc: New.
* src/preprocessing/denoise.cc: Remove.
* src/preprocessing/denoise_bg.cc,
* src/preprocessing/denoise_fg.cc: New.
---
scribo/ChangeLog | 14 ++++++++++++
scribo/src/Makefile.am | 7 +++--
.../toolchain => src/postprocessing}/Makefile.am | 9 +++++--
.../fill_object_holes.cc} | 22 +++++++++----------
scribo/src/preprocessing/Makefile.am | 6 +++-
.../preprocessing/{denoise.cc => denoise_bg.cc} | 18 +++++++---------
.../preprocessing/{denoise.cc => denoise_fg.cc} | 21 ++++++++----------
7 files changed, 55 insertions(+), 42 deletions(-)
copy scribo/{tests/toolchain => src/postprocessing}/Makefile.am (84%)
copy scribo/src/{preprocessing/denoise.cc => postprocessing/fill_object_holes.cc}
(78%)
copy scribo/src/preprocessing/{denoise.cc => denoise_bg.cc} (83%)
rename scribo/src/preprocessing/{denoise.cc => denoise_fg.cc} (78%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index a473c52..f2eb3c3 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,19 @@
2010-06-03 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Update tools in scribo/src.
+
+ * src/Makefile.am: Add postprocessing subdir.
+
+ * src/postprocessing/Makefile.am,
+ * src/postprocessing/fill_object_holes.cc: New.
+
+ * src/preprocessing/denoise.cc: Remove.
+
+ * src/preprocessing/denoise_bg.cc,
+ * src/preprocessing/denoise_fg.cc: New.
+
+2010-06-03 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add a specific toolchain for Nepomuk integration.
* convert/from_qimage.hh: New. convert an image2d to a QImage.
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index e910f53..b3a7859 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+# (LRDE).
#
# This file is part of Olena.
#
@@ -25,12 +26,12 @@ SUBDIRS = \
primitive \
filter \
misc \
- nuxeo_xwiki \
+ postprocessing \
preprocessing \
table \
text
-bin_PROGRAMS = \
+bin_PROGRAMS = \
pbm_lines_in_doc
diff --git a/scribo/tests/toolchain/Makefile.am b/scribo/src/postprocessing/Makefile.am
similarity index 84%
copy from scribo/tests/toolchain/Makefile.am
copy to scribo/src/postprocessing/Makefile.am
index 826fb86..b21cac2 100644
--- a/scribo/tests/toolchain/Makefile.am
+++ b/scribo/src/postprocessing/Makefile.am
@@ -17,7 +17,10 @@
## Process this file through Automake to create Makefile.in.
-include $(top_srcdir)/scribo/tests/tests.mk
+include $(top_srcdir)/scribo/scribo.mk
-SUBDIRS = \
- nepomuk
\ No newline at end of file
+bin_PROGRAMS = \
+ fill_object_holes
+
+
+fill_object_holes_SOURCES = fill_object_holes.cc
diff --git a/scribo/src/preprocessing/denoise.cc
b/scribo/src/postprocessing/fill_object_holes.cc
similarity index 78%
copy from scribo/src/preprocessing/denoise.cc
copy to scribo/src/postprocessing/fill_object_holes.cc
index 0eb567b..280eae5 100644
--- a/scribo/src/preprocessing/denoise.cc
+++ b/scribo/src/postprocessing/fill_object_holes.cc
@@ -28,7 +28,7 @@
#include <mln/io/pbm/all.hh>
#include <scribo/debug/usage.hh>
-#include <scribo/preprocessing/denoise.hh>
+#include <scribo/postprocessing/fill_object_holes.hh>
@@ -36,8 +36,7 @@ const char *args_desc[][2] =
{
{ "input.pbm", "A binary image. 'True' for objects,
'False'\
for the background." },
- { "fg_min_card", "The minimum neighbor count to be set to true."
},
- { "bg_min_card", "The minimum neighbor count to be set to false."
},
+ { "ratio", "The maximum holes size ratio to allow hole filling."
},
{0, 0}
};
@@ -46,12 +45,11 @@ int main(int argc, char *argv[])
{
using namespace mln;
- if (argc != 5)
+ if (argc != 4)
return scribo::debug::usage(argv,
- "Remove noise.",
- "input.pbm fg_min_card bg_min_card output.pbm",
- args_desc,
- "A binary image.");
+ "Fill object holes.",
+ "input.pbm ratio output.pbm",
+ args_desc);
trace::entering("main");
@@ -59,11 +57,11 @@ int main(int argc, char *argv[])
I input;
io::pbm::load(input, argv[1]);
- unsigned fg_min_card = atoi(argv[2]);
- unsigned bg_min_card = atoi(argv[3]);
+ float ratio = atof(argv[2]);
- io::pbm::save(scribo::preprocessing::denoise(input, fg_min_card, bg_min_card),
- argv[4]);
+ I output = scribo::postprocessing::fill_object_holes(input, ratio);
+
+ io::pbm::save(output, argv[3]);
trace::exiting("main");
}
diff --git a/scribo/src/preprocessing/Makefile.am b/scribo/src/preprocessing/Makefile.am
index 1f683e4..d080c96 100644
--- a/scribo/src/preprocessing/Makefile.am
+++ b/scribo/src/preprocessing/Makefile.am
@@ -21,13 +21,15 @@
include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
- denoise \
+ denoise_bg \
+ denoise_fg \
homogeneous_contrast \
preprocess \
split_bg_fg \
unskew
-denoise_SOURCES = denoise.cc
+denoise_bg_SOURCES = denoise_bg.cc
+denoise_fg_SOURCES = denoise_fg.cc
homogeneous_contrast_SOURCES = homogeneous_contrast.cc
preprocess_SOURCES = preprocess.cc
split_bg_fg_SOURCES = split_bg_fg.cc
diff --git a/scribo/src/preprocessing/denoise.cc b/scribo/src/preprocessing/denoise_bg.cc
similarity index 83%
copy from scribo/src/preprocessing/denoise.cc
copy to scribo/src/preprocessing/denoise_bg.cc
index 0eb567b..e9d83cf 100644
--- a/scribo/src/preprocessing/denoise.cc
+++ b/scribo/src/preprocessing/denoise_bg.cc
@@ -36,7 +36,6 @@ const char *args_desc[][2] =
{
{ "input.pbm", "A binary image. 'True' for objects,
'False'\
for the background." },
- { "fg_min_card", "The minimum neighbor count to be set to true."
},
{ "bg_min_card", "The minimum neighbor count to be set to false."
},
{0, 0}
};
@@ -46,12 +45,11 @@ int main(int argc, char *argv[])
{
using namespace mln;
- if (argc != 5)
+ if (argc != 4)
return scribo::debug::usage(argv,
- "Remove noise.",
- "input.pbm fg_min_card bg_min_card output.pbm",
- args_desc,
- "A binary image.");
+ "Remove noise in background using c4 neighbor.",
+ "input.pbm bg_min_card output.pbm",
+ args_desc);
trace::entering("main");
@@ -59,11 +57,11 @@ int main(int argc, char *argv[])
I input;
io::pbm::load(input, argv[1]);
- unsigned fg_min_card = atoi(argv[2]);
- unsigned bg_min_card = atoi(argv[3]);
+ unsigned bg_min_card = atoi(argv[2]);
- io::pbm::save(scribo::preprocessing::denoise(input, fg_min_card, bg_min_card),
- argv[4]);
+ I output = scribo::preprocessing::denoise_bg(input, c4(), bg_min_card);
+
+ io::pbm::save(output, argv[3]);
trace::exiting("main");
}
diff --git a/scribo/src/preprocessing/denoise.cc b/scribo/src/preprocessing/denoise_fg.cc
similarity index 78%
rename from scribo/src/preprocessing/denoise.cc
rename to scribo/src/preprocessing/denoise_fg.cc
index 0eb567b..307e8f6 100644
--- a/scribo/src/preprocessing/denoise.cc
+++ b/scribo/src/preprocessing/denoise_fg.cc
@@ -1,5 +1,4 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -36,8 +35,7 @@ const char *args_desc[][2] =
{
{ "input.pbm", "A binary image. 'True' for objects,
'False'\
for the background." },
- { "fg_min_card", "The minimum neighbor count to be set to true."
},
- { "bg_min_card", "The minimum neighbor count to be set to false."
},
+ { "fg_min_card", "The minimum neighbor count to be set to false."
},
{0, 0}
};
@@ -46,12 +44,11 @@ int main(int argc, char *argv[])
{
using namespace mln;
- if (argc != 5)
+ if (argc != 4)
return scribo::debug::usage(argv,
- "Remove noise.",
- "input.pbm fg_min_card bg_min_card output.pbm",
- args_desc,
- "A binary image.");
+ "Remove noisy objects using c8 neighbors.",
+ "input.pbm fg_min_card output.pbm",
+ args_desc);
trace::entering("main");
@@ -60,10 +57,10 @@ int main(int argc, char *argv[])
io::pbm::load(input, argv[1]);
unsigned fg_min_card = atoi(argv[2]);
- unsigned bg_min_card = atoi(argv[3]);
- io::pbm::save(scribo::preprocessing::denoise(input, fg_min_card, bg_min_card),
- argv[4]);
+ I output = scribo::preprocessing::denoise_fg(input, c8(), fg_min_card);
+
+ io::pbm::save(output, argv[3]);
trace::exiting("main");
}
--
1.5.6.5