System and method for motion detection in a surveillance video
View Patent ↗In some embodiments, a non-transitory processor-readable medium stores code representing instructions to cause a processor to smooth a current image of a scene to produce a smoothed image and subtract pixel values of a background image of the scene from corresponding pixel values of the smoothed image to produce an altitude difference image. Pixel values of the altitude difference image are weighted to produce a weighted difference image. The weighted difference image is convolved to produce a convoluted difference image. A threshold is applied to each pixel of the convoluted difference image to produce a thresholded difference image. Pixels having a value less than the threshold are removed from the thresholded difference image and classified as background pixels. Foreground pixels are determined based on the thresholded difference image.
1. A non-transitory processor-readable medium storing code representing instructions to cause a processor to:
smooth a current image of a scene to produce a smoothed image;
subtract pixel values of a background image of the scene from corresponding pixel values of the smoothed image to produce an altitude difference image;
smooth the altitude difference image with a first standard of deviation of pixel values of the altitude difference image to produce a first smoothed altitude difference image; smooth the altitude difference image with a second standard of deviation of pixel values of the altitude difference image to produce a second smoothed altitude difference image; multiply pixel values of the first smoothed altitude difference image with pixel values of the second smoothed altitude difference image to produce a weighted difference image;
convolve the weighted difference image to produce a convoluted difference image;
apply a threshold to each pixel of the convoluted difference image to produce a thresholded difference image, pixels having a value less than the threshold being removed from the thresholded difference image and classified as background pixels; and
determine foreground pixels based on the thresholded difference image.
2. The non-transitory processor-readable medium of claim 1 , wherein the code representing instructions to cause a processor to smooth the current image includes code representing instructions to cause a processor to smooth the current image using a Gaussian kernel.
3. The non-transitory processor-readable medium of claim 1 , wherein the code representing instructions to cause a processor to convolve the weighted difference includes code representing instructions to cause a processor to convolve the weighted difference using a Laplacian of Gaussian kernel.
4. The non-transitory processor-readable medium of claim 1 , further comprising code representing instructions to cause a processor to:
update the threshold for pixels classified as background pixels for a predetermined number of successive frames.
5. The non-transitory processor-readable medium of claim 1 , wherein the convoluted difference image is a non-binary edge image.
6. The non-transitory processor-readable medium of claim 1 , further comprising code representing instructions to cause a processor to:
update a pixel counter associated with each pixel classified as a background pixel; and
update the threshold for each pixel classified as a background pixel having a pixel counter with a value greater than a predetermined counter threshold.