Object detection has been widely used in smart video surveillance system, and many algorithms have been developed. However, these algorithms are sensitive to illumination. In this paper, a robust method has been proposed, which is based on the difference the edge maps between the background image and the image at present in the video. The outline of moving objects is drawn, and then the moving targets are detected and localized. Experiments show that this method is robust to illumination, can detect moving object correctly and be easily adopted in fixed camera environment with real-time application.