In order to enhance the reliability of the moving target detection, an adaptive moving target detection algorithm based on the Gaussian mixture model is proposed. This algorithm employs Gaussian mixture distributions in modeling the background of each pixel. As a result, the number of Gaussian distributions is not fixed but adaptively changes with the change of the pixel value frequency. The pixels of the difference image are divided into two parts according to their values. Then the two parts are separately segmented by the adaptive threshold, and finally the foreground image is obtained. The shadow elimination method based on morphological reconstruction is introduced to improve the performance of foreground image's segmentation. Experimental results show that the proposed algorithm can quickly and accurately build the background model and it is more robust in different real scenes.