I am looking for a way to extract foreground (without shadow) from a video sequence using C# (EmguCV). I have tried several method such as KNN, MOG, and MOG2. At the end, MOG2 is the best which is very close to my desired result. However, it is still failed to eliminate shadow.
As I know, there are several properties that can be used to perform better shadow removal using MOG2, such as: fTau, but these properties are only available in OpenCV (not EmguCV). So is there anyone who has implemented this kind of feature using C#?
Currently, I am able to eliminate shadow from foreground by transforming the shadow into black pixel. This can be done using ThresholdToZero method specifiying the shadow intensity value (150).
Before Shadow Removal
After Shadow Removal
Note: I use the MOG2 background subtractor and enable the shadow detection feature.