public override void Init(Size[] imageSizes)
        {
            Clean();

            _flowflags      |= CMSConstants.CV_LKFLOW_PYR_A_READY;
            validTrackPoints = false;
            _pwinsz          = new CvSize(10, 10);
            _status          = new byte[NumberOfTrackingPoints];
            imageSize.Width  = imageSizes[0].Width;
            imageSize.Height = imageSizes[0].Height;

            _last_track_points    = new CvPoint2D32f[NumberOfTrackingPoints];
            _current_track_points = new CvPoint2D32f[NumberOfTrackingPoints];

            _criteria = new CvTermCriteria(CMSConstants.CV_TERMCRIT_ITER | CMSConstants.CV_TERMCRIT_EPS, 20, 0.03);

            _curFrame = CvImageWrapper.CreateImage(imageSize, PixelDepth, PixelColorChannels);

            _grey = CvImageWrapper.CreateImage(imageSize, PixelDepth, PixelChannels);

            _prev_grey = CvImageWrapper.CreateImage(imageSize, PixelDepth, PixelChannels);

            _pyramid = CvImageWrapper.CreateImage(imageSize, PixelDepth, PixelChannels);

            _prev_pyramid = CvImageWrapper.CreateImage(imageSize, PixelDepth, PixelChannels);

            _swap_temp = CvImageWrapper.CreateImage(imageSize, PixelDepth, PixelChannels);

            eyeLocator = new EyeLocator(EyeLocationImageCount);
            eyeLocator.Reset();

            eyeImagePoints = new PointF[2];

            CMSTrackingSuiteAdapter.SendMessage(InitMessage);
        }
Exemple #2
0
        public override void Init(Size[] imageSizes)
        {
            eyeLocator = new EyeLocator(3);
            eyeLocator.Reset();
            eyeLocatorTickCount = Environment.TickCount;
            lastClickPoint      = Point.Empty;

            int imageWidth  = imageSizes[0].Width;
            int imageHeight = imageSizes[0].Height;

            lock (mutex)
            {
                CleanStandard();
                InitStandard(imageWidth, imageHeight);
            }

            CMSTrackingSuiteAdapter.SendMessage(CMSConstants.PLEASE_CLICK_TF);
        }