博客
关于我
技巧 | OpenCV中如何绘制与填充多边形
阅读量:322 次
发布时间:2019-03-04

本文共 2626 字,大约阅读时间需要 8 分钟。

OpenCV ????????????

? OpenCV ??????????????????????????????????????????????????????? polylines ??? thickness ?????????????????????????????????????????????????????????????? OpenCV ???????????????


?????

? OpenCV ??polylines ????????????????????? thickness ?????????????????

  • ? thickness ?????????????????
  • ? thickness ?????????????????????

???? polylines ?????????????????????????????????????????????


polylines ????

??????? polylines ?????????????

Mat canvas = Mat::zeros(Size(512, 512), CV_8UC3);int w = canvas.cols;int h = canvas.rows;Point p1(100, 100);Point p2(300, 150);Point p3(300, 350);Point p4(250, 450);Point p5(50, 450);std::vector
pts;pts.push_back(p1);pts.push_back(p2);pts.push_back(p3);pts.push_back(p3);pts.push_back(p4);pts.push_back(p5);polylines(canvas, pts, true, Scalar(0, 255, 0), 1, LINE_8, 0);

??????????????????????????


?????

???????????????? fillPoly ?????????? polylines ???????????????????fillPoly ?????? polylines ????????????? fillPoly ??? thickness ? isClosed ???

fillPoly ????

??????? fillPoly ?????????????

Mat canvas = Mat::zeros(Size(512, 512), CV_8UC3);int w = canvas.cols;int h = canvas.rows;Point p1(100, 100);Point p2(300, 150);Point p3(300, 350);Point p4(250, 450);Point p5(50, 450);std::vector
pts;pts.push_back(p1);pts.push_back(p2);pts.push_back(p3);pts.push_back(p3);pts.push_back(p4);pts.push_back(p5);fillPoly(canvas, pts, Scalar(255, 0, 255), 8, 0);polylines(canvas, pts, true, Scalar(0, 255, 255), 2, LINE_8, 0);

???????????????????????????


?????????????

?? fillPoly ???OpenCV ???? drawContours ??????????? fillPoly ??????????????????????????drawContours ??????????

  • image??????????
  • contours??????????
  • contourIdx???????????????? -1 ?????????
  • color??????
  • thickness???????????????????

drawContours ????

??????? drawContours ????????????????

Mat canvas = Mat::zeros(Size(512, 512), CV_8UC3);int w = canvas.cols;int h = canvas.rows;Point p1(100, 100);Point p2(300, 150);Point p3(300, 350);Point p4(250, 450);Point p5(50, 450);std::vector
> contours;contours.push_back(pts);drawContours(canvas, contours, 0, Scalar(0, 0, 255), -1, 8);drawContours(canvas, contours, 0, Scalar(255, 0, 255), 2, 8);

?????????????????????????????????????


????

??????????????????????????????? fillPoly ? drawContours ???????

  • fillPoly ?????????????????????????
  • drawContours ?????????????????????????????????
  • ?????????????????????????????????


    OpenCV ????

    ??? OpenCV ??????????????????????????????? OpenCV ???????????????????????????????????????????OpenCV ????20??????????????


    ???????????????????????????????????? SLAM??????????????????????????????????????????+??/??+?????

    转载地址:http://adaq.baihongyu.com/

    你可能感兴趣的文章
    Mysql order by与limit混用陷阱
    查看>>
    Mysql order by与limit混用陷阱
    查看>>
    mysql order by多个字段排序
    查看>>
    MySQL Order By实现原理分析和Filesort优化
    查看>>
    mysql problems
    查看>>
    mysql replace first,MySQL中处理各种重复的一些方法
    查看>>
    MySQL replace函数替换字符串语句的用法(mysql字符串替换)
    查看>>
    mysql replace用法
    查看>>
    Mysql Row_Format 参数讲解
    查看>>
    mysql select, from ,join ,on ,where groupby,having ,order by limit的执行顺序和书写顺序
    查看>>
    MySQL Server 5.5安装记录
    查看>>
    mysql server has gone away
    查看>>
    mysql slave 停了_slave 停止。求解决方法
    查看>>
    MySQL SQL 优化指南:主键、ORDER BY、GROUP BY 和 UPDATE 优化详解
    查看>>
    MYSQL sql语句针对数据记录时间范围查询的效率对比
    查看>>
    mysql sum 没返回,如果没有找到任何值,我如何在MySQL中获得SUM函数以返回'0'?
    查看>>
    mysql Timestamp时间隔了8小时
    查看>>
    Mysql tinyint(1)与tinyint(4)的区别
    查看>>
    mysql union orderby 无效
    查看>>
    mysql v$session_Oracle 进程查看v$session
    查看>>