This paper presents a novel algorithm for performing video matting, which is built upon a proposed image matting algorithm that is fully automatic. The proposed algorithm utilizes a PCA-based shape model as a prior for guiding the matting process, so that manual interactions required by most existing image matting methods are unnecessary. We specifically consider a surveillance environment in which foreground windows are identified via a person detector. By applying the image matting algorithm to these foreground windows, on a per frame basis, we aim to fully automate the video matting process. Due to the inherent inaccuracy of any person detector, it is critical that the shape model be aligned with the object. We achieve this in a framework where the estimation of the alpha matte guided by the shape prior model, and the alignment process are simultaneously optimized based on a quadratic cost function. We report very promising results on a people data set collected from surveillance environments.