Пример #1
0
        public VideoInterpreter(string pathToVideoSource, string pathToXmlFile, Dispatcher dispatcher)
        {
            //sets variables that are not passed
            this.showWindow = false;
            numCarsInLot    = 0;
            steady          = 0;
            oldNumCarsInLot = 0;
            fps             = 60;
            frameWidth      = 1920;
            frameHeight     = 1080;
            didStart        = false;
            didStop         = false;
            didEnter        = false;
            frCt            = 0;

            CarDidEnter = null;
            CarDidLeave = null;

            this.pathToVideoSource = pathToVideoSource;
            this.dispatcher        = dispatcher;

            //sets up video stream pull
            vCapture = new Emgu.CV.VideoCapture(pathToVideoSource);
            if (fps > 0)
            {
                vCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.Fps, fps);
            }
            vCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameWidth, frameWidth);
            vCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameHeight, frameHeight);
            casc = new Emgu.CV.CascadeClassifier(pathToXmlFile);
        }
Пример #2
0
 //overides the 30fps count if needed
 public void setfps(double fps)
 {
     if (!didStart)
     {
         if (fps > 0)
         {
             this.fps = fps; vCapture.SetCaptureProperty(Emgu.CV.CvEnum.CapProp.Fps, fps);
         }
     }
 }