In this paper, a robust recognition algorithm for encoded targets in close-range photogrammetry is proposed. Firstly, Canny detector is used to detect edges from an input image. Secondly, the least squares method is employed to fit ellipses to the set of data points yielded by the edge detector. Three restriction criteria based on length, shape, and embedding are applied to restrict the set of candidate ellipses. The initial parameters of a candidate ellipse are modified according to the information of the encoded band pattern. Finally, the identification number of the encoded target is obtained through a certification and interpretation of the arrangement of the bit segments surrounding this encoded target. The proposed algorithm has been applied to a close-range photogrammetric system, and its robustness is validated by real measuring experiments and industrial applications.