Shadow segmentation is a critical issue for systems aiming at extracting, tracking or recognizing objects in a given scene. Shadows can in fact modify the shape and colour of objects and therefore affect scene analysis and interpretation systems in many applications, such as video database search and retrieval, as well as video analysis in applications such as video surveillance. We present a shadow segmentation algorithm which includes two stages. The first stage extracts moving cast shadows in each frame of the sequence. The second stage tracks the extracted shadows in the subsequent frames. Tentative moving shadow regions are first identified based on spectral and geometrical properties of shadows. In order to confirm this tentative identification, shadow regions are then tracked over time. This second stage aims at exploiting the prior knowledge of a shadow detected in previous frames by evaluating its temporal behaviour. Shadow tracking is a difficult task, since colour, texture, and motion features in shadow regions cannot be used for solving the correspondence problem. Colour and texture change according to changes in the background's characteristics. The measurement of motion cannot be reliably computed for shadows. Therefore shadows may be described only by a limited amount of information. The proposed tracking algorithm makes use of this information and provides a reliability estimation of shadow recognition results of the first stage over time. This temporal analysis eliminates the possible ambiguities of the first stage and improves the efficiency of the overall shadow detection algorithm. The benefit of the proposed shadow segmentation and tracking algorithm is evaluated on both indoor and outdoor scenes. The obtained results are validated based on subjective as well as objective comparisons.