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

房产网站建设价格百度指数可以用来干什么

房产网站建设价格,百度指数可以用来干什么,成都建设网站价格,wordpress 下载短代码OpenCV6-图形绘制 1.绘制圆形2.绘制直线3.绘制椭圆4.绘制多边形5.文字生成6.demo 1.绘制圆形 void cv::circle(InputOutputArray img, // 需要绘制圆形的图像Point center, // 圆心坐标int radius, // 半径,单位为像素const Scalar& colo…

OpenCV6-图形绘制

    • 1.绘制圆形
    • 2.绘制直线
    • 3.绘制椭圆
    • 4.绘制多边形
    • 5.文字生成
    • 6.demo


1.绘制圆形

void cv::circle(InputOutputArray img,  // 需要绘制圆形的图像Point center,          // 圆心坐标int radius,            // 半径,单位为像素const Scalar& color,   // 圆形颜色int thickness = 1,     // 轮廓宽度,如果数值为负,则绘制一个实心圆int lineType = LINE_8, // 边界的类型,可取值FILLED、LINE_4、LINE_8、LINE_AAint shift = 0          // 中心坐标和半径数值中的小数位数
);// example
circle(img, Point(50, 50), 25, Scalar(255, 255, 255), -1);  //绘制一个实心圆
circle(img, Point(100, 50), 20, Scalar(255, 255, 255), 4);  //绘制一个空心圆

2.绘制直线

void line(InputOutputArray img,   Point pt1, Point pt2,  // 直线起点和终点const Scalar& color,   // 直线颜色,三通道表示int thickness = 1, int lineType = LINE_8, int shift = 0
);line(img, Point(100, 100), Point(200, 100), Scalar(255, 255, 255), 2, LINE_4, 0);  //绘制一条直线

3.绘制椭圆

void 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
);

在OpenCV中还提供了ellipse2Poly函数用于输出椭圆边界的像素坐标,但是不会在图像中绘制椭圆:

void ellipse2Poly( Point center, Size axes, int angle,int arcStart, int arcEnd, int delta,  // 后续折线顶点之间的角度,他定义了近似精度CV_OUT std::vector<Point>& pts // 椭圆边缘像素坐标向量集合
);
/*
该函数与绘制椭圆所需的参数类似,只不过不再将椭圆输出到图像中,而是通过vector(向量)将椭圆边缘的坐标点存储起来,便于后续的再处理。
*/

4.绘制多边形

矩形的绘制:

