这可能不是您想要的答案:)
简短的回答不是真的。你不能在cv2中那样做。我还检查了大约5到6个其他库,它们也是一样的(我相信你也这样做了)。在
但并不是所有的东西都失去了。我有一种强烈的感觉,cv2中的折线是用line函数实现的。在我生疏的cpp年代,以下是我在钻研opencvforlinux和mac的源代码时收集到的信息(https://github.com/Itseez/opencv/archive/3.0.0.zip):
在opencv-3.0.0/modules/imgproc/src中/绘图.cpp在
多段线调用PolyLine在代码块末尾绘制void polylines( Mat& img, const Point* const* pts, const int* npts, int ncontours, bool isClosed,
const Scalar& color, int thickness, int line_type, int shift )
{
if( line_type == CV_AA && img.depth() != CV_8U )
line_type = 8;
CV_Assert( pts && npts && ncontours >= 0 &&
0 <= thickness && thickness <= MAX_THICKNESS &&
0 <= shift && shift <= XY_SHIFT );
double buf[4];
scalarToRawData( color, buf, img.type(),