In this paper, frame differential method will be used to detect moving targets in a static background video file, and pre-contour can be obtained by binarizing the detected targets . However,, the result are not what was expected, so the expansion and corrosion of mathematical morphology are used to extract the final contour of moving targets. in the progress of dealing with massive data , mathematical morphology is not good enough to achieve the need of the real-time in video surveillance. Considering the dilation and erosion is a kind of parallel processing operations, in order to improve the speed of mathematical morphology operations, this paper offers detailed implementation process of the dilation algorithm for parallel computing on GPU. Experimental results showed that GPU parallel processing on mathematical morphology algorithm faster than the CPU serial processing.