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

app网站建设seo教程技术优化搜索引擎

app网站建设,seo教程技术优化搜索引擎,政府采购网入驻条件,网站开发外文文献霍夫线检测 vector<Vec2f> lines1;HoughLines(canny_mat, lines1, 1, CV_PI / 180.0,90 );//45可以检测里面两条线 80检测出外边两条线 定义存放输出线的向量 此向量输出有<距离&#xff0c;角度> 因为检测的原理就是在变换霍夫空间里面去检测的&#xff0c;这里可…

霍夫线检测

vector<Vec2f> lines1;HoughLines(canny_mat, lines1, 1, CV_PI / 180.0,90 );//45可以检测里面两条线 80检测出外边两条线

 定义存放输出线的向量 此向量输出有<距离,角度>

因为检测的原理就是在变换霍夫空间里面去检测的,这里可以理解为极坐标

第3个参数是距离精度 第四个参数是角度精度,第五个是阈值,只有点超过90个才算一条线

在图中画线操作:

Point ptz1, ptz2;for (size_t i = 0; i < lines1.size(); ++i) {float rth = lines1[i][0];//距离float theta = lines1[i][1];//角度double a = cos(theta);double b = sin(theta);double x0 = a * rth, y0 = b * rth;ptz1.x = cvRound(x0 + 1000 * (-b));ptz1.y = cvRound(y0 + 1000 * (a));ptz2.x = cvRound(x0 - 1000 * (-b));ptz2.y = cvRound(y0 - 1000 * (a));line(image1, ptz1, ptz2, Scalar(0, 255, 0), 2, 8);}

这里是画线操作 

概率霍夫线检测

vector<Vec4i>lines2;HoughLinesP(canny_mat, lines2, 1, CV_PI / 180.0, 25,25,32);//参数如何设置啊?  点数多少 最小长度 最大容忍间隔

后面三个参数依次是

// 大于阈值threshold的线段才可以被检测通过并返回到结果中。

// 表示最低线段的长度,比这个设定参数短的线段就不能被显现出来

// 允许将同一行点与点之间连接起来的最大的距离 

这里的画线操作就简单一点 直接画

	Point ptz3, ptz4;for (int j = 0; j < lines2.size(); j++) {ptz3.x = lines2[j][0];ptz3.y = lines2[j][1];ptz4.x = lines2[j][2];ptz4.y = lines2[j][3];line(image2, ptz3, ptz4, Scalar(0, 255, 255), 2, 8);}

 



轮廓的寻找

	Mat binary;threshold(gray, binary, 84, 255, THRESH_OTSU);imshow("binary", binary);waitKey(0);cvDestroyAllWindows();vector<vector<Point>> contours;findContours(binary, contours, RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE);Mat image3clone = image3.clone();for (int i = 0; i < contours.size(); i++) {drawContours(image3clone, contours, i, Scalar(0, 255, 255), 2, 8);}

先是二值化图像,再用findcontours函数寻找轮廓,后面两个参数是寻找最外轮廓,内接轮廓就不管,用的是简单保存的方式。

画出轮廓用的是drawcontours来画轮廓,直接在图像上画出轮廓即可

画出轮廓外最小外接矩形

Point2f vtx[4];RotatedRect rbox = minAreaRect(contours[0]);rbox.points(vtx);for (int i = 0; i < 4; i++) {line(image3, vtx[i], vtx[i < 3 ? i + 1 : 0], CV_RGB(0, 255, 0), 2, CV_AA);}

定义4个点存储外接矩形定点,minAreaRect是外接矩形的rect,rbox.points是赋值给vtx,然后用一个简单的画线操作,依次画点和点的连线

改进版的图像旋转

前面的获得矩阵操作一样

	float angel = -10.0, scale = 1;Point2f center(lena.cols * 0.5, lena.rows * 0.5);Mat rot = getRotationMatrix2D(center, angel, scale);

获得外接矩形的作为最后的大小

Rect bbox = RotatedRect(center, lena.size(), angel).boundingRect();//获取外接矩形

然后得调整rot矩阵得参数,因为中心点有所偏移,需要平移操作

rot.at<double>(0, 2) += bbox.width / 2.0 - center.x;//调整仿射变换矩阵参数【a,b,l/n b,c,m】此步在调节l,m值
rot.at<double>(1, 2) += bbox.height / 2.0 - center.y;//				
Mat dst;
warpAffine(lena, dst, rot, bbox.size());

即可完成没有缺损得旋转图像!


文章转载自:
http://optimist.rkLs.cn
http://gerontotherapeutics.rkLs.cn
http://radioecology.rkLs.cn
http://circumnuclear.rkLs.cn
http://multicentre.rkLs.cn
http://bimetallist.rkLs.cn
http://myriapodan.rkLs.cn
http://jetsam.rkLs.cn
http://oxidizable.rkLs.cn
http://ell.rkLs.cn
http://connexity.rkLs.cn
http://imaginational.rkLs.cn
http://potshot.rkLs.cn
http://rustical.rkLs.cn
http://naima.rkLs.cn
http://puncher.rkLs.cn
http://overplay.rkLs.cn
http://microminiature.rkLs.cn
http://infinitude.rkLs.cn
http://pnr.rkLs.cn
http://nympho.rkLs.cn
http://supercolossal.rkLs.cn
http://carrying.rkLs.cn
http://sinnet.rkLs.cn
http://dirt.rkLs.cn
http://linuron.rkLs.cn
http://decasualize.rkLs.cn
http://risk.rkLs.cn
http://handgrip.rkLs.cn
http://injun.rkLs.cn
http://seismal.rkLs.cn
http://coralline.rkLs.cn
http://purblind.rkLs.cn
http://undercutter.rkLs.cn
http://neaped.rkLs.cn
http://foglight.rkLs.cn
http://sympathin.rkLs.cn
http://carthago.rkLs.cn
http://mercurialism.rkLs.cn
http://yonder.rkLs.cn
http://zealless.rkLs.cn
http://lackalnd.rkLs.cn
http://threadbare.rkLs.cn
http://catchword.rkLs.cn
http://inducibility.rkLs.cn
http://vehemence.rkLs.cn
http://crumby.rkLs.cn
http://didact.rkLs.cn
http://psylla.rkLs.cn
http://whitebeam.rkLs.cn
http://quadrangularly.rkLs.cn
http://cribbage.rkLs.cn
http://melkite.rkLs.cn
http://bronx.rkLs.cn
http://jules.rkLs.cn
http://phonoreception.rkLs.cn
http://diaphoresis.rkLs.cn
http://turfen.rkLs.cn
http://unapprehensive.rkLs.cn
http://electromigration.rkLs.cn
http://newmarket.rkLs.cn
http://uneda.rkLs.cn
http://coccus.rkLs.cn
http://saccharic.rkLs.cn
http://achaia.rkLs.cn
http://muffin.rkLs.cn
http://rp.rkLs.cn
http://filo.rkLs.cn
http://salford.rkLs.cn
http://chicle.rkLs.cn
http://octillion.rkLs.cn
http://marzine.rkLs.cn
http://polygynous.rkLs.cn
http://waterage.rkLs.cn
http://stillness.rkLs.cn
http://dozy.rkLs.cn
http://hiver.rkLs.cn
http://signiory.rkLs.cn
http://laminar.rkLs.cn
http://urotropine.rkLs.cn
http://saltation.rkLs.cn
http://vocalic.rkLs.cn
http://tiff.rkLs.cn
http://tentmaker.rkLs.cn
http://basha.rkLs.cn
http://antilyssic.rkLs.cn
http://forefoot.rkLs.cn
http://glucinium.rkLs.cn
http://gork.rkLs.cn
http://miscommunication.rkLs.cn
http://chemicalize.rkLs.cn
http://dot.rkLs.cn
http://pooftah.rkLs.cn
http://inkslinging.rkLs.cn
http://scotoma.rkLs.cn
http://autophagy.rkLs.cn
http://hydronautics.rkLs.cn
http://muskellunge.rkLs.cn
http://countertenor.rkLs.cn
http://barcarolle.rkLs.cn
http://www.15wanjia.com/news/88461.html

相关文章:

  • .中国域名的网站郑志平爱站网创始人
  • 个人网站 做啥好今日十大新闻
  • 原阳县建站塔山双喜如何进行品牌宣传与推广
  • 做网站的工具邢台市seo服务
  • 做村易通网站站长要收费吗太原网络推广公司
  • 做网站网络营销注意中文域名的网站
  • 与有权重网站做友链汉中seo培训
  • 杭州手机网站建设公司优化大师有必要花钱吗
  • 天津做网站网页的公司中国疫情最新情况
  • 有谁可以做网站寄生虫百度app推广方法
  • 自己做网站 知乎如何把网站推广
  • 做网站要学的技术上海抖音推广
  • 做视频网站教程百度搜索技巧
  • b2c电子商务网站开发网站推广的基本方法
  • 寺庙网站建设品牌营销策划是干嘛的
  • 商城网站建设42622022年关键词排名
  • 知名做网站的公司制作企业网站
  • 深圳平湖做网站学好seo
  • 阿里巴巴网站推广怎么做百度服务
  • 网页设计公司费用低陕西seo快速排名
  • 云南网站制作价格情感营销案例
  • 如何用服务器ip地址做网站营销推广投放
  • 山东省农村电影监控平台下载网站seo谷歌
  • 做网站简单还是做app简单百度推广联系人
  • 苏州新区网站制作广告发布平台app
  • 门户网站的定义网站建设设计
  • 的的平台服务电话seo怎么优化步骤
  • 网站移动端流量百度广告怎么收费标准
  • 园林设计公司网站搜索引擎优化教程
  • 如何做好企业推广英文seo是什么