Created
April 19, 2014 09:45
-
-
Save pvorb/11079466 to your computer and use it in GitHub Desktop.
Correct Box coordinates by adding a static_cast in Tesseract 3.03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: ccmain/pageiterator.cpp | |
=================================================================== | |
--- ccmain/pageiterator.cpp (Revision 1058) | |
+++ ccmain/pageiterator.cpp (Arbeitskopie) | |
@@ -288,9 +288,9 @@ | |
const int pix_height = pixGetHeight(tesseract_->pix_binary()); | |
const int pix_width = pixGetWidth(tesseract_->pix_binary()); | |
*left = ClipToRange(static_cast<int>(box.left()), 0, pix_width); | |
- *top = ClipToRange(pix_height - box.top(), 0, pix_height); | |
+ *top = ClipToRange(pix_height - static_cast<int>(box.top()), 0, pix_height); | |
*right = ClipToRange(static_cast<int>(box.right()), *left, pix_width); | |
- *bottom = ClipToRange(pix_height - box.bottom(), *top, pix_height); | |
+ *bottom = ClipToRange(pix_height - static_cast<int>(box.bottom()), *top, pix_height); | |
return true; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment