A two-CCD measurement system used in rendezvous and docking is designed, and the positioning algorithm of a marker lamp on target spacecraft is given with respect to a rendezvous and docking coordinate system. Then, the algorithm is extended to the case of three badge lamps, and accordingly the position, attitude matrix and three attitude angles of target spacecraft are educed with respect to a rendezvous and docking coordinate system. Compared with the algorithm of computer vision, the algorithm proposed in this paper is simple, fast and proper to application in rendezvous and docking.