The precision and efficiency of the registration of megavolt-level electronic portal imaging devices (EPID) images with the naked eye in the orthogonal window are reduced. This study aims to develop a new registration algorithm with enhanced accuracy and efficiency. Ten setup errors with different translation and rotation were simulated with the phantom. For each error, one set of simulated computer tomography images and EPID images were acquired and registered with the traditional and the new method. The traditional method was performed by two senior physicists with the Varian Offline Review software. The new method is basing on the comparison of the precise contours of the same bone structure in the digital reconstruction radiography images and the EPID images, and the contours were fitted with an automatic edge detection algorithm based on gradient images. The average error of the new method was decreased by 44.44%, 28.33%, 49.09% in the translation of X, Y, and Z axes (The traditional vs. the new: X axes, 0.45 mm vs. 0.25 mm; Y axes, 0.75 mm vs. 0.35 mm; Z axes, 0.55 mm vs. 0.28 mm), 42.86% and 40.48% in the rotation of X and Z axes (The traditional vs. the new: X axes, 0.49° vs. 0.28°; Z axes, 0.42° vs. 0.25°), respectively. The average elapsed time in the new method was reduced by 11.14% (The traditional vs. the new: 44 s vs. 39.1 s). The new registration method has significant advantages of accuracy and efficiency compared with the traditional method.