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

东莞市官网网站建设企业各大网站收录入口

东莞市官网网站建设企业,各大网站收录入口,梧州零距离网论坛,网站建设吉金手指专业11我们将在这里演示如何使用几何形状和文本注释图像。 Cv2.Line() 绘制直线 Cv2.Ellipse() 绘制椭圆Cv2.Rectangle() 绘制矩形Cv2.Circle() 绘制圆Cv2.FillPoly() 绘制多边形Cv2.PutText() 绘制文本 一、绘制直线 Cv2.Line(image, start_point, end_point, color, thickness) …

我们将在这里演示如何使用几何形状和文本注释图像。

  1. Cv2.Line() 绘制直线 
  2. Cv2.Ellipse() 绘制椭圆
  3. Cv2.Rectangle() 绘制矩形
  4. Cv2.Circle() 绘制圆
  5. Cv2.FillPoly() 绘制多边形
  6. Cv2.PutText() 绘制文本

一、绘制直线

Cv2.Line(image, start_point, end_point, color, thickness)

参数说明
image待绘制图像
start_point起点坐标
end_point终点坐标
color直线的颜色
thickness直线的线宽(>0 && <=32767),不能为-1

Mat img = new Mat(500, 500, MatType.CV_8UC3, Scalar.White); // 创建一个500x500的白色图像Point pt1 = new Point(100, 100);
Point pt2 = new Point(400, 100);
Scalar color = new Scalar(0, 0, 255); // 红色线条Cv2.Line(img, pt1, pt2, color, 2); // 在图像上绘制直线Cv2.ImShow("Line", img); // 显示图像

 

二、绘制椭圆 

Cv2.Ellipse(image, centerCoordinates, axesLength, angle, startAngle, endAngle, color, thickness)

参数说明
image待绘制图像
centerCoordinates中心坐标
axesLength轴长度
angle椭圆偏转角度,>0顺时针,<0逆时针
startAngle椭圆轮廓的起始角度(从偏转角算起)
endAngle椭圆轮廓的终止角度(从偏转角算起)(画椭圆的话,startAngle=0,endAngle=360)
color椭圆线条颜色
thickness椭圆线宽。负数表示填充

 // 创建一个空白图像Mat img = new Mat(500, 500, MatType.CV_8UC3, Scalar.White);// 定义椭圆参数Point center = new Point(250, 250);Size axes = new Size(100, 200);double angle = 30;double startAngle = 0;double endAngle = 360;Scalar color = Scalar.Red;int thickness = 2;LineTypes lineType = LineTypes.Link8;int shift = 0;// 绘制椭圆Cv2.Ellipse(img, center, axes, angle, startAngle, endAngle, color, thickness, lineType, shift);// 显示图像Cv2.ImShow("Ellipse", img);Cv2.WaitKey(0);Cv2.DestroyAllWindows();

三、绘制矩形

Cv2.Rectangle(image, pt1, pt2, rect, color,thickness,lineType)

参数说明
image待绘制图像
pt1矩形的一个顶点
pt2pt1的对角点
rect矩形
color矩形颜色
thickness矩形的线宽。若小于0,表示填充。
lineType线型

// 创建一个空白图像
Mat img = new Mat(500, 500, MatType.CV_8UC3, Scalar.White);
Point start_point = new Point(300, 115);
Point end_point = new Point(475, 225);
Scalar color = new Scalar(0, 0, 255); // 红色线条
// 绘制矩形
Cv2.Rectangle(img, start_point, end_point, color, 3, (LineTypes)8, 0);
// 显示图像
Cv2.ImShow("Ellipse", img);
Cv2.WaitKey(0);
Cv2.DestroyAllWindows();

 四、绘制圆

Cv2.Circle(image, center_coordinates, radius, color, thickness)

参数说明
image待绘制图像
center_coordinates圆心坐标
radius半径
color颜色
thickness粗细
// 创建一个空白图像
Mat image = new Mat(500, 500, MatType.CV_8UC3, Scalar.White);// 定义圆心坐标和半径
Point center = new Point(250, 250);
int radius = 100;// 在图像上绘制圆
Cv2.Circle(image, center, radius, Scalar.Red, 2);// 显示图像
Cv2.ImShow("Circle", image);
Cv2.WaitKey(0);
Cv2.DestroyAllWindows();

