Shortcuts

mmocr.utils.bezier2polygon

mmocr.utils.bezier2polygon(bezier_points, num_sample=20)[source]

Sample points from the boundary of a polygon enclosed by two Bezier curves, which are controlled by bezier_points.

Parameters
  • bezier_points (ndarray) – A \((2, 4, 2)\) array of 8 Bezeir points or its equalivance. The first 4 points control the curve at one side and the last four control the other side.

  • num_sample (int) – The number of sample points at each Bezeir curve. Defaults to 20.

Returns

A list of 2*num_sample points representing the polygon extracted from Bezier curves.

Return type

list[ndarray]

Warning

The points are not guaranteed to be ordered. Please use mmocr.utils.sort_points() to sort points if necessary.

Read the Docs v: dev-1.x
Versions
latest
stable
v1.0.1
v1.0.0
0.x
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.1
v0.2.0
v0.1.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.