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

滑县网站建设哪家好南京 招网站开发

滑县网站建设哪家好,南京 招网站开发,容桂品牌网站建设,淘宝网站建设好评语文章目录 approxPolyDP 轮廓周围绘制矩形boundingRectminAreaRect绘制圆和椭圆示例 approxPolyDP 轮廓周围绘制矩形 approxPolyDP(InputArray curve, OutputArray approxCurve, double epsilon, bool closed)curve#xff1a;输入点集#xff0c;二维点向量的集合appro… 文章目录 approxPolyDP 轮廓周围绘制矩形boundingRectminAreaRect绘制圆和椭圆示例 approxPolyDP 轮廓周围绘制矩形 approxPolyDP(InputArray curve, OutputArray approxCurve, double epsilon, bool closed)curve输入点集二维点向量的集合approxCurve输出点集表示拟合曲线或多边形数据与输入参数 curve 一致epsilon指定的近似精度原始曲线与近似曲线之间的最大距离close 闭合标志True 表示闭合多边形False 表示多边形不闭合boundingRect boundingRect(InputArray points)得到轮廓周围最小矩形左上交点坐标和右下角点坐标绘制一个矩形minAreaRect minAreaRect(InputArray points)得到一个旋转的矩形返回旋转矩形绘制圆和椭圆 cv::minEnclosingCircle(InputArray points, //得到最小区域圆形Point2f center, // 圆心位置float radius)// 圆的半径 cv::fitEllipse(InputArray points)得到最小椭圆示例 #include opencv2/opencv.hpp #include iostream #include math.husing namespace std; using namespace cv; Mat src, gray_src, drawImg; int threshold_v 170; int threshold_max 255; const char* output_win rectangle-demo; RNG rng(12345); void Contours_Callback(int, void*); int main(int argc, char** argv) {src imread(D:/vcprojects/images/hotball.png);if (!src.data) {printf(could not load image...\n);return -1;}cvtColor(src, gray_src, CV_BGR2GRAY);blur(gray_src, gray_src, Size(3, 3), Point(-1, -1));const char* source_win input image;namedWindow(source_win);namedWindow(output_win);imshow(source_win, src);createTrackbar(Threshold Value:, output_win, threshold_v, threshold_max, Contours_Callback);Contours_Callback(0, 0);waitKey(0);return 0; }void Contours_Callback(int, void*) {Mat binary_output;vectorvectorPoint contours;vectorVec4i hierachy;threshold(gray_src, binary_output, threshold_v, threshold_max, THRESH_BINARY);//imshow(binary image, binary_output);findContours(binary_output, contours, hierachy, RETR_TREE, CHAIN_APPROX_SIMPLE, Point(-1, -1));vectorvectorPoint contours_ploy(contours.size());vectorRect ploy_rects(contours.size());vectorPoint2f ccs(contours.size());vectorfloat radius(contours.size());vectorRotatedRect minRects(contours.size());vectorRotatedRect myellipse(contours.size());for (size_t i 0; i contours.size(); i) {approxPolyDP(Mat(contours[i]), contours_ploy[i], 3, true);ploy_rects[i] boundingRect(contours_ploy[i]);minEnclosingCircle(contours_ploy[i], ccs[i], radius[i]);if (contours_ploy[i].size() 5) {myellipse[i] fitEllipse(contours_ploy[i]);minRects[i] minAreaRect(contours_ploy[i]);}}// draw itdrawImg Mat::zeros(src.size(), src.type());Point2f pts[4];for (size_t t 0; t contours.size(); t) {Scalar color Scalar(rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255));//rectangle(drawImg, ploy_rects[t], color, 2, 8);//circle(drawImg, ccs[t], radius[t], color, 2, 8);if (contours_ploy[t].size() 5) {ellipse(drawImg, myellipse[t], color, 1, 8);minRects[t].points(pts);for (int r 0; r 4; r) {line(drawImg, pts[r], pts[(r 1) % 4], color, 1, 8);}}}imshow(output_win, drawImg);return; }
http://www.dnsts.com.cn/news/166389.html

相关文章:

  • 凡客网站建站教程考试源码网站wordpress
  • 招聘网站建设与开发要求北京最大的设计公司
  • 网站布局类型wordpress 编辑器
  • 好看的网站模版赣州小程序推荐
  • 微信推送用哪个网站做一个备案号可以放几个网站
  • 云南工贸网站建设php做网站怎么样
  • 网站中英文要怎么做sae wordpress 图片
  • 网站建设实习目的河南省新闻出版学校咋样
  • 手机网站设计公wordpress速度很慢
  • 广州南沙区网站建设上海建筑设计院官网
  • 成都市建设网站网站改版 价格
  • wordpress网站背景素材网官网
  • 英文网站设计制作广东高端网站设计公司价格
  • 什么是门户网站有哪些wordpress调用网站最新文章
  • 如何自建网站接广告郑州网站开发yipinpai
  • 移动电子商务网站建设wordpress 优惠主机
  • 微信群领券网站怎么做公司网站做百度推广需要交费吗
  • 好用的ppt模板网站免费番禺核酸检测点查询
  • 做民宿哪家网站最好紧急通知河南全省暂停
  • 海外网站怎么浏览想建一个免费的网站
  • 爱站seo排名可以做哪些网站网站开发一般用什么工具
  • 国外网站暖色网站模板
  • 网站建设子栏目文案手机app下载安卓版
  • 凤凰网站ui专业设计重庆市工程建设信息网打不开
  • 用WordPress的网站有哪些网站套餐到期啥意思
  • 中通建设工程管理公司网站wordpress 主题 名站
  • 网站采编队伍建设广州网站建设哪家比较好
  • 国内最有趣的网站西安造价信息网官网
  • 教育网站制作方案专业制作网站报价
  • 高端网站定制淘宝客网站搭建