/motion-detection-with-image-filtering

Detect a moving object by looking at large gradients in the temporal evolution of the pixel values

Primary LanguageMATLAB

Motion Detection with Image Filtering

This project presents our implementations of a simple motion detector for image sequences captured with a stationary camera. Image sequences from three different scenarios are given for testing the algorithms - “RedChair”, “Office”, and “EnterExitCrossingPath2cor”. Since the camera is stationary, the intensity values of a single background pixel should remain constant over time without considering the noise. By applying a 1D derivative filter to each image pixel sequences over time, we can detect motion by observing that the gradients for the pixels of stationary background almost equal to 0 while the gradients for the pixels of moving objects fluctuating greatly. In our experiments, we implement a simple 0.5[-1,0,1] filter and a 1D derivative of a Gaussian as temporal derivative filters. We also implement three different 2D spatial smoothing filters - 3 × 3, 5 × 5 box filters and 2D Gaussian filter for image smoothing. Noise can be reduced by applying the smoothing filters before computing the gradients. To demonstrate the results visually, we threshold the absolute values of the gradients to create a 0 and 1 mask of the moving objects. Two automatic threshold selection strategies are implemented and tested.