-
Notifications
You must be signed in to change notification settings - Fork 592
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
Existing way of dumping bounds of line segmentation? #266
Comments
Something which seems to come close, unless I'm mistaken, is In my case, I'm merely looking for the bounding boxes, from within the original image, of the cropped image segments, and not at this time interested in the associated, recognized text. |
Yes, with ocropus-hocr a hocr-file will be outputed which contains also the bounding boxes information. Alternatively, you can look at the pseg-file, in which this information is should also be encoded. But I guess it is easier to work with the hocr-format. |
Thank you, @zuphilip ! I noticed that, besides the OCR text output, there is no explicit ID in the hocr format which correlates the bounding information to the corresponding What is the best way of correlating the bounding boxes in the hocr file to the corresponding segmented image? Is it 100% reliable to infer that they share the same order? E.g. the first set of "bounds" in the hocr file will always correspond to the first segmented image piece (alphabetically ordered by filename) generated by |
Yes they do. They are written in reading order with shared identifiers for the line images and pseg file which are used to build the final hOCR. If you just want the segmentation you can run something like:
after the topsort in |
I wanted to ask, before getting too creative, if there might be an existing, straight-forward way of extracting not simply images of segmented page lines, but also the coordinates / bounding boxes of those images, via
ocropus-gpageseg
or a related tool?The lines apparently in memory at the following line: https://github.com/tmbdev/ocropy/blob/61562ce92818cecf6764c57d61e719cd2469a136/ocropus-gpageseg#L426
Does
ocropus-gpageseg
already drop the x / y / width / height of these coordinates / bounding boxes somewhere? Does an interface already exist to retrieve those values, in addition to the resulting segmented images?Thanks and best regards,
freen
The text was updated successfully, but these errors were encountered: