olena-2.0-221-g6c791fe Fix various warnings.

* scribo/binarization/otsu_threshold.hh: Fix comparisons between different types. * scribo/io/xml/load.hh: Convert to float. * scribo/text/paragraphs_closing.hh, * scribo/text/recognition.hh, * src/afp/components.hh: Remove unused variables. * src/binarization/otsu.cc: Silent warning. * src/misc/morpho.cc: Check number of arguments. --- scribo/ChangeLog | 17 +++++++++++++++++ scribo/scribo/binarization/otsu_threshold.hh | 7 ++++--- scribo/scribo/io/xml/load.hh | 2 +- scribo/scribo/text/paragraphs_closing.hh | 5 +---- scribo/scribo/text/recognition.hh | 2 -- scribo/src/afp/components.hh | 6 +++--- scribo/src/binarization/otsu.cc | 4 +++- scribo/src/misc/morpho.cc | 9 ++++++++- 8 files changed, 37 insertions(+), 15 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index c9d045a..37b1518 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,22 @@ 2013-02-26 Guillaume Lazzara <z@lrde.epita.fr> + Fix various warnings. + + * scribo/binarization/otsu_threshold.hh: Fix comparisons between + different types. + + * scribo/io/xml/load.hh: Convert to float. + + * scribo/text/paragraphs_closing.hh, + * scribo/text/recognition.hh, + * src/afp/components.hh: Remove unused variables. + + * src/binarization/otsu.cc: Silent warning. + + * src/misc/morpho.cc: Check number of arguments. + +2013-02-26 Guillaume Lazzara <z@lrde.epita.fr> + * common.mk: Fix include paths order. 2012-11-27 Guillaume Lazzara <z@lrde.epita.fr> diff --git a/scribo/scribo/binarization/otsu_threshold.hh b/scribo/scribo/binarization/otsu_threshold.hh index ab663d0..526b801 100644 --- a/scribo/scribo/binarization/otsu_threshold.hh +++ b/scribo/scribo/binarization/otsu_threshold.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2011, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -78,7 +79,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 +90,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]; diff --git a/scribo/scribo/io/xml/load.hh b/scribo/scribo/io/xml/load.hh index 62ad4a2..0ba7aab 100644 --- a/scribo/scribo/io/xml/load.hh +++ b/scribo/scribo/io/xml/load.hh @@ -284,7 +284,7 @@ namespace scribo line_data = new scribo::internal::line_info_data<L>(lines, mln::util::array<component_id_t>()); line_data->text_ = atts.value("text").toUtf8().constData(); - line_data->text_confidence_ = atts.value("textConfidence").toUtf8().constData(); + line_data->text_confidence_ = atof(atts.value("textConfidence").toUtf8().constData()); line_data->hidden_ = false; line_data->tag_ = static_cast<line::Tag>(atts.value("tag").toInt()); diff --git a/scribo/scribo/text/paragraphs_closing.hh b/scribo/scribo/text/paragraphs_closing.hh index e513970..e29e1c8 100644 --- a/scribo/scribo/text/paragraphs_closing.hh +++ b/scribo/scribo/text/paragraphs_closing.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Copyright (C) 2009, 2010, 2011, 2013 EPITA Research and Development // Laboratory (LRDE) // // This file is part of Olena. @@ -209,7 +209,6 @@ namespace scribo const paragraph_info<L>& current_par = parset(p); const mln::util::array<line_id_t>& line_ids = current_par.line_ids(); - line_id_t last_id = line_ids[0]; for_all_elements(i, line_ids) { const line_id_t& line_id = line_ids(i); @@ -233,8 +232,6 @@ namespace scribo last_comp = c; } - // mln::draw::line(debug, current_line.bbox().pcenter(), lines(last_id).bbox().pcenter(), p); - // last_id = line_id; } int delta_baseline = current_par.delta_baseline(); diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh index b5e48f1..27cea10 100644 --- a/scribo/scribo/text/recognition.hh +++ b/scribo/scribo/text/recognition.hh @@ -385,8 +385,6 @@ namespace scribo if (!output_file.empty()) file.open(output_file.c_str()); - mln_domain(I) box = line.domain(); - // Recognize characters. char* s = tess.TesseractRect( (unsigned char*) &line(line.domain().pmin()), diff --git a/scribo/src/afp/components.hh b/scribo/src/afp/components.hh index f8a67e6..7e4e102 100644 --- a/scribo/src/afp/components.hh +++ b/scribo/src/afp/components.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2010, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -132,7 +133,7 @@ namespace mln image2d<info> data; image2d<V> label; V current_label = 0; - int N, dp_border; + int dp_border; // util::timer time; // time.start(); @@ -140,7 +141,6 @@ namespace mln // init { extension::adjust(input, nbh); - N = input.nelements(); dp_border = 2 * input.border(); extension::fill(input, false); initialize(data, input); diff --git a/scribo/src/binarization/otsu.cc b/scribo/src/binarization/otsu.cc index 7673363..38c217a 100644 --- a/scribo/src/binarization/otsu.cc +++ b/scribo/src/binarization/otsu.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2011, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -83,6 +84,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.*")); diff --git a/scribo/src/misc/morpho.cc b/scribo/src/misc/morpho.cc index cdab36e..3c6dd21 100644 --- a/scribo/src/misc/morpho.cc +++ b/scribo/src/misc/morpho.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2013 EPITA Research and Development Laboratory +// (LRDE) // // This file is part of Olena. // @@ -61,6 +62,12 @@ int main(int argc, char *argv[]) using value::label_8; using value::rgb8; + if (argc != 2) + { + std::cout << "Usage: " << argv[0] << " <input.pbm>" << std::endl; + return 1; + } + image2d<bool> input; io::pbm::load(input, argv[1]); -- 1.7.2.5
participants (1)
-
Guillaume Lazzara