An example of a program made with OpenCV to detect the foreground on a security camera.
How it works?
1.Generate a model of the scene
a)Save 30 frames
b)For each pixel calculate the average and the standard deviation
2. Compare each frame with the model and extract the foreground
3. Clean the foreground and draw rectangles over the bigger areas
Code:
https://github.com/ironbar/OpenCV/blo...