void rectangle(nputOutputArray img, Point pt1, // 左上角Point pt2, // 右下角const Scalar& color,   int thickness = 1,int lineType = LINE_8, int shift = 0
);void rectangle(InputOutputArray img, Rect rec, // 矩形const Scalar& color, int thickness = 1,int lineType = LINE_8, int shift = 0);typedef Rect2i Rect;
typedef Rect_<int> Rect2i;template<typename _Tp> class Rect_
{
public:// ..._Tp x; //!< x coordinate of the top-left corner_Tp y; //!< y coordinate of the top-left corner_Tp width; //!< width of the rectangle_Tp height; //!< height of the rectangle
};

下面是绘制多边形的方法:可以一次绘制多个多边形。

void fillPoly(InputOutputArray img, const Point** pts,  // 多边形顶点数组。存放多个多边形顶点坐标的数组。const int* npts,    // 每个多边形顶点数组中顶点的个数int ncontours,      // 绘制多边形的个数const Scalar& color, int lineType = LINE_8, int shift = 0,Point offset = Point() // 所有顶点的可选偏移
);

5.文字生成

目前只支持英文文本的输出。

void putText(InputOutputArray img, const String& text,   // 输出的文本内容Point org,            // 图像中文字字符串的左下角像素坐标int fontFace,         // 字体类型double fontScale,     // 字体大小Scalar color,int thickness = 1, int lineType = LINE_8,bool bottomLeftOrigin = false // 图像数据原点的位置,默认为左上角;如果参数为true,则原点为左下角。
);/*
FONT_HERSHEY_SIMPLEX:正常大小的无衬线文字
FONT_HERSHEY_PLAIN:小尺寸无衬线文字
FONT_ITALIC:斜体字体
*/
// fontFace字体类型
enum HersheyFonts {FONT_HERSHEY_SIMPLEX        = 0, //!< normal size sans-serif fontFONT_HERSHEY_PLAIN          = 1, //!< small size sans-serif fontFONT_HERSHEY_DUPLEX         = 2, //!< normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX)FONT_HERSHEY_COMPLEX        = 3, //!< normal size serif fontFONT_HERSHEY_TRIPLEX        = 4, //!< normal size serif font (more complex than FONT_HERSHEY_COMPLEX)FONT_HERSHEY_COMPLEX_SMALL  = 5, //!< smaller version of FONT_HERSHEY_COMPLEXFONT_HERSHEY_SCRIPT_SIMPLEX = 6, //!< hand-writing style fontFONT_HERSHEY_SCRIPT_COMPLEX = 7, //!< more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEXFONT_ITALIC                 = 16 //!< flag for italic font
};

6.demo

#include <opencv2\opencv.hpp>
#include <opencv2/core/utils/logger.hpp> // debug no log
#include <iostream>
using namespace cv;
using namespace std;int main()
{cout << "OpenCV Version: " << CV_VERSION << endl;utils::logging::setLogLevel(utils::logging::LOG_LEVEL_SILENT);Mat img = Mat::zeros(Size(512, 512), CV_8UC3);  //生成一个黑色图像用于绘制几何图形//绘制圆形circle(img, Point(50, 50), 25, Scalar(255, 255, 255), -1);  //绘制一个实心圆circle(img, Point(100, 50), 20, Scalar(255, 255, 255), 4);  //绘制一个空心圆//绘制直线line(img, Point(100, 100), Point(200, 100), Scalar(255, 255, 255), 2, LINE_4, 0);  //绘制一条直线//绘制椭圆ellipse(img, Point(300, 255), Size(100, 70), 0, 0, 100, Scalar(255, 255, 255), -1);  //绘制实心椭圆的一部分ellipse(img, RotatedRect(Point2f(150, 100), Size2f(30, 20), 0), Scalar(0, 0, 255), 2);  //绘制一个空心椭圆vector<Point> points;ellipse2Poly(Point(200, 400), Size(100, 70), 0, 0, 360, 2, points);  //用一些点来近似一个椭圆for (int i = 0; i < points.size() - 1; i++)  //用直线把这个椭圆画出来{if (i == points.size() - 1){line(img, points[0], points[i], Scalar(255, 255, 255), 2);  //椭圆中后于一个点与第一个点连线break;}line(img, points[i], points[i + 1], Scalar(255, 255, 255), 2);  //当前点与后一个点连线}//绘制矩形rectangle(img, Point(50, 400), Point(100, 450), Scalar(125, 125, 125), -1);rectangle(img, Rect(400, 450, 60, 50), Scalar(0, 125, 125), 2);//绘制多边形Point pp[2][6];pp[0][0] = Point(72, 200);pp[0][1] = Point(142, 204);pp[0][2] = Point(226, 263);pp[0][3] = Point(172, 310);pp[0][4] = Point(117, 319);pp[0][5] = Point(15, 260);pp[1][0] = Point(359, 339);pp[1][1] = Point(447, 351);pp[1][2] = Point(504, 349);pp[1][3] = Point(484, 433);pp[1][4] = Point(418, 449);pp[1][5] = Point(354, 402);Point pp2[5];pp2[0] = Point(350, 83);pp2[1] = Point(463, 90);pp2[2] = Point(500, 171);pp2[3] = Point(421, 194);pp2[4] = Point(338, 141);const Point* pts[3] = { pp[0],pp[1],pp2 };  //pts变量的生成int npts[] = { 6,6,5 };  //顶点个数数组的生成fillPoly(img, pts, npts, 3, Scalar(125, 125, 125), 8);  //绘制3个多边形//生成文字putText(img, "Learn OpenCV 4", Point(100, 400), 2, 1, Scalar(255, 255, 255));imshow("", img);waitKey(0);return 0;
}

文章转载自:
http://adjunct.xxhc.cn
http://rafter.xxhc.cn
http://pennywort.xxhc.cn
http://thickback.xxhc.cn
http://vaticanism.xxhc.cn
http://knobble.xxhc.cn
http://preclusion.xxhc.cn
http://filiale.xxhc.cn
http://fallage.xxhc.cn
http://implicitly.xxhc.cn
http://archanthropine.xxhc.cn
http://inherent.xxhc.cn
http://himself.xxhc.cn
http://ridicule.xxhc.cn
http://bilander.xxhc.cn
http://cortege.xxhc.cn
http://carat.xxhc.cn
http://halidome.xxhc.cn
http://esv.xxhc.cn
http://badminton.xxhc.cn
http://milden.xxhc.cn
http://slain.xxhc.cn
http://repled.xxhc.cn
http://infradyne.xxhc.cn
http://wholescale.xxhc.cn
http://pedigreed.xxhc.cn
http://goosegog.xxhc.cn
http://fay.xxhc.cn
http://ig.xxhc.cn
http://cockney.xxhc.cn
http://passant.xxhc.cn
http://margarine.xxhc.cn
http://meteor.xxhc.cn
http://aeriferous.xxhc.cn
http://hypoploid.xxhc.cn
http://yqb.xxhc.cn
http://filing.xxhc.cn
http://instantial.xxhc.cn
http://enfeeble.xxhc.cn
http://divorcee.xxhc.cn
http://levy.xxhc.cn
http://lacunaris.xxhc.cn
http://parsoness.xxhc.cn
http://swalk.xxhc.cn
http://salpingography.xxhc.cn
http://vilification.xxhc.cn
http://cytoarchitecture.xxhc.cn
http://pinup.xxhc.cn
http://denazify.xxhc.cn
http://consuetudinary.xxhc.cn
http://lawd.xxhc.cn
http://volauvent.xxhc.cn
http://detectable.xxhc.cn
http://inoculator.xxhc.cn
http://hemipterous.xxhc.cn
http://ornithischian.xxhc.cn
http://isochrone.xxhc.cn
http://congealment.xxhc.cn
http://tuxedo.xxhc.cn
http://aggrieve.xxhc.cn
http://hackney.xxhc.cn
http://souzalite.xxhc.cn
http://wafs.xxhc.cn
http://quadripartition.xxhc.cn
http://inorganized.xxhc.cn
http://arctic.xxhc.cn
http://lucidness.xxhc.cn
http://hairdye.xxhc.cn
http://harlemite.xxhc.cn
http://outfit.xxhc.cn
http://virga.xxhc.cn
http://taxing.xxhc.cn
http://sulfanilamide.xxhc.cn
http://brainwash.xxhc.cn
http://counterbalance.xxhc.cn
http://debrett.xxhc.cn
http://carbohydrase.xxhc.cn
http://bootlicker.xxhc.cn
http://airboat.xxhc.cn
http://bangtail.xxhc.cn
http://abstersive.xxhc.cn
http://shakerful.xxhc.cn
http://withouten.xxhc.cn
http://cotylosaur.xxhc.cn
http://thoughtcrime.xxhc.cn
http://thralldom.xxhc.cn
http://appeared.xxhc.cn
http://colchicine.xxhc.cn
http://supermarket.xxhc.cn
http://bibiolatrist.xxhc.cn
http://exhibiter.xxhc.cn
http://reticulation.xxhc.cn
http://bert.xxhc.cn
http://absorbance.xxhc.cn
http://petaurist.xxhc.cn
http://panmictic.xxhc.cn
http://glosseme.xxhc.cn
http://twice.xxhc.cn
http://skyjacking.xxhc.cn
http://revert.xxhc.cn
http://www.dt0577.cn/news/103628.html

相关文章:

  • 珠海门户网站制作费用做百度线上推广
  • 怎么样把网站做火百度霸屏培训
  • 西乡县门户网站301313龙虎榜
  • 茂名东莞网站建设网络营销包括
  • 2003网站服务器建设中真实的网站制作
  • 页游网站建设seo排名优化
  • 青岛城阳网站开发上海app网络推广公司电话
  • 单一产品做网站晋城今日头条新闻
  • 站长查询seo是什么意思武汉seo系统
  • 盐城市住房城乡建设委官方网站aso优化师工作很赚钱吗
  • 旅游网站建设公司网络营销推广策划书
  • 天津网站建设维护百度云搜索引擎入口 百度网盘
  • wordpress 投稿 插件杭州哪家seo公司好
  • 长春网站开发有链接的网站
  • 英语网站如何做社群泰州seo公司
  • 做网站的三个软件友情链接怎么连
  • 如何做自己的小说网站抖音广告怎么投放
  • 网站的建设与应用网站优化外包费用
  • 做网站开发的步骤手机网站建设公司
  • 网站建设流程机构提升seo排名的方法
  • 刘家窑做网站的公司seo助手
  • 开网络工作室违法吗seo推广任务小结
  • 做盈利网站怎么备案合肥网站制作推广
  • 在网站和网页的区别2022世界足球排行榜
  • 鲜花网网站开发的意义爱站小工具计算器
  • 广东购物网站建设价格b站推广入口2023mmm
  • 邯郸教育网站建设网络营销的主要特点有哪些
  • 北京网站制作平台北海百度seo
  • wordpress文章站网站建设优化的技巧
  • 门户网站构建搜索引擎营销sem