Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public SeqPartition()
        {
            CvMemStorage storage = new CvMemStorage(0);

            pointSeq = new CvSeq <CvPoint>(SeqType.EltypeS32C2, CvSeq.SizeOf, storage);
            Random rand = new Random();

            canvas = new IplImage(Width, Height, BitDepth.U8, 3);

            colors = new CvScalar[Count];
            for (int i = 0; i < Count; i++)
            {
                CvPoint pt = new CvPoint
                {
                    X = rand.Next(Width),
                    Y = rand.Next(Height)
                };
                pointSeq.Push(pt);
                int icolor = rand.Next() | 0x00404040;
                colors[i] = Cv.RGB(icolor & 255, (icolor >> 8) & 255, (icolor >> 16) & 255);
            }

            using (window = new CvWindowEx()
            {
                Text = "points"
            })
            {
                window.CreateTrackbar("threshold", 10, 50, OnTrack);
                OnTrack(10);
                CvWindowEx.WaitKey();
            }
        }
Ejemplo n.º 2
0
        public CvWindowExTest()
        {
            image = new IplImage(Const.ImageLenna);

            using (window = new CvWindowEx(image))
            {
                window.Text = "CvWindowEx Test";
                window.CreateTrackbar("foo", 127, 255, OnTrack);
                OnTrack(127);
                CvWindowEx.WaitKey();
            }
        }