// Set new motion processing algorithm private void SetMotionProcessingAlgorithm(IMotionProcessing processingAlgorithm) { lock (this) { detector.MotionProcessingAlgorithm = processingAlgorithm; } }
private void SetMotionProcessingAlgorithm(IMotionProcessing processingAlgorithm) { lock (sync_context) { detector.MotionProcessingAlgorithm = processingAlgorithm; } }
public static MotionDetector GetDefaultMotionDetector() { IMotionDetector detector = null; IMotionProcessing processor = null; MotionDetector motionDetector = null; //detector = new AForge.Vision.Motion.TwoFramesDifferenceDetector() //{ // DifferenceThreshold = 15, // SuppressNoise = true //}; //detector = new AForge.Vision.Motion.CustomFrameDifferenceDetector() //{ // DifferenceThreshold = 55, // KeepObjectsEdges = true, // SuppressNoise = true //}; detector = new SimpleBackgroundModelingDetector() { DifferenceThreshold = 10, FramesPerBackgroundUpdate = 10, KeepObjectsEdges = true, MillisecondsPerBackgroundUpdate = 0, SuppressNoise = true }; //processor = new AForge.Vision.Motion.GridMotionAreaProcessing() //{ // HighlightColor = System.Drawing.Color.Red, // HighlightMotionGrid = true, // GridWidth = 100, // GridHeight = 100, // MotionAmountToHighlight = 10F //}; processor = new BlobCountingObjectsProcessing() { HighlightColor = System.Drawing.Color.Red, HighlightMotionRegions = true, MinObjectsHeight = 200, MinObjectsWidth = 200 }; motionDetector = new MotionDetector(detector, processor); return(motionDetector); }
public MainWindowViewModel() { VideoDevices = new ObservableCollection <FilterInfo>(); GetVideoDevices(); IsDesktopSource = true; StartSourceCommand = new RelayCommand(StartCamera); StopSourceCommand = new RelayCommand(StopCamera); StartRecordingCommand = new RelayCommand(StartRecording); StopRecordingCommand = new RelayCommand(StopRecording); SaveSnapshotCommand = new RelayCommand(SaveSnapshot); IpCameraUrl = "http://88.53.197.250/axis-cgi/mjpg/video.cgi?resolution=320×240"; _motionProcessing = new BlobCountingObjectsProcessing(true); _motionDetector = new SimpleBackgroundModelingDetector(true); _detector = new MotionDetector( _motionDetector, _motionProcessing); }
/// <summary> /// Initializes a new instance of the <see cref="MotionDetector"/> class. /// </summary> /// /// <param name="detector">Motion detection algorithm to apply to each video frame.</param> /// <param name="processor">Motion processing algorithm to apply to each video frame after /// motion detection is done.</param> /// public MotionDetector(IMotionDetector detector, IMotionProcessing processor) { this.detector = detector; this.processor = processor; }
public void createMotionDetector() { switch (detectionSensitivity) { case DETECTIONSENSITIVITY.LOW: { sensitivityFactor = 0.15; break; } case DETECTIONSENSITIVITY.MEDIUM: { sensitivityFactor = 0.1; break; } case DETECTIONSENSITIVITY.HIGH: { sensitivityFactor = 0.01; break; } } switch (detectionMethod) { case MOTION.MOTION_AREA_HIGHLIGHTING: { motionProcessor = new MotionAreaHighlighting(); break; } case MOTION.MOTION_GRID_AREA_HIGHLIGHTING: { motionProcessor = new GridMotionAreaProcessing(5, 5); break; } case MOTION.MOTION_BORDER_HIGHLIGHTING: { motionProcessor = new MotionBorderHighlighting(); break; } case MOTION.MOTION_BLOB_COUNTER: { motionProcessor = new BlobCountingObjectsProcessing(); break; } } switch (detecionSpeed) { case DETECTIONSPEED.FAST: { skipFrame = 3; break; } case DETECTIONSPEED.MEDIUM: { skipFrame = 2; break; } case DETECTIONSPEED.SLOW: { skipFrame = 1; break; } } if (detectionType == DETECTIONTYPE.TWO_FRAMES_DIFFERENCE) { detector = new TwoFramesDifferenceDetector(true); } else { detector = new SimpleBackgroundModelingDetector(true, true); } motionDetector = new MotionDetector(detector, motionProcessor); motionDetector.MotionZones = detectionArea; }
/// <summary> /// Initializes a new instance of the <see cref="MotionDetector"/> class. /// </summary> /// /// <param name="detector">Motion detection algorithm to apply to each video frame.</param> /// <param name="processor">Motion processing algorithm to apply to each video frame after /// motion detection is done.</param> /// public MotionDetector( IMotionDetector detector, IMotionProcessing processor ) { this.detector = detector; this.processor = processor; }
/// <summary> /// Initializes a new instance of the <see cref="MotionDetector"/> class. /// </summary> /// /// <param name="detector">Motion detection algorithm to apply to each video frame.</param> /// <param name="processor">Motion processing algorithm to apply to each video frame after /// motion detection is done.</param> /// public MotionDetector(IMotionDetector detector, IMotionProcessing processor) { _detector = detector; _processor = processor; }
/// <summary> /// Initializes a new instance of the <see cref="MotionDetector"/> class. /// </summary> /// /// <param name="detector">Motion detection algorithm to apply to each video frame.</param> /// <param name="processor">Motion processing algorithm to apply to each video frame after /// motion detection is done.</param> /// public MotionDetector( IMotionDetector detector, IMotionProcessing processor ) { _detector = detector; _processor = processor; }
// Set new motion processing algorithm private void SetMotionProcessingAlgorithm( IMotionProcessing processingAlgorithm ) { lock ( this ) { detector.MotionProcessingAlgorithm = processingAlgorithm; } }
public void createMotionDetector() { switch (detectionSensitivity) { case DETECTIONSENSITIVITY.LOW: { sensitivityFactor = 0.15; break; } case DETECTIONSENSITIVITY.MEDIUM: { sensitivityFactor = 0.1; break; } case DETECTIONSENSITIVITY.HIGH: { sensitivityFactor = 0.01; break; } } switch (detectionMethod) { case MOTION.MOTION_AREA_HIGHLIGHTING: { motionProcessor = new MotionAreaHighlighting(); break; } case MOTION.MOTION_GRID_AREA_HIGHLIGHTING: { motionProcessor = new GridMotionAreaProcessing(5, 5); break; } case MOTION.MOTION_BORDER_HIGHLIGHTING: { motionProcessor = new MotionBorderHighlighting(); break; } case MOTION.MOTION_BLOB_COUNTER: { motionProcessor = new BlobCountingObjectsProcessing(); break; } } switch (detecionSpeed) { case DETECTIONSPEED.FAST: { skipFrame = 3; break; } case DETECTIONSPEED.MEDIUM: { skipFrame = 2; break; } case DETECTIONSPEED.SLOW: { skipFrame = 1; break; } } if (detectionType == DETECTIONTYPE.TWO_FRAMES_DIFFERENCE) detector = new TwoFramesDifferenceDetector(true); else detector = new SimpleBackgroundModelingDetector(true, true); motionDetector = new MotionDetector(detector, motionProcessor); motionDetector.MotionZones = detectionArea; }