A Statistical Approach For Shadow Detection Using Spatio-Temporal Contexts