Nowadays, machine vision systems have been developed in different sectors of life, including industry, commerce, traortation, etc. Moving objects detection is the first and most basic step in some areas of machine vision. The important approaches used in the detection of moving objects include: Background subtraction, temporal differencing and the optical flow. Background subtraction approach is the most efficient approach and is widely used to detect moving objects in the fixed cameras. In recent years, some techniques have been proposed for performing background subtraction approach. One of the efficient approach is the kernel density estimation approach. In this approach, the probability of each pixels is calculated and then the probabilities are compared with a threshold value and then the moving area is detect. In this thesis, we present a fast and robust background subtraction method based on kernel density estimation. The background is modeled using spatial-temporal data and in order to improve the detection accuracy, foreground is modeled on small spatio neighbors. High computation complexity is one problem of the kernel density estimation method. To overcome this problem and also to enhance the detection rate, the difference between consecutive frames is used, so that if only the difference is more than a threshold value, the proposed method will model the background and foreground and will detect the moving object. To improve and enhance the spatial correlation in the detection, Markov model is used. Simulation results show that the proposed method outperforms other recent methods. Keywords: moving object detection, kernel density estimation, temporal differencing, markov random field