b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

cvcircle_glvertex3f_cvrectangle(3)

电脑杂谈  发布时间:2016-11-24 08:06:11  来源:网络整理

} CvBox2D;</pre>

</div>

绘制多边形有多个函数:

<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:312a9fc5-37ea-4f8b-aef2-8aa2deae8c3a" class="wlWriterEditableSmartContent" style="float: none; margin: 0px; display: inline; padding: 0px;">

<pre class="brush: c;">void cvFillPoly (

CvArr* img,

CvPoint** pts,

int*npts,

intcontours,

CvScalar color

intline_type = 8

);

void cvFillConvexPoly (

CvArr* img,

CvPoint* pts,

intnpts,

CvScalar color,

intline_tyoe = 8

);

void cvPolyLine (

CvArr* img,

CvPoint** pts,

int*npts,

intcontours,

intis_closed,

CvScalar color,

intthickness = 1,

intline_type = 8

);</pre>

</div>

这三个函数都可以绘制多边形,思路也基本相同,主要区别是如何描述点:

在cvFillPolly( )中,点是由CvPoint数组提供的。它允许cvFillPoly( )在一次调用中绘制多个多边形。同样的,npts是由计数点构成的数组,与多边形对应。如果把变量is_closed设为ture,那么下一个多边形的第一个线段就会从上一多边形最后一个点开始。cvFillPoly很稳定,可以处理自相交多边形,有孔的多边形等复杂问题。然而缺点是函数运行起来相对缓慢。

cvFillConvexPoly( )和cvFillPoly( )类似。不同的是,它一次只能画一个多边形,而且只能画凸多边形。优点是函数运行速度快。

第三个cvPolyLine( ),七参数与cvFillPoly( )基本相同,但因为只需画出多边形的边,不需处理相交情况。因此,函数运行速度远远超过cvFillPoly( )。

OpenCV有一个主要的函数,叫cvPutText( ),这个函数可以在图像上输出一些文本。函数原型:

<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:e4be00e6-14da-43d2-bde5-7b9ca69a37ae" class="wlWriterEditableSmartContent" style="float: none; margin: 0px; display: inline; padding: 0px;">

<pre class="brush: c;">void cvPutText (

CvArr* img,

consttext,

CvPoint origin,

const CvFont* font,


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-21679-3.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...