Skip to content

Main content

OCR Baseline Slope Residual Tool

Calculate ocr baseline slope residual from explicit caller-supplied inputs.

Loading tool…

Description

Compare a supplied OCR baseline slope with a two-point slope.

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.

Compare a supplied OCR baseline slope with a two-point slope.

When to use this tool

Use OCR Baseline Slope Residual when checking a supplied image-coordinate or OCR-confidence term.

How to use the tool and how it works

  1. Enter firstX, firstY, secondX, secondY, suppliedSlope. 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 slope, residual. Use the output convention below.

Compare a supplied OCR baseline slope with a two-point slope. Require distinct x coordinates; slope = (secondY-firstY)/(secondX-firstX); residual = suppliedSlope-slope.1

Input fieldMeaning and unitsAccepted input
firstXFirst XRequired. Finite number.
firstYFirst YRequired. Finite number.
secondXSecond XRequired. Finite number.
secondYSecond YRequired. Finite number.
suppliedSlopeSupplied SlopeRequired. Finite number.
Output fieldInterpretationReturned shape
slopeSlopeRequired. Finite number.
residualSigned difference in the direction defined above, using the same units as its compared quantities.Required. Finite number.
json
{
  "input": {
    "firstX": 0,
    "firstY": 2,
    "secondX": 4,
    "secondY": 4,
    "suppliedSlope": 0.6
  },
  "output": {
    "slope": 0.5,
    "residual": 0.09999999999999998
  }
}

Limitations and assumptions

  • No tolerance, line fitting or OCR quality conclusion is inferred from two points.
  • 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/ocr-baseline-slope-residual — tool.io

Similar or alternative tools