博客
关于我
技巧 | 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中的IO问题分析与优化
    查看>>
    MySQL中的ON DUPLICATE KEY UPDATE详解与应用
    查看>>
    mysql中的rbs,SharePoint RBS:即使启用了RBS,内容数据库也在不断增长
    查看>>
    mysql中的undo log、redo log 、binlog大致概要
    查看>>
    Mysql中的using
    查看>>
    MySQL中的关键字深入比较:UNION vs UNION ALL
    查看>>
    mysql中的四大运算符种类汇总20多项,用了三天三夜来整理的,还不赶快收藏
    查看>>
    mysql中的字段如何选择合适的数据类型呢?
    查看>>
    MySQL中的字符集陷阱:为何避免使用UTF-8
    查看>>
    mysql中的数据导入与导出
    查看>>
    MySQL中的时间函数
    查看>>
    mysql中的约束
    查看>>
    MySQL中的表是什么?
    查看>>
    mysql中穿件函数时候delimiter的用法
    查看>>
    Mysql中索引的分类、增删改查与存储引擎对应关系
    查看>>
    Mysql中索引的最左前缀原则图文剖析(全)
    查看>>
    MySql中给视图添加注释怎么添加_默认不支持_可以这样取巧---MySql工作笔记002
    查看>>
    Mysql中获取所有表名以及表名带时间字符串使用BetweenAnd筛选区间范围
    查看>>
    Mysql中视图的使用以及常见运算符的使用示例和优先级
    查看>>
    Mysql中触发器的使用示例
    查看>>