OCR-D / ocrd_tesserocr

Run tesseract with the tesserocr bindings with @OCR-D's interfaces
MIT License
39 stars 11 forks source link

Restrict region detection to page border #36

Closed wrznr closed 5 years ago

wrznr commented 5 years ago

This commit proposes to use Tesseract's SetRectangle function to restrict the region detection to the area defined by the element Border. After thorough in(tro)spection, it turned out that GetComponentImages does not respect the manually defined recognition area when constructing the coordinates of the identified boxes: https://github.com/tesseract-ocr/tesseract/blob/4b397c70cc7d2aef2e50cdb9581b7e10f789ec3d/src/api/baseapi.cpp#L736 Therefore, a manual shift had to be added. This solution is not completely satisfying. Perspectively, Tesseract's own iterators should be employed. Especially when it comes to adding regions of other types than text.

Fixes https://github.com/OCR-D/ocrd_tesserocr/issues/32

wrznr commented 5 years ago

The help-wanted tag has been set to get help with an iterator-based implementation for region segmentation.

wrznr commented 5 years ago

Still not completely satisfying since Travis fails. This will be handled by merging https://github.com/OCR-D/core/pull/241 which needs review.