Skip to content

Main content

OCR-D Coordinate Polygon Scale Term Tool

Scale and translate an explicit polygon coordinate list, retaining vertex order without validating polygon topology.

Loading tool…

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

  1. Enter x, y, xScale, yScale, offsetX, offsetY. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
xXRequired. Array of finite number; maximum items 256.
yYRequired. Array of finite number; maximum items 256.
xScaleX ScaleRequired. Finite number; strictly above 0.
yScaleY ScaleRequired. Finite number; strictly above 0.
offsetXOffset XRequired. Finite number.
offsetYOffset YRequired. Finite number.
Output fieldInterpretationReturned shape
xXRequired. Array of finite number; maximum items 256.
yYRequired. Array of finite number; maximum items 256.
json
{
  "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

  1. Calculation and input contract: digital-humanities/ocrd-coordinate-polygon-scale-term — tool.io

Similar or alternative tools