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.