-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong symbol bounding box coordinates #2024
Comments
Do you have a fix that will work well, even in the presence of ligatures and noise? |
@amitdo I do not, I would have sent a PR if I had :) |
Is this issue fixed in 4.1/current code? |
@noahmetzger, do you get better character boxes for this example with your latest code? |
I think so. Will test this later. |
I would also be curious if this is fixed. Working with v4.0 there is often trouble with wider characters, which then causes an offset of all following character bounding boxes. Any news above? |
Did you try 4.1.0? |
I tried 4.1.0-rc1 at the time, with slightly different but not fixed results. Ok so 4.1.0 is a definite release now, great thanks! I will give the Windows installer a try in combination with the tesserocr Python package if possible. |
This should be fixed by pull request #2576. |
Issue is fixed in master branch. @zdenop Please close. |
I am not sure if the following observation is covered by this ticket. But maybe it needs to be reopened.
We have this issue on all of our example files and on all 4.* versions of tesseract, too. Thanks for all you work and have a great christmas time! |
I am posting it here because it might be related to #1712 and #1192. I think it is questionable what should be the solution because some might prefer the current behaviour.
Can be closed any time.
Behaviour: doing OCR using LSTM with specific model returns invalid character bounding box when calling
PageIterator::BoundingBox
.Reproducibility: very likely not because of the missing model.
Input image (without the coloured lines):
Before LSTM, fake words are created that contain correct blobs based on outlines. After LSTM,
RecodeBeamSearch::InitializeWord
, blobs are computed heretesseract/src/lstm/recodebeam.cpp
Line 432 in 9c2d1aa
2
(plus an estimated window) is the start of the green line in the picture. It can be argued that it starts too early and stops too soon (very roughly said like before seeing the end of2
). Moreover, the computed width span is reduced heretesseract/src/lstm/recodebeam.cpp
Line 435 in 9c2d1aa
Then, when constructing the symbol bounding box in
PAGE_RES_IT::ReplaceCurrentWord
this condition is not mettesseract/src/ccstruct/pageres.cpp
Line 1384 in 5fdaa47
end_x
is too far to the left. For the record, the ends are computed attesseract/src/ccstruct/pageres.cpp
Line 1313 in 5fdaa47
The code that should handle this situation is below at
tesseract/src/ccstruct/pageres.cpp
Line 1407 in 5fdaa47
However, it fails too because the cblobs are further to right than the wrongly computed blob end.
The unitialised bounding box gets "fixed" when calling
BoundingBox
attesseract/src/ccmain/pageiterator.cpp
Line 313 in 5fdaa47
setting the coordinates to 0, 0, image height/width.
The text was updated successfully, but these errors were encountered: