当前位置: 首页>>代码示例>>C#>>正文


C# Seq.PushMulti方法代码示例

本文整理汇总了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));

             }
        }
开发者ID:samuto,项目名称:UnityOpenCV,代码行数:23,代码来源:AutoTestVarious.cs

示例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);
             }
        }
开发者ID:samuto,项目名称:UnityOpenCV,代码行数:28,代码来源:AutoTestVarious.cs

示例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;
        }
开发者ID:HumanRemote,项目名称:HumanRemote,代码行数:11,代码来源:BackgroundSubtractProcessor.cs


注:本文中的Seq.PushMulti方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。