一杯清酒邀明月
天下本无事,庸人扰之而烦耳。
摘要: 一、简介 二、轮廓最小外接矩形的绘制 1 #include "opencv2/opencv.hpp" 2 using namespace cv; 3 4 void main() 5 { 6 //轮廓最小外接矩形的绘制 7 Mat srcImg = imread("E://00.png"); 8 Ma 阅读全文
posted @ 2021-01-27 11:59 一杯清酒邀明月 阅读(2109) 评论(0) 推荐(0)
摘要: 1、提取轮廓的凸包 CONVEXHULL()函数(点我看OPENCV3.2帮助文档) 函数调用形式: void convexhul(InputArray points,OutputArray hull,bool clockwise=false,bool returnPoints=true) 输入:第 阅读全文
posted @ 2021-01-27 11:57 一杯清酒邀明月 阅读(1708) 评论(0) 推荐(0)
摘要: 当得到对象轮廓后,可用boundingRect()得到包覆此轮廓的最小正矩形,minAreaRect()得到包覆轮廓的最小斜矩形。 1)Rect boundingRect(InputArray points) points:输入信息,可以为包含点的容器(vector)或是Mat。返回包覆输入信息的最 阅读全文
posted @ 2021-01-27 11:54 一杯清酒邀明月 阅读(1029) 评论(0) 推荐(0)
摘要: OpenCV中通过使用findContours函数,简单几个的步骤就可以检测出物体的轮廓,很方便。这些准备继续探讨一下findContours方法中各参数的含义及用法,比如要求只检测最外层轮廓该怎么办?contours里边的数据结构是怎样的?hierarchy到底是什么鬼?Point()有什么用? 阅读全文
posted @ 2021-01-27 11:48 一杯清酒邀明月 阅读(2199) 评论(0) 推荐(0)
摘要: opencv 3.0 提供了专用的画直线的函数line()。 构造函数之一如下: void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0) 阅读全文
posted @ 2021-01-27 11:40 一杯清酒邀明月 阅读(1650) 评论(0) 推荐(0)
摘要: 这个函数其实就是画圆: cvCircle(CvArr* img, CvPoint center, int radius, CvScalar color, int thickness=1, int lineType=8, int shift=0) img为源图像指针 center为画圆的圆心坐标 ra 阅读全文
posted @ 2021-01-27 11:39 一杯清酒邀明月 阅读(2222) 评论(0) 推荐(1)
摘要: pproxPolyDP 主要功能是把一个连续光滑曲线折线化,对图像轮廓点进行多边形拟合。 原理图:对比之前黑点连线,之后蓝色连线: C++: void approxPolyDP(InputArray curve, OutputArray approxCurve, double epsilon, bo 阅读全文
posted @ 2021-01-27 10:09 一杯清酒邀明月 阅读(1528) 评论(0) 推荐(0)