本文整理匯總了C#中OpenCvSharp.IplImage.PolyLine方法的典型用法代碼示例。如果您正苦於以下問題:C# IplImage.PolyLine方法的具體用法?C# IplImage.PolyLine怎麽用?C# IplImage.PolyLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenCvSharp.IplImage
的用法示例。
在下文中一共展示了IplImage.PolyLine方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawSubdivFacet
/// <summary>
///
/// </summary>
/// <param name="img"></param>
/// <param name="edge"></param>
private void DrawSubdivFacet(IplImage img, CvSubdiv2DEdge edge)
{
CvSubdiv2DEdge t = edge;
int count = 0;
// count number of edges in facet
do
{
count++;
t = t.GetEdge(CvNextEdgeType.NextAroundLeft);
} while (t != edge);
CvPoint[] buf = new CvPoint[count];
// gather points
t = edge;
int i;
for (i = 0; i < count; i++)
{
CvSubdiv2DPoint pt = t.Org();
if (pt == null)
{
break;
}
buf[i] = pt.Pt;
t = t.GetEdge(CvNextEdgeType.NextAroundLeft);
}
if (i == count)
{
Random rand = new Random();
CvSubdiv2DPoint pt = edge.RotateEdge(RotateEdgeFlag.Rotate).Dst();
img.FillConvexPoly(buf, CvColor.Random(), LineType.AntiAlias, 0);
img.PolyLine(new CvPoint[][] { buf }, true, CvColor.Black, 1, LineType.AntiAlias, 0);
DrawSubdivPoint(img, pt.Pt, CvColor.Black);
}
}