opecv绘制多边形

1.绘制填充凸多边形

① void  fillConvexPoly(InputOutputArray img, InputArray points,
                                const Scalar& color, int lineType = LINE_8,
                                int shift = 0);
参数一:Mat类型数据
参数二:由点构成的数组(凸多边形的各个顶点),可以用vector<Point>表示
②void fillConvexPoly(Mat& img, const Point* pts, int npts,
                               const Scalar& color, int lineType = LINE_8,
                               int shift = 0);
参数一:img,
参数二:Point类型的指针,可用Point类型的一维数组表示 Point pts[];
参数三:点的个数

2.绘制多边形

①  void fillPoly(InputOutputArray img, InputArrayOfArrays pts,
                           const Scalar& color, int lineType = LINE_8, int shift = 0,
                           Point offset = Point() );
    参数一:Mat类型数据
    参数二:二维点数组,也可用vector<vector<Point>>表示;每个多边形表示一个一维点数组
  ②  void fillPoly(Mat& img, const Point** pts,  const int* npts, int ncontours,
                             const Scalar& color, int lineType = LINE_8, int shift = 0,
                             Point offset = Point() );
    参数一:img
    参数二:Point类型二维点数组
	参数三:int型一维数组
	参数四:多边形的个数
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值