opencvcomputer-visionbackground-subtraction

BackgroundSubtractorMOG2 shadow detection is not working in sunny scenarios


I'm using the BackgroundSubtractorMOG2 background detection algorithm from OpenCV. Specially I'm interested in detecting and removing the shadows from the foreground. As per my experiments it works properly in cloudy scenarios but it fails in sunny scenarios. In this case the MOG2 detects the shadows as part of the blobs (instead of marking them shadows -- 127 gray scale value). I have tried setting different values for the fTau parameter but it doesn't seem to affect the behavior. The shadows are still not correctly detected. Any help is more than welcome.

PD: I'm using OpenCV 2.3.1 version


Solution

  • After several experiments I realized that regardless of the parameters the MOG2 algorithm always fail to detect correctly the shadow under sunny scenarios.