Commit 31216d34 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Small fixes.

	* binarization/sauvola_threshold_image.hh: Add ifdefs.

	* core/object_groups.hh: Fix a wrong assertion.

	* postprocessing/fill_object_holes.hh: Disable debug output.

	* preprocessing/denoise_bg.hh: Do not negate the image anymore.
parent db55e631
2010-06-03 Guillaume Lazzara <z@lrde.epita.fr>
Small fixes.
* binarization/sauvola_threshold_image.hh: Add ifdefs.
* core/object_groups.hh: Fix a wrong assertion.
* postprocessing/fill_object_holes.hh: Disable debug output.
* preprocessing/denoise_bg.hh: Do not negate the image anymore.
2010-06-03 Guillaume Lazzara <z@lrde.epita.fr>
Add the binarization tool submitted to H-DIBCO 2010.
......
......@@ -127,7 +127,6 @@ namespace scribo
# endif // ! SCRIBO_SAUVOLA_DEBUG
/*! \brief compute Sauvola's threshold applying directly the formula.
\param[in] m_x_y Mean value.
......@@ -170,20 +169,26 @@ namespace scribo
// if (s_N < 0.1f)
// {
// K_2 = 0.1f;
// # ifdef SCRIBO_SAUVOLA_DEBUG
// dbg_k = 0;
// dbg_s_n = s_N;
// # endif // !SCRIBO_SAUVOLA_DEBUG
// }
// else if (s_N > 0.34)
// {
// K_2 = 0.34;
// # ifdef SCRIBO_SAUVOLA_DEBUG
// dbg_k = 255;
// dbg_s_n = s_N;
// # endif // !SCRIBO_SAUVOLA_DEBUG
// }
// else
// {
// K_2 = s_N;
// # ifdef SCRIBO_SAUVOLA_DEBUG
// dbg_k = 150;
// dbg_s_n = s_N;
// # endif // !SCRIBO_SAUVOLA_DEBUG
// }
......
......@@ -183,7 +183,7 @@ namespace scribo
bool
object_groups<L>::is_valid() const
{
mln_assertion(data_->components_.nelements() == (nelements()));
mln_assertion(data_->components_.nelements() == (nelements() - 1));
return data_->links_.is_valid();
}
......
......@@ -41,7 +41,11 @@
# include <mln/core/routine/extend.hh>
# include <mln/core/image/dmorph/extended.hh>
# include <mln/data/fill.hh>
# include <mln/data/transform.hh>
# include <mln/extension/duplicate.hh>
# include <mln/extension/adjust_fill.hh>
# include <mln/draw/box_plain.hh>
# include <mln/util/array.hh>
......@@ -50,6 +54,14 @@
# include <mln/fun/i2v/array.hh>
# include <mln/value/int_u16.hh>
# include <mln/labeling/blobs_and_compute.hh>
# include <mln/logical/not.hh>
# include <mln/transform/influence_zone_geodesic.hh>
# include <scribo/core/macros.hh>
# include <scribo/core/object_groups.hh>
# include <scribo/primitive/group/apply.hh>
......@@ -331,7 +343,7 @@ namespace scribo
// Holes card Image
std::cout << "> Holes card image" << std::endl;
// std::cout << "> Holes card image" << std::endl;
L nlabels;
......@@ -345,7 +357,7 @@ namespace scribo
// Threshold Image
std::cout << "> Threshold image" << std::endl;
// std::cout << "> Threshold image" << std::endl;
I input_i = logical::not_(input);
......@@ -363,7 +375,7 @@ namespace scribo
// Thresholding
std::cout << "> Thresholding" << std::endl;
// std::cout << "> Thresholding" << std::endl;
I hole_mask;
initialize(hole_mask, holes);
......@@ -376,7 +388,7 @@ namespace scribo
// Cleanup
std::cout << "> Cleanup" << std::endl;
// std::cout << "> Cleanup" << std::endl;
data::fill((output | pw::value(hole_mask)).rw(), false);
......
......@@ -131,11 +131,11 @@ namespace scribo
util::array<unsigned>
result = labeling::compute(accu::meta::math::count(), lbl, nlabels);
mln::fun::i2v::array<bool> f(nlabels + 1, true);
f(0) = false;
mln::fun::i2v::array<bool> f(nlabels + 1, false);
f(0) = true;
for (unsigned i = 1; i <= nlabels; ++i)
if (result(i) < min_card)
f(i) = false;
f(i) = true;
scribo::fun::v2b::label_to_bool<unsigned> relabel_f(f);
mln_concrete(I)
......
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