예제 #1
0
        public CVConnectedComp MeanShift(System.Drawing.Rectangle window, int termCriteria, int maxIterations, double eps)
        {
            System.Drawing.Rectangle realWindow = new System.Drawing.Rectangle(0, 0, Width, Height);
            if (!realWindow.IntersectsWith(window))
            {
                CVConnectedComp cc = new CVConnectedComp(window);
                return(cc);
            }

            realWindow.Intersect(window);

            __CvRect         wnd = new __CvRect(realWindow);
            __CvTermCriteria tc  = PInvoke.cvTermCriteria(termCriteria, maxIterations, eps);

            __CvConnectedComp comp = new __CvConnectedComp();

            PInvoke.cvMeanShift(Internal, wnd, tc, ref comp);
            CVUtils.CheckLastError();
            return(new CVConnectedComp(ref comp));
        }
예제 #2
0
        public CVConnectedComp MeanShift(System.Drawing.Rectangle window, int termCriteria, int maxIterations, double eps)
        {
            System.Drawing.Rectangle realWindow = new System.Drawing.Rectangle(0, 0, Width, Height);
            if (!realWindow.IntersectsWith(window))
            {
                CVConnectedComp cc = new CVConnectedComp(window);
                return cc;
            }

            realWindow.Intersect(window);

            __CvRect wnd = new __CvRect(realWindow);
            __CvTermCriteria tc = PInvoke.cvTermCriteria(termCriteria, maxIterations, eps);

            __CvConnectedComp comp = new __CvConnectedComp();
            PInvoke.cvMeanShift(Internal, wnd, tc, ref comp);
            CVUtils.CheckLastError();
            return new CVConnectedComp(ref comp);
        }