CubicBezierCurve<T>

Structs · AiDotNet.ComputerVision.OCR.EndToEnd

A cubic Bezier curve over four control points, and the least-squares fit that recovers those control points from annotated polygon vertices.

Inheritance: ValueType → CubicBezierCurve<T>

For Beginners

A Bezier curve is a smooth line whose shape is set by a few “control points” that pull it around, like bending a wire with four handles. Describing curved text by two such curves — one for its top edge, one for its bottom — is far more compact than listing dozens of points along its outline.

How It Works

This is the first of ABCNet’s two contributions (Liu et al., CVPR 2020, arXiv:2002.10200): a text instance’s boundary is carried by TWO cubic Bezier curves, one along the top edge and one along the bottom, so an arbitrarily curved instance is described by 8 control points — 16 numbers — instead of a long polygon. That compactness is what lets the detector regress the shape directly, with only a handful of extra output channels over an ordinary box head.

A cubic is used rather than a higher order or a spline, and that is a real constraint rather than an arbitrary choice: the paper’s own measurement is that a cubic already covers the overwhelming majority of real curved text, and a higher order would add parameters the detector must regress while making the fit less stable.

Constructors

Constructor Summary
CubicBezierCurve(IReadOnlyList<ValueTuple<double, double>> controlPoints) Creates a curve from its four control points, ordered from the curve’s start to its end.

Methods

Method Summary
CubicBezierCurve<T> Fit(IReadOnlyList<ValueTuple<double, double>> points) Fits a cubic Bezier curve to points by least squares.
ValueTuple<T, T> EvaluateNumeric(double t) Evaluates the curve and converts the result to T.
ValueTuple<double, double> ControlPoint(int index) Gets the control point at index.
ValueTuple<double, double> Evaluate(double t) Evaluates the curve at t in [0, 1].
double[] BernsteinBasis(double t) The cubic Bernstein basis at t: [(1-t)^3, 3t(1-t)^2, 3t^2(1-t), t^3].

Fields

Field Summary
int ControlPointCount The number of control points in a cubic Bezier curve.