This paper presents a two-step method for eliminating the shadows of moving targets. As the first step, we improve the Gaussian mixture model for obtaining a real-time background and a moving foreground; secondly, we figure out the intersection of background difference and moving foreground for eliminating the concomitant shadow [1-5]. Experiment results indicate that our method has a preferable performance on eliminating the shadow in its entirety.