Commit c043808b authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Negate Sauvola's result.

	* scribo/binarization/local_threshold.hh,
	* scribo/binarization/sauvola_ms.hh: Invert threshold test.

	* src/text_in_picture.cc: Do not negate Sauvola's output anymore.
parent e102484e
2010-10-11 Guillaume Lazzara <z@lrde.epita.fr>
Negate Sauvola's result.
* scribo/binarization/local_threshold.hh,
* scribo/binarization/sauvola_ms.hh: Invert threshold test.
* src/text_in_picture.cc: Do not negate Sauvola's output anymore.
2010-10-21 Guillaume Lazzara <z@lrde.epita.fr>
Small fixes in Scribo
......
......@@ -110,7 +110,7 @@ namespace scribo
mln_piter(I) p(input.domain());
for_all(p)
output(p) = (input(p) >= threshold(p));
output(p) = (input(p) <= threshold(p));
trace::exiting("scribo::binarization::impl::generic::local_threshold");
......@@ -140,7 +140,7 @@ namespace scribo
mln_pixter(const T) pt(threshold);
mln_pixter(O) po(output);
for_all_3(pi, pt, po)
po.val() = pi.val() >= pt.val();
po.val() = pi.val() <= pt.val();
trace::exiting("scribo::binarization::impl::generic::local_threshold_fastest");
return output;
......
......@@ -330,20 +330,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -354,20 +354,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1b; ptr__in += delta1b;
}
......@@ -378,20 +378,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -403,20 +403,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1c; ptr__in += delta1c;
}
......@@ -432,20 +432,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -456,20 +456,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1b; ptr__in += delta1b;
}
......@@ -480,20 +480,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -504,20 +504,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1d; ptr__in += delta1d;
}
......@@ -533,20 +533,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -557,20 +557,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1b; ptr__in += delta1b;
}
......@@ -581,20 +581,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -605,20 +605,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1c; ptr__in += delta1c;
}
......@@ -634,20 +634,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -658,20 +658,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1b; ptr__in += delta1b;
}
......@@ -682,20 +682,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1f; ptr__in += delta1f;
}
......@@ -706,20 +706,20 @@ namespace scribo
{
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1; ptr__in += delta1;
}
for (unsigned j = 1; j < s; ++j)
{
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
++ptr__out; ++ptr__in;
}
*ptr__out = *ptr__in >= threshold;
*ptr__out = *ptr__in <= threshold;
ptr__out += delta1e; ptr__in += delta1e;
}
}
......
......@@ -298,8 +298,6 @@ int main(int argc, char* argv[])
#endif // !NOUT
logical::not_inplace(input);
// if (debug)
// io::pbm::save(input, "input.pbm");
t_ = timer_;
......
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