当前位置: 首页 > news >正文

成都做网站建设wordpress清除所有评论

成都做网站建设,wordpress清除所有评论,网站 备案 中国 名字吗,网站上动画视频怎么做的opencv 之 外接多边形#xff08;矩形、圆、三角形、椭圆、多边形#xff09;使用详解 本文主要讲述opencv中的外接多边形的使用#xff1a; 多边形近似外接矩形、最小外接矩形最小外接圆外接三角形椭圆拟合凸包 将重点讲述最小外接矩形的使用 1. API介绍 #多边形近似 v…opencv 之 外接多边形矩形、圆、三角形、椭圆、多边形使用详解 本文主要讲述opencv中的外接多边形的使用 多边形近似外接矩形、最小外接矩形最小外接圆外接三角形椭圆拟合凸包 将重点讲述最小外接矩形的使用 1. API介绍 #多边形近似 void cv::approxPolyDP(InputArray curve,OutputArray approxCurve,double epsilon,bool closed ) Python: cv.approxPolyDP(curve, epsilon, closed[, approxCurve] ) - approxCurve#计算点到多边形的距离或者判断是否在多边形内部 double cv::pointPolygonTest (InputArray contour,Point2f pt,bool measureDist ) Python: cv.pointPolygonTest(contour, pt, measureDist) - retval#外接矩形 Rect cv::boundingRect(InputArray array) Python: cv.boundingRect(array) - retval#最小外接矩形 RotatedRect cv::minAreaRect (InputArray points) Python: cv.minAreaRect( points) - retval#求矩形交集 int cv::rotatedRectangleIntersection(const RotatedRect rect1,const RotatedRect rect2,OutputArray intersectingRegion ) Python: cv.rotatedRectangleIntersection(rect1, rect2[, intersectingRegion] ) - retval, intersectingRegion#最小外接圆 void cv::minEnclosingCircle (InputArray points,Point2f center,float radius ) Python: cv.minEnclosingCircle(points) - center, radius#最小外接三角形 double cv::minEnclosingTriangle (InputArray points,OutputArray triangle) Python: cv.minEnclosingTriangle(points[, triangle] ) - retval, triangle#椭圆拟合 void cv::ellipse(InputOutputArray img,Point center,Size axes,double angle,double startAngle,double endAngle,const Scalar color,int thickness 1,int lineType LINE_8,int shift 0 ) Python: cv.ellipse( img, center, axes, angle, startAngle, endAngle, color[, thickness[, lineType[, shift]]] ) - img cv.ellipse( img, box, color[, thickness[, lineType]] ) - img2. 例程 给一个opencv官方的例程 #include opencv2/highgui.hpp #include opencv2/imgproc.hpp #include iostream using namespace cv; using namespace std; static void help() {cout This program demonstrates finding the minimum enclosing box, triangle or circle of a set\n of points using functions: minAreaRect() minEnclosingTriangle() minEnclosingCircle().\n Random points are generated and then enclosed.\n\n Press ESC, q or Q to exit and any other key to regenerate the set of points.\n\n; } int main(int /*argc*/, char** /*argv*/) {help();Mat img(500, 500, CV_8UC3, Scalar::all(0));RNG rng theRNG();for (;;){int i, count rng.uniform(1, 101);vectorPoint points;// Generate a random set of pointsfor (i 0; i count; i){Point pt;pt.x rng.uniform(img.cols / 4, img.cols * 3 / 4);pt.y rng.uniform(img.rows / 4, img.rows * 3 / 4);points.push_back(pt);}// Find the minimum area enclosing bounding boxPoint2f vtx[4];RotatedRect box minAreaRect(points);box.points(vtx);// Find the minimum area enclosing trianglevectorPoint2f triangle;minEnclosingTriangle(points, triangle);// Find the minimum area enclosing circlePoint2f center;float radius 0;minEnclosingCircle(points, center, radius);img Scalar::all(0);// Draw the pointsfor (i 0; i count; i)circle(img, points[i], 3, Scalar(0, 0, 255), FILLED, LINE_AA);// Draw the bounding boxfor (i 0; i 4; i)line(img, vtx[i], vtx[(i 1) % 4], Scalar(0, 255, 0), 1, LINE_AA);//绘制外接矩形rectangle(img, box.boundingRect(), cv::Scalar(10, 100, 20), 2);//也可以/*cv::Rect _rect boundingRect(points);rectangle(img, _rect, cv::Scalar(10, 100, 20), 2);*/// Draw the trianglefor (i 0; i 3; i)line(img, triangle[i], triangle[(i 1) % 3], Scalar(255, 255, 0), 1, LINE_AA);// Draw the circlecircle(img, center, cvRound(radius), Scalar(0, 255, 255), 1, LINE_AA);imshow(Rectangle, triangle circle, img);char key (char)waitKey();if (key 27 || key q || key Q) // ESCbreak;}return 0; }过程图像如下 椭圆拟合一般用于轮廓提取之后 //获取拟合椭圆的外包围矩形 cv::RotatedRect rotate_rect cv::fitEllipse(points); //绘制拟合椭圆 cv::ellipse(image, rotate_rect, cv::Scalar(0, 255, 255), 2, 8); 凸包绘制 vectorPoint hull;convexHull(points, hull, true);img Scalar::all(0);for( i 0; i count; i )circle(img, points[i], 3, Scalar(0, 0, 255), FILLED, LINE_AA);polylines(img, hull, true, Scalar(0, 255, 0), 1, LINE_AA);imshow(hull, img);#多边形填充绘制polylines(img, hull, true, Scalar(0, 255, 0), -1, LINE_AA);计算两个旋转矩形交集 vectorPoint2f intersectingRegion; rotatedRectangleIntersection(rect1, rect2, intersectingRegion);3. 关于最小外接矩形 C版的最小外接矩形使用 RotatedRect rect minAreaRect(points); float angle rect. box.points(vtx);其接口返回值可读取如下其中其角度指的是width与物理坐标系y轴正方向逆时针所成的夹角 赋值时也可以读出如下数据中心、角度、尺寸大小、外接矩形 画图详解一下吧 想要看真实的效果图的话可以参考biubiubiu~ 它也可以用于 python版本的最小外接矩形 _rect cv2.minAreaRect(conts_new[i])(x, y), (w, h), ang _rectbox cv2.boxPoints(_rect)# 标准化坐标到整数box np.int32(box)cv2.drawContours(mask_c3, [box], 0, (int(bgr[0]), int(bgr[1]), int(bgr[2])),2)还有一些想法后边再补充吧
http://www.tj-hxxt.cn/news/130327.html