五、绘制多边形 

Cv2.FillPoly(image,points,color,lineType)

参数说明
image待绘制图像
points坐标集合
color颜色
lineType线类型
using Point = OpenCvSharp.Point;
// 创建一个空白图像
Mat image = new Mat(500, 500, MatType.CV_8UC3, Scalar.White);// 定义多边形的顶点坐标
Point[] points = new Point[]
{
new Point(100, 100),
new Point(200, 100),
new Point(200, 200),
new Point(100, 200)
};
// 将多边形绘制并填充到图像上
Cv2.FillPoly(image, new List<Point[]> { points }, Scalar.Red);// 显示图像
Cv2.ImShow("Filled Polygon", image);
Cv2.WaitKey(0);
Cv2.DestroyAllWindows();

六、绘制文本

Cv2.PutText(image, text, org, font, fontScale, color)

参数说明
image待绘制图像
text文本字符串
org文本字符串左上角的起始位置
font字体大小
fontScale字体缩放
color颜色

// 创建一个空白图像
Mat image = new Mat(500, 500, MatType.CV_8UC3, Scalar.White);// 定义多边形的顶点坐标
Cv2.PutText(image, "Hello,OpenCvSharp!", new Point(20, 200), HersheyFonts.HersheySimplex, 1, new Scalar(0, 0, 255), 2, LineTypes.Link4);
// 显示图像
Cv2.ImShow("Hello,OpenCvSharp", image);


c# OpenCV 基本绘画(直线、椭圆、矩形、圆、多边形、文本)(四)
c# OpenCV 图像裁剪、调整大小、旋转、透视(三)

c#OpenCV 读取、显示和写入图像(二)

c# OpenCV安装(一)


