This has been an issue for long. Thanks for finding the problem. Please submit a PR on github.
On Friday, June 1, 2018 at 1:55:25 AM UTC+5:30, Paul Kitchen wrote: > > After a lot of stepping through tesseract code, I found the problem. > > 1) In file coutln.cpp, function C_OUTLINE::IsLegallyNested(), we > assign outer_area() to an inT32, parent_area. Then lower in the function, > we multiple child->outer_area() by parent_area. This caused an integer > overflow which resulted in a bad sign for the multiplication. The fix was > to make parent_area an inT64 so that integer overflow cannot happen. > > > The two 32-bit integers being multiplied were -51874 and 60218. The true > result should be -3123748532 but the maximum result cannot be greater than > 2^31 or you will have sign/overflow problems, which is the case here. The > computer result was 1171218764, causing the if-statement to go down the > wrong path. > > dfs > > > > > > > > -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tesseract-ocr. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/1ef0e822-9518-4cbb-af39-5a8ec6370d00%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

