In this thesis, an algorithm that can detect a moving human and behavior analysis under complex foreground is proposed. First, we build the background image needed for moving human and behavior detection, and then use the temporal difference to obtain the moving objects. The information of moving human is obtained from a rate algorithm. Finally, the combination of temporal difference and background subtraction methods is used as the foundation for moving human detection and behavior analysis under the complex Foreground. In this thesis, the running images are captured by a digital camera. Experiments are carried out by the simulation of realistic human. The experimental results show that the proposed method offers the extremely high correct identification rate for moving human detection and behavior analysis.