Patient positioning in modern radiotherapy is becoming far more important because a small positioning error may result in missing target and irradiating normal tissues in treatment of small lesions. Clinical outcome of radiotherapy can potentially be improved by increasing the precision of tumor localization and dose delivery during the treatment. In this paper an accurate and precise patient positioning system has been achieved through alignment of real-time three dimensional (3D) surface images with a reference surface image. The real-time 3D surface is captured using a state-of-art 3D stereovision system, and then is matched with the pre-defined reference image generated from treatment planning data. Positioning parameters are calculated by automatically aligning the real-time surface and the reference surface via a modified Iterative Closest Points (ICP) algorithm. Results from phantom experiments and clinical applications demonstrated the excellent efficacy of <2 minutes and the desired accuracy and precision of <1 mm in isocenter shifts and of <1 degree in rotations.