mithilesh1125 / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

Assert fails in ColumnFinder::AssignColumns() with PSM_SINGLE_COLUMN mode #653

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Run:

   tesseract eurotext.tif eurotext -psm 4

and will get:

   set_count == gridheight():Error:Assert failed:in file textord\colfind.cpp, line 648

Don't seem to have a problem with pagesegmodes 3, 5, or 6, just pagesegmode 4 
(PSM_SINGLE_COLUMN).

Tracking this down, in textord/colfind.cpp have:

   bool ColumnFinder::MakeColumns(bool single_column) {
     PartSetVector part_sets;
     if (!single_column) {
       ...
     }
     ...
     if (!column_sets_.empty()) {
       // Divide the page into sections of uniform column layout.
>>>    AssignColumns(part_sets);
       if (textord_tabfind_show_columns) {
         DisplayColumnBounds(&part_sets);
       }

and at this point in debugger single_column is True, so part_sets is left 
untouched after initialization. Thus in AssignColumns(),

   void ColumnFinder::AssignColumns(const PartSetVector& part_sets) {
     int set_count = part_sets.size();
     ASSERT_HOST(set_count == gridheight());

set_count = 0 and gridheight() = 22, so the assert fails.

Not sure how to fix this. Presumably something in that block of code that is 
skipped when single_column is True still needs to be done to init part_sets 
correctly.

Original issue reported on code.google.com by tomp2...@gmail.com on 16 Mar 2012 at 4:14

GoogleCodeExporter commented 9 years ago

Original comment by tomp2...@gmail.com on 16 Mar 2012 at 4:16

GoogleCodeExporter commented 9 years ago
Thanks for investigating. Fix will be in 3.02 tarball.

Original comment by theraysm...@gmail.com on 21 Sep 2012 at 12:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Oops.
Fix in r820. Will be in 3.03.

Original comment by theraysm...@gmail.com on 3 Jan 2013 at 7:07

GoogleCodeExporter commented 9 years ago
Issue 1135 has been merged into this issue.

Original comment by zde...@gmail.com on 17 Mar 2014 at 9:17

GoogleCodeExporter commented 9 years ago
Issue 1319 has been merged into this issue.

Original comment by zde...@gmail.com on 21 Sep 2014 at 2:16

GoogleCodeExporter commented 9 years ago
Fixed since 21 month? but no fixed version available (rpm/opensuse)?

Original comment by gerald.h...@gmail.com on 25 Sep 2014 at 6:42

GoogleCodeExporter commented 9 years ago
I think this has been fixed for the 3.03 release, but that 3.03 release is not 
out yet? Because I still get this error after downloading tesseract with

brew install tesseract

on my Mac OS X 10.9, but that gives 3.02 so I'm assuming we just have to wait 
for 3.03.

Original comment by takeshid...@gmail.com on 28 Apr 2015 at 5:19