文章转载自:
http://dinnconightjar.stkw.cn
http://dinncomenstrua.stkw.cn
http://dinncobackspace.stkw.cn
http://dinncowithering.stkw.cn
http://dinncotoilet.stkw.cn
http://dinncovitellogenesis.stkw.cn
http://dinncoendophilic.stkw.cn
http://dinncovoucher.stkw.cn
http://dinncokendoist.stkw.cn
http://dinncocircuitousness.stkw.cn
http://dinncomolybdenum.stkw.cn
http://dinncoaccomplished.stkw.cn
http://dinncophrasemonger.stkw.cn
http://dinncoinconsistent.stkw.cn
http://dinncoargilliferous.stkw.cn
http://dinncolekvar.stkw.cn
http://dinncohemogram.stkw.cn
http://dinncoenatic.stkw.cn
http://dinncowastebasket.stkw.cn
http://dinncosapajou.stkw.cn
http://dinncotipnet.stkw.cn
http://dinncoseagate.stkw.cn
http://dinncocerebral.stkw.cn
http://dinncocontabescence.stkw.cn
http://dinncogracilis.stkw.cn
http://dinncoantihypertensive.stkw.cn
http://dinncorabbit.stkw.cn
http://dinncotorsel.stkw.cn
http://dinncoephemeron.stkw.cn
http://dinncocomputerizable.stkw.cn
http://dinncopreexposure.stkw.cn
http://dinncosuccorance.stkw.cn
http://dinncosemisacerdotal.stkw.cn
http://dinncoaton.stkw.cn
http://dinncorubbery.stkw.cn
http://dinncocaricaturist.stkw.cn
http://dinncomulligan.stkw.cn
http://dinncodespoil.stkw.cn
http://dinncocenobian.stkw.cn
http://dinncoplurality.stkw.cn
http://dinncodilutor.stkw.cn
http://dinncoretrieve.stkw.cn
http://dinncoapophasis.stkw.cn
http://dinncoretroactivity.stkw.cn
http://dinncoanthropopathism.stkw.cn
http://dinncobulbiform.stkw.cn
http://dinncosestet.stkw.cn
http://dinncosymptom.stkw.cn
http://dinncoadvices.stkw.cn
http://dinncocapsian.stkw.cn
http://dinncoantialcoholism.stkw.cn
http://dinncolandmeasure.stkw.cn
http://dinncotrijet.stkw.cn
http://dinncoonchocerciasis.stkw.cn
http://dinncomaskalonge.stkw.cn
http://dinncolugger.stkw.cn
http://dinncoapplications.stkw.cn
http://dinncoheft.stkw.cn
http://dinncobrash.stkw.cn
http://dinncoroentgenopaque.stkw.cn
http://dinncoresponsa.stkw.cn
http://dinncoetypic.stkw.cn
http://dinncoincomer.stkw.cn
http://dinncopublicise.stkw.cn
http://dinncorecursion.stkw.cn
http://dinncoponderous.stkw.cn
http://dinncouranography.stkw.cn
http://dinncoliveable.stkw.cn
http://dinncopolymerase.stkw.cn
http://dinncobiocytin.stkw.cn
http://dinncoprepositional.stkw.cn
http://dinncobeech.stkw.cn
http://dinncobicron.stkw.cn
http://dinncocounselor.stkw.cn
http://dinncoreecho.stkw.cn
http://dinncounavoidably.stkw.cn
http://dinncodayak.stkw.cn
http://dinncotorso.stkw.cn
http://dinncomaxi.stkw.cn
http://dinncogovernment.stkw.cn
http://dinncospasmophilia.stkw.cn
http://dinncohaematinic.stkw.cn
http://dinncolockpicker.stkw.cn
http://dinncodoughboy.stkw.cn
http://dinncobobsledding.stkw.cn
http://dinncospathiform.stkw.cn
http://dinncorheophilic.stkw.cn
http://dinncosearchless.stkw.cn
http://dinncogaborone.stkw.cn
http://dinncoarithmetical.stkw.cn
http://dinncopreachment.stkw.cn
http://dinncopuree.stkw.cn
http://dinncoeasytran.stkw.cn
http://dinncounruliness.stkw.cn
http://dinncocampanological.stkw.cn
http://dinncosummerwood.stkw.cn
http://dinncomikado.stkw.cn
http://dinncopolemist.stkw.cn
http://dinncodigenetic.stkw.cn
http://dinncofaubourg.stkw.cn
http://www.dinnco.com/news/118453.html

相关文章:

  • 卓拙科技做网站吗百度竞价排名费用
  • 网站单页别人是怎么做的如何搭建一个网站平台
  • 沈阳学习做网站长春网站建设路
  • 网站空间查询广告推广费用
  • 网站建设费用组成seo关键词有话要多少钱
  • wordpress设置导航高度南通seo
  • 单机怎么做网站网站策划
  • 培训网站大数据分析品牌企业seo咨询
  • 广东手机网站建设哪家专业官方百度app下载
  • 智能建站是什么百度手机助手app免费下载
  • h5case什么网站排行榜网站
  • 移动网站排名教程典型的网络营销案例
  • 遵义网站建设哪家好推广链接点击器
  • 河池网站建设公司河北网络科技有限公司
  • 医疗网站建设讯息线上推广如何引流
  • 做养生的网站多吗seo 0xu
  • 网站后台怎么做超链接1个百度指数代表多少搜索
  • 自适应网站建设服务哪家好如何开展网络营销活动
  • 免费网站申请注册百度导航如何设置公司地址
  • 哪种语言做网站好短链接在线生成官网
  • 深圳网站设计九曲白山seo
  • 商城网站的管理用户模块房地产销售技巧和话术
  • esc怎么做网站培训总结
  • 长沙做网站 必看 磐石网络搜索引擎优化面对哪些困境
  • 做网站如何给图片命名网站关键字优化软件
  • 景区网站建设方案百度推广一天费用200
  • 零基础自己建网站开发一个app软件多少钱
  • filetype ppt 网站建设目前推广平台都有哪些
  • 为客户做网站的方案一个公司可以做几个百度推广
  • 用照片做模板下载网站好cnzz