Beispiel #1
0
        public MotionDetector GetDefaultMotionDetector()
        {
            IMotionDetector motionDetector = null;
            MotionDetector  detector       = null;

            process = new CountingObjectsProcessing();
            //AForge.Vision.Motion.IMotionDetector detector = null;
            //AForge.Vision.Motion.IMotionProcessing processor = null;
            // AForge.Vision.Motion.MotionDetector motionDetector = null;
            process.MinObjectsHeight = minHeight;
            process.MinObjectsWidth  = minWidth;
            //process.blobCounter.ObjectsOrder = ObjectsOrder.None;

            motionDetector = new SimpleBackgroundModelingDetector()
            {
                DifferenceThreshold = 50,                //ilosc roznicy pomiedzy pikselami
                //FramesPerBackgroundUpdate = 10000,
                MillisecondsPerBackgroundUpdate = 60000, //po tylu milisekundach restartowane jest tlo
                SuppressNoise = true
            };

            detector = new MotionDetector(motionDetector, process);

            return(detector);
        }
        public SpeedMeasurer()
        {
            blobCounter = new BlobCountingObjectsProcessing(50, 50, false);
            blobCounter.HighlightColor = Color.FromArgb(0, 255, 0);
            SimpleBackgroundModelingDetector bmd = new SimpleBackgroundModelingDetector(true, true);

            bmd.FramesPerBackgroundUpdate = 1;
            detector = new MotionDetector(bmd, blobCounter);
        }
Beispiel #3
0
        public MotionHandler(CameraConnection camera)
        {
            this.camera = camera;

            if (camera.Settings.Properties.EnableMotionDetection)
            {
                // create the motion sensor and processing
                detector  = new SimpleBackgroundModelingDetector();
                processor = new BlobCountingObjectsProcessing(20, 20); // minimum size of objects to find

                // create the motion detector
                motionDetector             = new MotionDetector(detector, processor);
                motionDetector.MotionZones = camera.Settings.MotionZones;

                // bind events
                this.camera.NewFrameEvent += Camera_NewFrameEvent;
            }
        }
        public static MotionDetector GetDefaultMotionDetector()
        {
            var detector = new SimpleBackgroundModelingDetector()
            {
                DifferenceThreshold             = 10,
                FramesPerBackgroundUpdate       = 10,
                KeepObjectsEdges                = true,
                MillisecondsPerBackgroundUpdate = 0,
                SuppressNoise = true
            };
            var processor = new BlobCountingObjectsProcessing()
            {
                HighlightColor         = System.Drawing.Color.Red,
                HighlightMotionRegions = true,
                MinObjectsHeight       = 10,
                MinObjectsWidth        = 10
            };
            var motionDetector = new MotionDetector(detector, processor);

            return(motionDetector);
        }