相关文章:

  • 哪里做网站最好网站网站图片轮播怎么做
  • 苏州网站建设网络vps服务器购买
  • 常州网站建设百科网站空间是虚拟机吗
  • wordpress建立商业网站怎么样模仿网站
  • 建设网站与服务器wordpress 版本查询
  • 动力网站长沙企业模板建站
  • 做设计必看十大网站网站文章关键字密度
  • 在线购物网站网站生成器下载
  • 开发app和做网站深圳华南城网站建设
  • 外贸网站建设费用情况网站建设都有什么类型
  • 2023免费网站推广wordpress超出最大上传
  • 成都企业网站商城定制北京公司注册哪个园区免费
  • 怎么自创网站什么是跨境电商平台
  • 自适应企业网站源码建设工程合同包括哪些
  • 网站优化和提升网站排名怎么做如何建设网络营销网站
  • 官方网站下载方法景安wordpress主机
  • 个人资料库网站怎么做商业设计理念
  • 网站建设流程策划方案网站建设管理员工工资多少
  • 免费企业营销网站制作wordpress怎么只显示标题和摘要
  • 海淘网站是谁做的上海有什么好玩的
  • 建设部网站城建学院合肥建设工程市场价格信息网
  • 吉林市网站建设做电商运营还是网站运营哪个好
  • 手机网站模板 html5 下载工具手机触屏网站制作软件
  • wordpress建站需要多久成都设计公司名字
  • 怎么看网站是否备案网页游戏代理加盟
  • 做衣服招临工在什么网站找wordpress页面加载很慢
  • 做网站容易 但运营难新闻平台发布
  • 做电影下载网站好做淘宝代理哪个网站好
  • 域名访问网站是什么意思石家庄制作网站公司有哪些
  • 开奖视频网站开发太仓网站开发公司