Closed alexarje closed 1 year ago
I have started to look for a simple way of doing background subtraction based on static image and ended up using ffmpeg
.
Here are the resuls I managed to obtain so far, with the following foreground and background images.
Foreground Background
After differentiatng frames and applying curves and equilisation filtering, I propose to subtract the background according to 4 different thresholds (i.e extra_soft', 'soft', 'medium', 'hard'). I could nevertheless add more threshold flexibility to the user. Here are the results.
Extra soft Soft Medium Hard
On the other hand, I also tried this algorithm on the average image of a video recording and it works quite well too!
Background Foreground
I will now work on implementing it in the MGT
Great, looks nice. Very good to have this in the toolbox!
I have finish to implement a new subtract
function in the toolbox for doing background subtraction based on on a static image. More information on how to use it can be found in the wiki documentation.
It would be good to have a simple way of doing background subtraction based on on a static image. That is, a function that would read a video file + an image, and subtract the image for each video frame. The image could be a still from a video recording (e.g. in the beginning) or made as an average image of a short video recording. The main point would be to get a "clean" foreground video.