Im trying to disable shadow detection in openCV when using the BackgroundSubtractor algorithm BackgroundSubtractorMOG2. However even after setting bShadowDetection to false, the algorithm still seems to track shadows as foreground objects.
cv::BackgroundSubtractorMOG2 bg;
bg.nmixtures = 3;
bg.bShadowDetection = false;
I have tried to adjust different members of the BackgroundSubtractorMOG2 class in order to disable the shadow tracking with no chance. important class members of BackgroundSubtractorMOG2
Those that should be concerning shadow detection such as bShadowDetection or fTau seem to have no effect. The explanation in the documentation is also somehow not adequate.