* scribo/binarization/internal/first_pass_functor.hh,
* scribo/binarization/sauvola_ms.hh,
* scribo/core/component_info.hh,
* scribo/core/init_integral_image.hh,
* scribo/core/tag/component.hh,
* scribo/core/tag/line.hh,
* scribo/io/xml/save.hh,
* scribo/make/debug_filename.hh,
* scribo/preprocessing/deskew.hh,
* scribo/preprocessing/split_bg_fg.hh,
* scribo/primitive/extract/separators_nonvisible.hh,
* scribo/primitive/link/internal/dmax_default.hh,
* scribo/primitive/link/internal/dmax_width_and_height.hh,
* scribo/primitive/link/internal/dmax_width_only.hh,
* scribo/text/merging.hh,
* scribo/text/recognition.hh: Here.
---
scribo/ChangeLog | 21 +++
.../binarization/internal/first_pass_functor.hh | 142 +++++++++++---------
scribo/scribo/binarization/sauvola_ms.hh | 2 +
scribo/scribo/core/component_info.hh | 17 +++-
scribo/scribo/core/init_integral_image.hh | 16 ++-
scribo/scribo/core/tag/component.hh | 2 +
scribo/scribo/core/tag/line.hh | 3 +
scribo/scribo/io/xml/save.hh | 3 +
scribo/scribo/make/debug_filename.hh | 3 +
scribo/scribo/preprocessing/deskew.hh | 5 +
scribo/scribo/preprocessing/split_bg_fg.hh | 6 +-
.../primitive/extract/separators_nonvisible.hh | 65 +++++-----
.../scribo/primitive/link/internal/dmax_default.hh | 1 +
.../link/internal/dmax_width_and_height.hh | 2 +
.../primitive/link/internal/dmax_width_only.hh | 2 +
scribo/scribo/text/merging.hh | 3 +
scribo/scribo/text/recognition.hh | 2 -
17 files changed, 196 insertions(+), 99 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 579f31e..a1025f2 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,26 @@
2010-12-10 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix missing inlines and MLN_WO_GLOBALS_VARS guards in Scribo.
+
+ * scribo/binarization/internal/first_pass_functor.hh,
+ * scribo/binarization/sauvola_ms.hh,
+ * scribo/core/component_info.hh,
+ * scribo/core/init_integral_image.hh,
+ * scribo/core/tag/component.hh,
+ * scribo/core/tag/line.hh,
+ * scribo/io/xml/save.hh,
+ * scribo/make/debug_filename.hh,
+ * scribo/preprocessing/deskew.hh,
+ * scribo/preprocessing/split_bg_fg.hh,
+ * scribo/primitive/extract/separators_nonvisible.hh,
+ * scribo/primitive/link/internal/dmax_default.hh,
+ * scribo/primitive/link/internal/dmax_width_and_height.hh,
+ * scribo/primitive/link/internal/dmax_width_only.hh,
+ * scribo/text/merging.hh,
+ * scribo/text/recognition.hh: Here.
+
+2010-12-10 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix guards and license in xml2doc.
* demo/xml2doc/image_crop.cc,
diff --git a/scribo/scribo/binarization/internal/first_pass_functor.hh
b/scribo/scribo/binarization/internal/first_pass_functor.hh
index 637ff39..fb52be5 100644
--- a/scribo/scribo/binarization/internal/first_pass_functor.hh
+++ b/scribo/scribo/binarization/internal/first_pass_functor.hh
@@ -27,6 +27,10 @@
#ifndef SCRIBO_BINARIZATION_INTERNAL_FIRST_PASS_FUNCTOR_HH
# define SCRIBO_BINARIZATION_INTERNAL_FIRST_PASS_FUNCTOR_HH
+/// \file
+///
+///
+
# include <mln/core/image/image2d.hh>
# include <mln/core/alias/neighb2d.hh>
# include <mln/extension/fill.hh>
@@ -48,15 +52,6 @@ namespace scribo
using namespace mln;
- unsigned my_find_root(image2d<unsigned>& parent, unsigned x)
- {
- if (parent.element(x) == x)
- return x;
- return parent.element(x) = my_find_root(parent,
- parent.element(x));
- }
-
-
template <typename I>
struct first_pass_functor
{
@@ -73,74 +68,99 @@ namespace scribo
double K_;
- first_pass_functor(const I& input, double K)
- : input(input),
- pxl(input),
- K_(K)
- {
- res = 0;
- pxl.start();
+ first_pass_functor(const I& input, double K);
+
+ void exec(double mean, double stddev);
+ void finalize();
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ unsigned my_find_root(image2d<unsigned>& parent, unsigned x)
+ {
+ if (parent.element(x) == x)
+ return x;
+ return parent.element(x) = my_find_root(parent,
+ parent.element(x));
+ }
+
- initialize(t_sub, input);
- initialize(parent, input);
- initialize(msk, input);
+ template <typename I>
+ first_pass_functor<I>::first_pass_functor(const I& input, double K)
+ : input(input),
+ pxl(input),
+ K_(K)
+ {
+ res = 0;
+ pxl.start();
+
+ initialize(t_sub, input);
+ initialize(parent, input);
+ initialize(msk, input);
# ifdef SCRIBO_SAUVOLA_DEBUG
- initialize(debug_mean, input);
- initialize(debug_stddev, input);
+ initialize(debug_mean, input);
+ initialize(debug_stddev, input);
# endif // ! SCRIBO_SAUVOLA_DEBUG
- mln::extension::fill(msk, false);
+ mln::extension::fill(msk, false);
- initialize(card, input);
- data::fill(card, 1);
+ initialize(card, input);
+ data::fill(card, 1);
- dp = negative_offsets_wrt(input, c4());
- n_nbhs = dp.nelements();
- }
+ dp = negative_offsets_wrt(input, c4());
+ n_nbhs = dp.nelements();
+ }
- void exec(double mean, double stddev)
- {
- mln_precondition(pxl.is_valid());
- unsigned p = pxl.offset();
+ template <typename I>
+ void
+ first_pass_functor<I>::exec(double mean, double stddev)
+ {
+ mln_precondition(pxl.is_valid());
- value::int_u8 t_p;
- mln::convert::from_to(sauvola_threshold_formula(mean, stddev,
- K_,
- SCRIBO_DEFAULT_SAUVOLA_R),
- t_p);
+ unsigned p = pxl.offset();
- msk.element(p) = input.element(p) < t_p;
- t_sub.element(p) = t_p;
- if (! msk.element(p))
- {
- pxl.next();
- return;
- }
- parent.element(p) = p;
- for (unsigned i = 0; i < n_nbhs; ++i)
- {
- unsigned n = p + dp[i];
- if (! msk.element(n))
- continue;
- unsigned r = my_find_root(parent, n);
- if (r != p)
- {
- parent.element(r) = p;
- card.element(p) += card.element(r);
- }
- }
+ value::int_u8 t_p;
+ mln::convert::from_to(sauvola_threshold_formula(mean, stddev,
+ K_,
+ SCRIBO_DEFAULT_SAUVOLA_R),
+ t_p);
- pxl.next(); // next pixel
+ msk.element(p) = input.element(p) < t_p;
+ t_sub.element(p) = t_p;
+ if (! msk.element(p))
+ {
+ pxl.next();
+ return;
}
-
- void finalize()
+ parent.element(p) = p;
+ for (unsigned i = 0; i < n_nbhs; ++i)
{
- mln_assertion(! pxl.is_valid());
+ unsigned n = p + dp[i];
+ if (! msk.element(n))
+ continue;
+ unsigned r = my_find_root(parent, n);
+ if (r != p)
+ {
+ parent.element(r) = p;
+ card.element(p) += card.element(r);
+ }
}
- };
+ pxl.next(); // next pixel
+ }
+
+
+ template <typename I>
+ void first_pass_functor<I>::finalize()
+ {
+ mln_assertion(! pxl.is_valid());
+ }
+
+#endif // ! MLN_INCLUDE_ONLY
} // end of namespace scribo::binarization::internal
diff --git a/scribo/scribo/binarization/sauvola_ms.hh
b/scribo/scribo/binarization/sauvola_ms.hh
index a6b3aba..1233d1c 100644
--- a/scribo/scribo/binarization/sauvola_ms.hh
+++ b/scribo/scribo/binarization/sauvola_ms.hh
@@ -132,6 +132,7 @@ namespace scribo
}
+ inline
image2d<int_u8>
compute_t_n_and_e_2(const image2d<int_u8>& sub,
image2d<int_u8>& e_2,
unsigned lambda_min, unsigned lambda_max,
@@ -746,6 +747,7 @@ namespace scribo
+ inline
unsigned sub(unsigned nbr, unsigned down_scaling)
{
return (nbr + down_scaling - 1) / down_scaling;
diff --git a/scribo/scribo/core/component_info.hh b/scribo/scribo/core/component_info.hh
index 56f7799..8345266 100644
--- a/scribo/scribo/core/component_info.hh
+++ b/scribo/scribo/core/component_info.hh
@@ -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.
//
@@ -94,6 +95,7 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
+ inline
component_info::component_info()
: id_(0), tag_(component::Ignored)
{
@@ -101,6 +103,7 @@ namespace scribo
}
+ inline
component_info::component_info(const component_id_t& id,
const mln::box2d& bbox,
const mln::point2d& mass_center,
@@ -112,6 +115,7 @@ namespace scribo
}
+ inline
component_info::component_id_t
component_info::id() const
{
@@ -119,6 +123,7 @@ namespace scribo
}
+ inline
const mln::box2d&
component_info::bbox() const
{
@@ -126,12 +131,14 @@ namespace scribo
}
+ inline
const mln::point2d&
component_info::mass_center() const
{
return mass_center_;
}
+ inline
unsigned
component_info::card() const
{
@@ -139,6 +146,7 @@ namespace scribo
}
+ inline
component::Tag
component_info::tag() const
{
@@ -146,6 +154,7 @@ namespace scribo
}
+ inline
void
component_info::update_tag(component::Tag tag)
{
@@ -153,6 +162,7 @@ namespace scribo
}
+ inline
component::Type
component_info::type() const
{
@@ -160,6 +170,7 @@ namespace scribo
}
+ inline
void
component_info::update_type(component::Type type)
{
@@ -167,12 +178,15 @@ namespace scribo
}
+ inline
component_info::line_id_t
component_info::line_id() const
{
return line_id_;
}
+
+ inline
bool
component_info::is_valid() const
{
@@ -180,6 +194,7 @@ namespace scribo
}
+ inline
std::ostream&
operator<<(std::ostream& ostr, const component_info& info)
{
diff --git a/scribo/scribo/core/init_integral_image.hh
b/scribo/scribo/core/init_integral_image.hh
index ec19070..5bd88dc 100644
--- a/scribo/scribo/core/init_integral_image.hh
+++ b/scribo/scribo/core/init_integral_image.hh
@@ -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.
//
@@ -37,15 +38,24 @@ namespace scribo
using namespace mln;
+ template <typename I, typename F>
+ mln_ch_value(I,double)
+ init_integral_image(const Image<I>& input_, F& func);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
namespace internal
{
+ inline
double square_(const double& val)
{
double v = static_cast<double>(val);
return v * v;
}
+ inline
double identity_(const double& val)
{
return static_cast<double>(val);
@@ -54,6 +64,8 @@ namespace scribo
} // end of namespace scribo::internal
+ // Facade
+
template <typename I, typename F>
mln_ch_value(I,double)
init_integral_image(const Image<I>& input_, F& func)
@@ -91,6 +103,8 @@ namespace scribo
return output;
}
+#endif // ! MLN_INCLUDE_ONLY
+
} // end of namespace scribo
#endif // ! SCRIBO_CORE_INIT_INTEGRAL_IMAGE_HH
diff --git a/scribo/scribo/core/tag/component.hh b/scribo/scribo/core/tag/component.hh
index 5ed51fa..f2fb059 100644
--- a/scribo/scribo/core/tag/component.hh
+++ b/scribo/scribo/core/tag/component.hh
@@ -63,6 +63,7 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
+ inline
std::ostream&
operator<<(std::ostream& ostr, const Tag& tag)
{
@@ -82,6 +83,7 @@ namespace scribo
}
+ inline
std::ostream&
operator<<(std::ostream& ostr, const Type& type)
{
diff --git a/scribo/scribo/core/tag/line.hh b/scribo/scribo/core/tag/line.hh
index ccb8cd1..0444a11 100644
--- a/scribo/scribo/core/tag/line.hh
+++ b/scribo/scribo/core/tag/line.hh
@@ -101,6 +101,7 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
+ inline
std::ostream&
operator<<(std::ostream& ostr, const Tag& tag)
{
@@ -130,6 +131,7 @@ namespace scribo
+ inline
std::ostream&
operator<<(std::ostream& ostr, const ReadingDirection& direction)
{
@@ -155,6 +157,7 @@ namespace scribo
}
+ inline
std::ostream&
operator<<(std::ostream& ostr, const Type& type)
{
diff --git a/scribo/scribo/io/xml/save.hh b/scribo/scribo/io/xml/save.hh
index 3c182e7..d0c72e9 100644
--- a/scribo/scribo/io/xml/save.hh
+++ b/scribo/scribo/io/xml/save.hh
@@ -70,6 +70,8 @@ namespace scribo
namespace internal
{
+
+ inline
std::string&
html_markups_replace(std::string& input,
std::map<char, std::string>& map)
@@ -87,6 +89,7 @@ namespace scribo
}
+ inline
void print_box_coords(std::ofstream& ostr, const box2d& b,
const char *space)
{
diff --git a/scribo/scribo/make/debug_filename.hh b/scribo/scribo/make/debug_filename.hh
index 0aadbfe..f3b4962 100644
--- a/scribo/scribo/make/debug_filename.hh
+++ b/scribo/scribo/make/debug_filename.hh
@@ -59,6 +59,7 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
namespace internal
{
@@ -67,6 +68,8 @@ namespace scribo
} // end of namespace scribo::make::internal
+# endif // ! MLN_WO_GLOBAL_VARS
+
inline
std::string
diff --git a/scribo/scribo/preprocessing/deskew.hh
b/scribo/scribo/preprocessing/deskew.hh
index 80ea351..12fd104 100644
--- a/scribo/scribo/preprocessing/deskew.hh
+++ b/scribo/scribo/preprocessing/deskew.hh
@@ -115,6 +115,7 @@ namespace scribo
namespace internal
{
+ inline
bool
QCompare::operator()(const s_angle& s1, const s_angle& s2)
{
@@ -122,6 +123,7 @@ namespace scribo
}
+ inline
Hough::Hough(int width, int height)
: width_(width / 2),
height_(height / 2),
@@ -135,12 +137,14 @@ namespace scribo
}
+ inline
Hough::~Hough()
{
delete[] this->cos_;
delete[] this->sin_;
}
+
inline
void Hough::look_up_table()
{
@@ -336,6 +340,7 @@ namespace scribo
}
+ inline
double
perform_deskew(const image2d<value::int_u8>& gray)
{
diff --git a/scribo/scribo/preprocessing/split_bg_fg.hh
b/scribo/scribo/preprocessing/split_bg_fg.hh
index 5094f32..e1fae7d 100644
--- a/scribo/scribo/preprocessing/split_bg_fg.hh
+++ b/scribo/scribo/preprocessing/split_bg_fg.hh
@@ -189,7 +189,7 @@ namespace scribo
}
-
+ inline
image2d< value::rgb8 >
diff_abs(const image2d< value::rgb8 >& input1,
const image2d< value::rgb8 >& input2)
@@ -207,6 +207,7 @@ namespace scribo
}
+ inline
image2d< value::rgb8 >
inverted_diff_abs(const image2d< value::rgb8 >& input1,
const image2d< value::rgb8 >& input2)
@@ -228,7 +229,7 @@ namespace scribo
}
-
+ inline
unsigned dist(const rgb8& c1, const rgb8& c2)
{
unsigned d = 0;
@@ -239,6 +240,7 @@ namespace scribo
}
+ inline
image2d<rgb8>
background_analyze(const image2d<rgb8>& input,
unsigned lambda, unsigned delta)
diff --git a/scribo/scribo/primitive/extract/separators_nonvisible.hh
b/scribo/scribo/primitive/extract/separators_nonvisible.hh
index 8aaeeec..81ebd64 100644
--- a/scribo/scribo/primitive/extract/separators_nonvisible.hh
+++ b/scribo/scribo/primitive/extract/separators_nonvisible.hh
@@ -128,10 +128,6 @@ namespace scribo
namespace internal
{
- // Enable debug.
- bool _debug_;
-
-
template <typename L>
void filter_bad_groups(object_groups<L>& top_groups,
object_groups<L>& bot_groups)
@@ -223,13 +219,15 @@ namespace scribo
unsigned dmax,
float min_angle,
float max_angle,
- anchor::Type anchor_)
+ anchor::Type anchor_,
+ bool debug)
: super_(components,
anchor::Horizontal,
dmax_default(dmax)),
anchor(anchor_),
debug_(data::convert(value::rgb8(), input)),
- debug_angle_(data::convert(value::rgb8(), input))
+ debug_angle_(data::convert(value::rgb8(), input)),
+ _debug_(debug)
{
min_alpha_rad = (min_angle / 180.0f) * math::pi;
max_alpha_rad = (max_angle / 180.0f) * math::pi;
@@ -372,6 +370,7 @@ namespace scribo
mln_ch_value(L, value::rgb8) debug_;
mln_ch_value(L, value::rgb8) debug_angle_;
+ bool _debug_;
};
@@ -391,8 +390,9 @@ namespace scribo
unsigned dmax,
float min_angle,
float max_angle,
- anchor::Type anchor)
- : super_(input, components, dmax, min_angle, max_angle, anchor)
+ anchor::Type anchor,
+ bool debug)
+ : super_(input, components, dmax, min_angle, max_angle, anchor, debug)
{
}
@@ -425,8 +425,9 @@ namespace scribo
unsigned dmax,
float min_angle,
float max_angle,
- anchor::Type anchor)
- : super_(input, components, dmax, min_angle, max_angle, anchor)
+ anchor::Type anchor,
+ bool debug)
+ : super_(input, components, dmax, min_angle, max_angle, anchor, debug)
{
}
@@ -459,7 +460,7 @@ namespace scribo
typedef mln_value(I) Vi;
mlc_is(Vi,bool)::check();
- internal::_debug_ = false;
+ bool _debug_ = false;
unsigned
min_angle = 3,
max_angle = 5,
@@ -497,7 +498,7 @@ namespace scribo
t_ = t;
std::cout << "closing_structural - " << t_ << std::endl;
- if (internal::_debug_)
+ if (_debug_)
{
// Restore input orientation.
input = scribo::preprocessing::rotate_90(input, false);
@@ -525,7 +526,7 @@ namespace scribo
t_ = t;
std::cout << "extract::components - " << t_ << std::endl;
- if (internal::_debug_)
+ if (_debug_)
io::pgm::save(data::convert(value::int_u8(), components.labeled_image()),
"lbl.pgm");
@@ -542,14 +543,14 @@ namespace scribo
{
// Right
internal::single_right_dmax_ratio_aligned_functor<L>
- functor(input_clo, components, dmax, min_angle, max_angle, anchor::Top);
+ functor(input_clo, components, dmax, min_angle, max_angle, anchor::Top, _debug_);
// top_right = primitive::link::impl::compute_fastest(functor, anchor::Top);
top_right = primitive::link::compute(functor, anchor::Top);
t.stop();
- if (internal::_debug_)
+ if (_debug_)
{
io::ppm::save(functor.debug_, "right_top.ppm");
io::ppm::save(functor.debug_angle_, "right_top_angle.ppm");
@@ -559,13 +560,13 @@ namespace scribo
// Left
internal::single_left_dmax_ratio_aligned_functor<L>
- lfunctor(input_clo, components, dmax, min_angle, max_angle, anchor::Top);
+ lfunctor(input_clo, components, dmax, min_angle, max_angle, anchor::Top, _debug_);
top_left = primitive::link::compute(lfunctor, anchor::Top);
t.stop();
- if (internal::_debug_)
+ if (_debug_)
{
io::ppm::save(lfunctor.debug_, "left_top.ppm");
io::ppm::save(lfunctor.debug_angle_, "left_top_angle.ppm");
@@ -584,11 +585,11 @@ namespace scribo
{
// Right
internal::single_right_dmax_ratio_aligned_functor<L>
- functor(input_clo, components, dmax, min_angle, max_angle, anchor::Bottom);
+ functor(input_clo, components, dmax, min_angle, max_angle, anchor::Bottom,
_debug_);
bot_right = primitive::link::compute(functor, anchor::Bottom);
t.stop();
- if (internal::_debug_)
+ if (_debug_)
{
io::ppm::save(functor.debug_, "right_bot.ppm");
io::ppm::save(functor.debug_angle_, "right_bot_angle.ppm");
@@ -598,17 +599,17 @@ namespace scribo
// Left
internal::single_left_dmax_ratio_aligned_functor<L>
- lfunctor(input_clo, components, dmax, min_angle, max_angle, anchor::Bottom);
+ lfunctor(input_clo, components, dmax, min_angle, max_angle, anchor::Bottom,
_debug_);
bot_left = primitive::link::compute(lfunctor, anchor::Bottom);
t.stop();
- if (internal::_debug_)
+ if (_debug_)
{
io::ppm::save(lfunctor.debug_, "left_bot.ppm");
io::ppm::save(lfunctor.debug_angle_, "left_bot_angle.ppm");
}
- if (internal::_debug_)
+ if (_debug_)
{
mln_ch_value(I, value::rgb8) output = duplicate(functor.debug_);
data::paste((lfunctor.debug_ | (pw::value(lfunctor.debug_) !=
pw::cst(literal::black))) | (pw::value(lfunctor.debug_) != pw::cst(literal::white)),
output);
@@ -648,7 +649,7 @@ namespace scribo
- if (internal::_debug_)
+ if (_debug_)
{
mln_ch_value(I, value::rgb8)
@@ -721,7 +722,7 @@ namespace scribo
mln_ch_value(I, value::rgb8) both;
- if (internal::_debug_)
+ if (_debug_)
both = data::convert(value::rgb8(), input);
@@ -733,7 +734,7 @@ namespace scribo
{
if (top_accu(d).is_valid())
{
- if (internal::_debug_)
+ if (_debug_)
mln::draw::line(both,
top_accu(d).to_result().pmin(),
point2d(top_accu(d).to_result().pmin().row(),
@@ -747,7 +748,7 @@ namespace scribo
true);
}
else
- if (internal::_debug_ && btop_accu(d).is_valid())
+ if (_debug_ && btop_accu(d).is_valid())
mln::draw::line(both,
btop_accu(d).to_result().pmin(),
point2d(btop_accu(d).to_result().pmin().row(),
@@ -759,7 +760,7 @@ namespace scribo
{
if (bot_accu(d).is_valid())
{
- if (internal::_debug_)
+ if (_debug_)
mln::draw::line(both,
point2d(bot_accu(d).to_result().pmax().row(),
bot_accu(d).to_result().pmin().col()),
@@ -773,7 +774,7 @@ namespace scribo
true);
}
else
- if (internal::_debug_ && bbot_accu(d).is_valid())
+ if (_debug_ && bbot_accu(d).is_valid())
mln::draw::line(both,
point2d(bbot_accu(d).to_result().pmax().row(),
bbot_accu(d).to_result().pmin().col()),
@@ -786,7 +787,7 @@ namespace scribo
std::cout << "Drawing output image - " << t_ << std::endl;
- if (internal::_debug_)
+ if (_debug_)
{
io::ppm::save(both, "both.ppm");
io::pbm::save(separators, "separators.pbm");
@@ -795,7 +796,7 @@ namespace scribo
// Hit or miss
{
- if (internal::_debug_)
+ if (_debug_)
{
mln_concrete(I) input_with_seps = duplicate(input_clo);
data::paste(separators | pw::value(separators), input_with_seps);
@@ -821,7 +822,7 @@ namespace scribo
t_ = t;
std::cout << "* accu::transform_line - " << t_ <<
std::endl;
- if (internal::_debug_)
+ if (_debug_)
io::pgm::save(data::convert(value::int_u8(), tmp), "tmp.pgm");
@@ -869,7 +870,7 @@ namespace scribo
mln_concrete(I) output = data::convert(bool(), sep_lbl);
- if (internal::_debug_)
+ if (_debug_)
{
io::pbm::save(output, "separators_hom.pbm");
io::pbm::save(separators, "separators_filtered.pbm");
diff --git a/scribo/scribo/primitive/link/internal/dmax_default.hh
b/scribo/scribo/primitive/link/internal/dmax_default.hh
index 1444dfe..b4106a9 100644
--- a/scribo/scribo/primitive/link/internal/dmax_default.hh
+++ b/scribo/scribo/primitive/link/internal/dmax_default.hh
@@ -62,6 +62,7 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
+ inline
dmax_default::dmax_default(const float& dmax_factor)
: super_(dmax_factor)
{
diff --git a/scribo/scribo/primitive/link/internal/dmax_width_and_height.hh
b/scribo/scribo/primitive/link/internal/dmax_width_and_height.hh
index 3f19f1f..4c1d561 100644
--- a/scribo/scribo/primitive/link/internal/dmax_width_and_height.hh
+++ b/scribo/scribo/primitive/link/internal/dmax_width_and_height.hh
@@ -66,12 +66,14 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
+ inline
dmax_width_and_height::dmax_width_and_height(const float& dmax_factor)
: super_(dmax_factor)
{
}
+ inline
float
dmax_width_and_height::operator()(const box2d& b) const
{
diff --git a/scribo/scribo/primitive/link/internal/dmax_width_only.hh
b/scribo/scribo/primitive/link/internal/dmax_width_only.hh
index 034d40b..1d882ba 100644
--- a/scribo/scribo/primitive/link/internal/dmax_width_only.hh
+++ b/scribo/scribo/primitive/link/internal/dmax_width_only.hh
@@ -66,12 +66,14 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
+ inline
dmax_width_only::dmax_width_only()
: super_(0)
{
}
+ inline
float
dmax_width_only::operator()(const box2d& b) const
{
diff --git a/scribo/scribo/text/merging.hh b/scribo/scribo/text/merging.hh
index ed48e57..3087465 100644
--- a/scribo/scribo/text/merging.hh
+++ b/scribo/scribo/text/merging.hh
@@ -150,6 +150,7 @@ namespace scribo
+ inline
unsigned my_find_root(mln::util::array<unsigned>& parent, unsigned x)
{
if (parent[x] == x)
@@ -158,6 +159,7 @@ namespace scribo
}
+ inline
void swap_ordering(unsigned l1, unsigned l2)
{
if (l2 > l1)
@@ -211,6 +213,7 @@ namespace scribo
+ inline
box2d enlarge(const box2d& b, int delta)
{
box2d b_(point2d(b.pmin().row(), b.pmin().col() - delta),
diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh
index 07f585d..ab5e3e2 100644
--- a/scribo/scribo/text/recognition.hh
+++ b/scribo/scribo/text/recognition.hh
@@ -99,8 +99,6 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
- unsigned debug_id = 0;
-
template <typename L>
void
--
1.5.6.5