/BackgroundSubtraction

By utilizing median filtering for background modeling and various image processing techniques, the project achieves accurate and efficient detection of moving objects in video frames. This can be further extended and optimized for real-time applications and more complex scenarios.

Primary LanguageC++

About

The Median was used as a background subtractor. This repository includes 2 types of foreground analyse. It is created in the first type by basic frame and median background differences. In the second, it was applied this article. It was offered in this article; that if we apply an edge algorithm on the frame and background and find differenence image, we can handle illumination changes in the frame like leaf move or shadow.

Clone the repository

https://github.com/kondukberna/BackgroundSubtraction.git

Build

mkdir build && build
cmake ..
make

Run

For basic foreground

./bgsubtraction -image_path video/video03.avi -folder_path folders -threshold_value 50 

If you want to try edge you have to add -edge flag.

./bgsubtraction -image_path video/video03.avi -folder_path folders -threshold_value 50 -edge

Result

Frame

Basic Foreground

Using Edge Foreground