I've got background subtraction to work quite well. But the problem is, it marks shadows as foreground as well.
Has anyone found some technique to get rid of shadows from the background? Links to techniques, papers, articles, etc you've used and got reliable will be awesome!
This is a well known problem, and like many well known problems, there has been a lot of research into it, meaning there is no real "optimal" solution.
Google Scholar suggests many papers for dealing with the problem. The works of Elgammal, Davis et al. are a good place to start.
You may also be interested in a more recent work on Detecting Ground Shadows in Outdoor Consumer Photographs.