Closed maxnth closed 4 years ago
The interpretation of a rectangle in PAGE is that both the left and right border belong to the rectangle (same with top and bottom of course). That means if a rectangle spans from left=5 to right=8, for example, then you have: 5,6,7,8 = 4 pixels. This equals 8-5+1
I stumbled upon the following code regarding the calculation of height and width for rectangle:
https://github.com/PRImA-Research-Lab/prima-core-libs/blob/d95dc0b6bcc446b38249b844c44031308c0a1e28/java/PrimaMaths/src/org/primaresearch/maths/geometry/Rect.java#L49-L54
Is there any specific reason for adding the constant factor of 1 to the calculated height/width? When converting (for example) PAGEXML to ALTO the calculated width/height of TextBlocks is always one pixel too big because of this.