Beispiel #1
0
        void btnSettings_Click(object sender, EventArgs e)
        {
            btnSettings_MouseUp(sender, null);
            FeedSettings settings = new FeedSettings();

            settings.setDetectorSettings(_motionDetector.detectionMethod, _motionDetector.detectionType,
                                         _motionDetector.detecionSpeed, _motionDetector.detectionSensitivity);
            settings.setFeedSettings(feedName, sourceAddress, isEntrance, robustChecking);
            settings.background   = (Bitmap)curFrame.Clone();
            settings.resultRegion = _motionDetector.detectionArea;

            if (settings.ShowDialog() == DialogResult.OK)
            {
                this.feedName = settings.feedName;
                setFeedName(feedName);
                this.isEntrance     = settings.isEntrance;
                this.robustChecking = settings.robustChecking;
                _motionDetector.updateMotionDetectorDetails(settings.resultRegion, settings.processor, settings.detector, settings.speed, settings.sensitivity);
                //loadVideo(sourceAddress);
                //startVideo();
                if (!sourceAddress.Equals(settings.feedURL))
                {
                    //must restart camera
                    this.sourceAddress = settings.feedURL;
                    loadVideo(sourceAddress);
                    startVideo();
                }
            }
        }
Beispiel #2
0
        //ADDING OF VIDEO FEEDS

        #region add video feed

        private void btnAddFeed_Click(object sender, EventArgs e)
        {
            FeedSettings settings = new FeedSettings();

            //have some default settings
            settings.setDetectorSettings(MotionDetectorInstance.MOTION.MOTION_BORDER_HIGHLIGHTING, MotionDetectorInstance.DETECTIONTYPE.TWO_FRAMES_DIFFERENCE,
                                         MotionDetectorInstance.DETECTIONSPEED.SLOW, MotionDetectorInstance.DETECTIONSENSITIVITY.HIGH);
            settings.setFeedSettings("", @"C:\Users\s212227122\Desktop\VehicleSystem\My Movie.wmv", true, true);
            settings.background = Resources.preview_frame;

            if (settings.ShowDialog() == DialogResult.OK)
            {
                //VideoControl newControl = new VideoControl(settings.feedName, @"C:\Users\Matthew\Desktop\Front Edited.wmv", true, this) { Margin = new Padding(0) };
                //C:\Users\Matthew\Desktop\Front Edited.wmv
                VideoControl newControl = new VideoControl(settings.feedName, settings.feedURL, settings.isEntrance,
                                                           this)
                {
                    Margin = new Padding(0), robustChecking = settings.robustChecking
                };
                newControl.updateMotionDetectorDetails(settings.resultRegion, settings.processor, settings.detector, settings.speed, settings.sensitivity);
                _videoControls.Add(newControl);
                pnlVideoFeed.Controls.Add(newControl);
            }

            Console.WriteLine("Stream added");
        }