---
scribo/scribo/binarization/otsu_threshold.hh | 6 +++---
scribo/scribo/binarization/sauvola_ms.hh | 23 ++++++-----------------
scribo/src/binarization/otsu.cc | 1 +
3 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/scribo/scribo/binarization/otsu_threshold.hh
b/scribo/scribo/binarization/otsu_threshold.hh
index ab663d0..fa2d725 100644
--- a/scribo/scribo/binarization/otsu_threshold.hh
+++ b/scribo/scribo/binarization/otsu_threshold.hh
@@ -78,7 +78,7 @@ namespace scribo
/* calculation of probability density */
util::array<double> pdf(hist.nvalues()); //probability distribution
- for(int i = 0; i< maxval; ++i)
+ for(unsigned i = 0; i< maxval; ++i)
pdf[i] = (double)hist[i] / nsites;
@@ -89,7 +89,7 @@ namespace scribo
cdf[0] = pdf[0];
myu[0] = 0.0; /* 0.0 times prob[0] equals zero */
- for(int i = 1; i < maxval; ++i)
+ for(unsigned i = 1; i < maxval; ++i)
{
cdf[i] = cdf[i-1] + pdf[i];
myu[i] = myu[i-1] + i*pdf[i];
@@ -102,7 +102,7 @@ namespace scribo
double max_sigma = 0.0;
util::array<double> sigma(hist.nvalues()); // inter-class variance
- for(int i = 0; i < maxval - 1; ++i)
+ for(int i = 0; i < (maxval - 1); ++i)
{
if(cdf[i] != 0.0 && cdf[i] != 1.0)
{
diff --git a/scribo/scribo/binarization/sauvola_ms.hh
b/scribo/scribo/binarization/sauvola_ms.hh
index 70964ea..fe9f1f0 100644
--- a/scribo/scribo/binarization/sauvola_ms.hh
+++ b/scribo/scribo/binarization/sauvola_ms.hh
@@ -72,7 +72,7 @@
# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
# include <scribo/binarization/internal/local_threshold_debug.hh>
# include <mln/io/pgm/save.hh>
-# include <mln/debug/filename.hh>
+# include <scribo/make/debug_filename.hh>
# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
# include <mln/util/timer.hh>
@@ -228,11 +228,8 @@ namespace scribo
if (f.parent.element(p) == p)
{
// test over the component cardinality
- f.msk.element(p) = f.card.element(p) > lambda_min;
-// && f.card.element(p) < lambda_max;
-# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
- f.full_msk.element(p) = true;
-# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+ f.msk.element(p) = f.card.element(p) > lambda_min
+ && f.card.element(p) < lambda_max;
if (f.msk.element(p) && e_2(sq) == 0u)
{
@@ -245,9 +242,6 @@ namespace scribo
{
// Propagation
f.msk.element(p) = f.msk.element(f.parent.element(p));
-# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
- f.full_msk.element(p) = f.full_msk.element(f.parent.element(p));
-# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
if (f.msk.element(p) && e_2(sq) == 0u)
{
@@ -272,10 +266,7 @@ namespace scribo
# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
if (internal::threshold_image_output)
io::pbm::save(f.msk,
- mln::debug::filename(internal::threshold_image_output));
- if (internal::full_threshold_image_output)
- io::pbm::save(f.full_msk,
- mln::debug::filename(internal::full_threshold_image_output));
+ scribo::make::debug_filename(internal::threshold_image_output).c_str());
# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
return f.t_sub;
@@ -915,8 +906,7 @@ namespace scribo
# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
if (internal::scale_image_output)
- io::pgm::save(e_2,
- mln::debug::filename(internal::scale_image_output));
+ io::pgm::save(e_2, internal::scale_image_output);
# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
// Propagate scale values.
@@ -929,8 +919,7 @@ namespace scribo
# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
if (internal::scale_iz_image_output)
- io::pgm::save(e_2,
- mln::debug::filename(internal::scale_iz_image_output));
+ io::pgm::save(e_2, internal::scale_iz_image_output);
# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
// Binarize
diff --git a/scribo/src/binarization/otsu.cc b/scribo/src/binarization/otsu.cc
index 7673363..ebd5da4 100644
--- a/scribo/src/binarization/otsu.cc
+++ b/scribo/src/binarization/otsu.cc
@@ -83,6 +83,7 @@ int main(int argc, char *argv[])
trace::entering("main");
bool verbose = options.is_set("verbose");
+ (void) verbose;
image2d<value::rgb8> input;
io::magick::load(input, options.arg("input.*"));
--
1.7.2.5
Show replies by date