kba / hocr-spec

The hOCR Embedded OCR Workflow and Output Format
http://kba.github.io/hocr-spec/1.2/
72 stars 20 forks source link

Clarification for baseline #100

Open fgregg opened 7 years ago

fgregg commented 7 years ago

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 commented 7 years ago

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

@tmbdev @zuphilip ?

zuphilip commented 7 years ago

The example comes from Tesseract wiki pages: https://github.com/tesseract-ocr/tesseract/wiki/FAQ#how-to-interpret-hocr-baseline-output

marschap commented 7 years ago

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

marschap commented 7 years ago

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

marschap commented 7 years ago

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