Skip to content
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

Clarification for baseline #100

Open
fgregg opened this issue Dec 27, 2016 · 5 comments
Open

Clarification for baseline #100

fgregg opened this issue Dec 27, 2016 · 5 comments

Comments

@fgregg
Copy link

fgregg commented Dec 27, 2016

In the explanation of the baseline property, the spec says that "The polynomial is in the coordinate system of the line, with the bottom left of the bounding box as the origin."

In the example, the polynomial is y = 0.015x - 18

So, at left edge of the bounding box, y should equal -18 relative to the bottom, left corner, and this is what the text says. However the picture has the baseline starting at +18 on the left edge.

Further, I don't see how it's logically possible for the intercept to be a negative number since that would mean that the baseline started outside the bounding box. But the bounding box is supposed to always contain the baseline.

@kba
Copy link
Owner

kba commented Jan 23, 2017

Good points, I'd be happy to include clarifications.

@tmbdev @zuphilip ?

@zuphilip
Copy link
Collaborator

@marschap
Copy link

Negative values for the last parameter for baseline are correct (even necessary):

  • hOCR's Y coordinates start with 0 at the top, and increase downward
    (see red coordinate arrows in the example)
  • The last parameter for baseline is taken as an offset from the lower border of the bbox
    With Y coordinates growing downwards, the lower border of the bbox has higher numeric values
  • To be inside the bbox, the last parameter for baseline needs to be negative

@marschap
Copy link

My issues with the baseline property values are with the grammar:

  • It mentions property-value = float int
    I.e. exactly one float followed by exactly one int
  • Yet in the the description bewlow, it talks about a polynomial of degree n, with n>=1
  • Accepting this, the grammar needs to read
    property-value = float+ int
    to be consistent with the description.

@marschap
Copy link

Sorry got the BNF wrong:
property-value = +(float) nint
This also enforces the "final parametel must be negative" topic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants