Closed GoogleCodeExporter closed 9 years ago
I apologize - the "Release 78" refers to ocropus, not tesseract. I just checked
and
Release 31 of tesseract is still 'broken'.
It appears that the version of gcc/g++ on Redhat Enterprise Linux 4.0 optimizes
incorrectly two lines in textord/makerow.cpp such that there is a lock. That
patch
merely adds an intermediate variable and 'prevents' said optimization 'bug'.
I reproduce the patch here so you can see what is changed:
RCS file: /cvsroot/tesseract-ocr/tesseract/textord/makerow.cpp,v
retrieving revision 1.2
diff -u -r1.2 makerow.cpp
--- textord/makerow.cpp 2 Feb 2007 23:47:06 -0000 1.2
+++ textord/makerow.cpp 13 Feb 2007 05:25:52 -0000
@@ -785,6 +785,7 @@
INT32 line_index; //of scan line
float top, bottom; //coords of blob
INT32 width; //of blob
+ INT32 idx;
TO_ROW *row; //current row
TO_ROW_IT row_it = block->get_rows ();
BLOBNBOX *blob; //current blob
@@ -816,13 +817,15 @@
"Bad y coord of bottom, " INT32FORMAT "(" INT32FORMAT ","
INT32FORMAT ")\n", (INT32) floor (bottom), min_y, max_y);
//count transitions
- deltas[(INT32) floor (bottom) - min_y] += width;
+ idx = (INT32) floor (bottom) - min_y;
+ deltas[idx] += width;
if ((INT32) floor (top) < min_y
|| (INT32) floor (top) - min_y >= line_count)
fprintf (stderr,
"Bad y coord of top, " INT32FORMAT "(" INT32FORMAT ","
INT32FORMAT ")\n", (INT32) floor (top), min_y, max_y);
- deltas[(INT32) floor (top) - min_y] -= width;
+ idx = (INT32) floor (top) - min_y;
+ deltas[idx] -= width;
}
}
occupation[0] = deltas[0];
Original comment by fil...@repairfaq.org
on 26 Apr 2007 at 11:51
BTW, I'm not certain that this defect is Priority-Medium as it a) causes 100%
CPU use
on all Redhat Enterprise Linux 4.0 platforms unless compiled without
optimization and
b) is so trivial to completely resolve.
Original comment by fil...@repairfaq.org
on 26 Apr 2007 at 11:53
This is fixed in the subversion repository. Not yet in the tarball.
Original comment by theraysm...@gmail.com
on 17 May 2007 at 8:43
Original comment by theraysm...@gmail.com
on 18 Jul 2007 at 10:27
Original issue reported on code.google.com by
fil...@repairfaq.org
on 22 Apr 2007 at 11:56