---
scribo/ChangeLog | 7 +++++++
scribo/scribo/binarization/otsu_threshold.hh | 6 +++---
scribo/src/binarization/otsu.cc | 1 +
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index d5671d3..4fed8d3 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,12 @@
2012-08-23 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix warning in Otsu related files.
+
+ * scribo/binarization/otsu_threshold.hh,
+ * src/binarization/otsu.cc: Here.
+
+2012-08-23 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix and improve sauvola_ms debug.
* scribo/binarization/internal/local_threshold_core.hh,
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/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