Description
Scale and translate a supplied polygon.
OCR and manuscript image measurements depend on coordinate scales, region definitions and confidence conventions. A transformed polygon or threshold comparison does not establish recognition accuracy, calibration or correct reading order.
Scale and translate a supplied polygon.
When to use this tool
Use OCR-D Coordinate Polygon Scale Term when checking a supplied image-coordinate or OCR-confidence term.
How to use the tool and how it works
- Enter x, y, xScale, yScale, offsetX, offsetY. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read x, y. Use the output convention below.
Scale and translate a supplied polygon. Require aligned x/y arrays with at least three vertices and positive axis scales; each output coordinate is input*axisScale+offset.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| x | X | Required. Array of finite number; maximum items 256. |
| y | Y | Required. Array of finite number; maximum items 256. |
| xScale | X Scale | Required. Finite number; strictly above 0. |
| yScale | Y Scale | Required. Finite number; strictly above 0. |
| offsetX | Offset X | Required. Finite number. |
| offsetY | Offset Y | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| x | X | Required. Array of finite number; maximum items 256. |
| y | Y | Required. Array of finite number; maximum items 256. |
{
"input": {
"x": [
0,
2,
0
],
"y": [
0,
0,
3
],
"xScale": 2,
"yScale": 3,
"offsetX": 1,
"offsetY": 2
},
"output": {
"x": [
1,
5,
1
],
"y": [
2,
2,
11
]
}
} Limitations and assumptions
- No OCR-D document, polygon validity, rotation or image distortion is checked.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use verified image geometry, actual OCR data and suitable quality evaluation when recognition or editorial accuracy matters.
References
Similar or alternative tools
- IIIF Canvas Coordinate Origin Shift
Map local image coordinates to a supplied canvas frame.
- Public Archive Folio Image Offset
Map a folio side to an image index.