- 操作系统:ubuntu22.04
- OpenCV版本:OpenCV4.9
- IDE:Visual Studio Code
- 编程语言:C++11
算法描述
画几条多边形曲线
函数原型
void cv::polylines
(
InputOutputArray img,
InputArrayOfArrays pts,
bool isClosed,
const Scalar & color,
int thickness = 1,
int lineType = LINE_8,
int shift = 0
)
参数
- 参数img 图像.
- 参数pts 多边形曲线数组.
- 参数isClosed 一个标志位,指示所绘制的多边形曲线是否闭合。如果设为 true,则会从每条曲线的最后一个顶点画线到第一个顶点,形成闭合曲线。
- 参数color 多边形曲线的颜色。
- 参数thickness 多边形边缘的厚度。如果设为 -1,对于闭合曲线,则填充该多边形。
- 参数lineType 线段类型。参见 LineTypes 枚举值。常见的有 LINE_8, LINE_AA (抗锯齿线) 等。
- 参数shift 顶点坐标的分数位数。
函数原型2
void cv::polylines
(
InputOutputArray img,
const Point *const * pts,
const int * npts,
int ncontours,