-
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
hOCR renderer writes "x_size" (instead of "x_fsize") property to ocr_line/ocr_header/... #3303
Comments
For the history of that code see also pull request #27 and issue #225. Commit 4317862 introduced the current code. That code added several properties which are not part of the latest specification: Can |
There is also a TODO comment in that code: "Do we want to limit these to a single decimal place?". I think that might be reasonable. |
#3326 is somewhat related. I believe there is probably value in keeping a size in pixels that doesn't relate to the DPI, but I'm not sure I can make a recommendation here anymore. |
FYI: It looks like |
Although the TODO has Ray's name on it, it's from me. (All the attribution was lost when the code was moved into a separate module.) When I implemented this in 2016, I would have been looking at the HOCR 1.0 spec, but that seems to have been taken off line. I'm not sure if anyone still has a copy available. The HOCR 1.2 spec says that Note that since the I don't know if anyone is using the current parameters, but I'd suggest adding p.s. HOCR 1.2 spec has moved to https://kba.github.io/hocr-spec/1.2/ |
I think Konstantin made a Markdown copy from the hOCR 1.0 spec: kba/hocr-spec@910c8c9. |
If Currently the |
My comment above:
is addressed by my comment in the original issue #225:
which makes it clear what my approach/rationale was - output all the information that Tesseract had available using the hOCR extension mechanism. Given that the The hOCR spec is internally inconsistent in that it says in the definition of
but then it also includes a bunch of standard (?) properties with an I think that The |
Environment
Current Behavior:
Function
AddBoxTohOCR
insrc/api/hocrrenderer.cpp
writes propertyx_size
for the height of a line/header/etc, but it looks like the spec suggests the usage ofx_fsize
;x_size
is nowhere to be mentioned in the hOCR spec: http://kba.cloud/hocr-spec/1.2/#propdef-x_fsizeFor the
ocr_word
elements,x_fsize
is used.The spec does suggest the usage of
x_fsize
forocr_line
: http://kba.cloud/hocr-spec/1.2/#elementdef-ocr_lineExpected Behavior:
It might make sense to write
x_fsize
instead ofx_size
forocr_line
elements. But perhaps there was a reasonx_fsize
was not used forocr_line
(and similar) elements? There might be something to be said for backwards compatibility.Suggested Fix:
Evaluate situation and perhaps replace
x_size
withx_fsize
.The text was updated successfully, but these errors were encountered: