Shadow detection and removal in real scene images are a significant problem for target detection. This work proposes an improved shadow detection and removal algorithm for urban video surveillance. First, the foreground is detected by background subtraction and the shadow is detected by HSV color space. Using local variance and OTSU method, we obtain the moving targets with texture features. According to the characteristics of shadow in HSV space and texture feature, the shadow is detected and removed to eliminate the shadow interference for the subsequent processing of moving targets. Finally, we embed our algorithm into C/S framework based on the HTML5 web socket protocol. Both the experimental and actual operation results show that the proposed algorithm is efficient and robust in target detection and shadow detection and removal under different scenes.