Commit 5dd49fd5 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

scribo/binarization/sauvola_ms.hh: Add a new overload and preconditions.

parent 16506fd4
2013-03-20 Guillaume Lazzara <z@lrde.epita.fr>
* scribo/binarization/sauvola_ms.hh: Add a new overload and
preconditions.
2013-03-20 Guillaume Lazzara <z@lrde.epita.fr>
Improve documentation layout.
......
......@@ -148,6 +148,13 @@ namespace scribo
sauvola_ms(const Image<I>& input_1, unsigned w_1, unsigned s,
double k2, double k3, double k4);
/// \overload
/// Allow to specify the same k parameter for all scales.
//
template <typename I>
mln_ch_value(I,bool)
sauvola_ms(const Image<I>& input_1, unsigned w_1, unsigned s,
double all_k);
# ifndef MLN_INCLUDE_ONLY
......@@ -1019,6 +1026,8 @@ namespace scribo
mln_trace("scribo::binarization::sauvola_ms");
mln_precondition(exact(input_1_).is_valid());
mln_precondition(s > 1);
// Gray level images ONLY.
mlc_is_not_a(mln_value(I), value::Vectorial)::check();
mlc_is_not(mln_value(I), bool)::check();
......@@ -1037,6 +1046,8 @@ namespace scribo
mln_trace("scribo::binarization::sauvola_ms");
mln_precondition(exact(input_1_).is_valid());
mln_precondition(s > 1);
// Gray level images ONLY.
mlc_is_not_a(mln_value(I), value::Vectorial)::check();
mlc_is_not(mln_value(I), bool)::check();
......@@ -1064,6 +1075,19 @@ namespace scribo
}
template <typename I>
mln_ch_value(I,bool)
sauvola_ms(const Image<I>& input_1, unsigned w_1, unsigned s,
double all_k)
{
binarization::internal::k2 = all_k;
binarization::internal::k3 = all_k;
binarization::internal::k4 = all_k;
return sauvola_ms(input_1, w_1, s);
}
# endif // ! MLN_INCLUDE_ONLY
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment