本文整理汇总了C#中Seq.PushMulti方法的典型用法代码示例。如果您正苦于以下问题:C# Seq.PushMulti方法的具体用法?C# Seq.PushMulti怎么用?C# Seq.PushMulti使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Seq
的用法示例。
在下文中一共展示了Seq.PushMulti方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSeqPerformance
public void TestSeqPerformance()
{
Point[] pts = new Point[1000000];
using (MemStorage stor = new MemStorage())
{
Stopwatch watch = Stopwatch.StartNew();
Seq<Point> seq = new Seq<Point>(stor);
seq.PushMulti(pts, Emgu.CV.CvEnum.BACK_OR_FRONT.FRONT);
watch.Stop();
Trace.WriteLine(String.Format("Time for storing {0} points: {1} milliseconds", pts.Length, watch.ElapsedMilliseconds));
watch.Reset(); watch.Start();
int counter = 0;
foreach (Point p in seq)
{
counter++;
}
watch.Stop();
Trace.WriteLine(String.Format("Time for reading {0} points: {1} milliseconds", pts.Length, watch.ElapsedMilliseconds));
}
}
示例2: TestConvexityDefacts
public void TestConvexityDefacts()
{
Image<Gray, Byte> image = new Image<Gray, byte>(300, 300);
Point[] polyline = new Point[] {
new Point(10, 10),
new Point(10, 250),
new Point(100, 100),
new Point(250, 250),
new Point(250, 10)};
using (MemStorage stor = new MemStorage())
{
Seq<Point> contour = new Seq<Point>(stor);
contour.PushMulti(polyline, Emgu.CV.CvEnum.BACK_OR_FRONT.FRONT);
image.Draw(contour, new Gray(255), 1);
Seq<MCvConvexityDefect> defactSeq =
contour.GetConvexityDefacts(
stor,
Emgu.CV.CvEnum.ORIENTATION.CV_CLOCKWISE);
MCvConvexityDefect[] defacts = defactSeq.ToArray();
Assert.AreEqual(1, defacts.Length);
Assert.AreEqual(new Point(100, 100), defacts[0].DepthPoint);
Assert.IsTrue(contour.InContour(new PointF(90, 90)) > 0);
Assert.IsTrue(contour.InContour(new PointF(300, 300)) < 0);
Assert.IsTrue(contour.InContour(new PointF(10, 10)) == 0);
}
}
示例3: GetConvexHull
public Seq<Point> GetConvexHull(List<Contour<Point>> contourPoints)
{
Seq<Point> hullPoints = new Seq<Point>(new MemStorage());
foreach (Seq<Point> countoure in contourPoints)
{
hullPoints.PushMulti(countoure.ToArray(), BACK_OR_FRONT.FRONT);
}
hullPoints = hullPoints.GetConvexHull(ORIENTATION.CV_COUNTER_CLOCKWISE);
return hullPoints;
}