Motion detection and tracking are both fundamental steps in video surveillance. This paper describes two improved algorithms for motion detection and tracking, respectively. Firstly, the shadow and ghost detection processing is fused with updating the background subtraction model, after the frame is transformed to HSV color space from RGB color space in order to reduce the effect of illumination changes, shadows, and ghosts. And the result of detection is used as initialization for tracking. Secondly, the gradient field is combined with region information to locate the boundary of the object accurately, instead of the traditional level-set method, which only utilizes the gradient field to propagate a front. Experimental results show that the algorithms decrease the computational complexity and provide accurate location of the object boundary.