示例#1
0
        private void btnTrackStart_Click(object sender, System.EventArgs e)
        {
            FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            for (int i = 0; i < videoDevices.Count; i++)
            {
                if (videoDevices[i] != null)
                {
                    WebCam thisWebCam = new WebCam(videoDevices[i].MonikerString);
                    spinningTriangleControl.WebCams.Add(thisWebCam);
                }
            }

            List <string> myString = new List <string>();

            for (int i = 0; i < videoDevices.Count; i++)
            {
                myString.Add(i.ToString());
            }

            var result = from a in myString
                         from b in myString
                         from c in myString
                         where a != b && a != c && b != c
                         select a + "," + b + "," + c;

            CamPermutations = result.ToList();

            List <int> temp = CamPermutations[camPerm % 6].Split(',').Select(x => int.Parse(x)).ToList();

            spinningTriangleControl.WebCamPermute = temp;
            camPerm++;

            //spinningTriangleControl.IntersectionLines.Clear();
            //for (int i = 0; i < spinningTriangleControl.WebCams.Count; i++)
            //{
            //    spinningTriangleControl.IntersectionLines.Add(new Line3D());
            //    spinningTriangleControl.trackInCamera.Add(false);
            //}

            //spinningTriangleControl.IntersectionLines = new List<Line3D>();
            //spinningTriangleControl.IntersectionAverage = new List<Point3D>(spinningTriangleControl.WebCams.Count);
        }
示例#2
0
        private void btnTrackStart_Click(object sender, System.EventArgs e)
        {
            FilterInfoCollection videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            for (int i = 0; i < videoDevices.Count; i++)
            {
                if (videoDevices[i] != null)
                {
                    WebCam thisWebCam = new WebCam(videoDevices[i].MonikerString);
                    spinningTriangleControl.WebCams.Add(thisWebCam);
                }
            }

            List<string> myString = new List<string>();

            for (int i = 0; i < videoDevices.Count; i++)
            {
                myString.Add(i.ToString());
            }

            var result = from a in myString
                            from b in myString
                         from c in myString
                            where a != b && a != c && b != c
                         select a + "," + b + "," + c;

            CamPermutations = result.ToList();

            List<int> temp = CamPermutations[camPerm % 6].Split(',').Select(x => int.Parse(x)).ToList();
            spinningTriangleControl.WebCamPermute = temp;
            camPerm++;

            //spinningTriangleControl.IntersectionLines.Clear();
            //for (int i = 0; i < spinningTriangleControl.WebCams.Count; i++)
            //{
            //    spinningTriangleControl.IntersectionLines.Add(new Line3D());
            //    spinningTriangleControl.trackInCamera.Add(false);
            //}

            //spinningTriangleControl.IntersectionLines = new List<Line3D>();
            //spinningTriangleControl.IntersectionAverage = new List<Point3D>(spinningTriangleControl.WebCams.Count);
        }